@font-face {
  font-family: "IM Fell English";
  src: url("../fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("../fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English SC";
  src: url("../fonts/im-fell-english-sc-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #647084;
  --brand: #8b0000;
  --brand-dark: #650000;
  --border: #dfe3e8;
  --shadow: 0 10px 28px rgba(17, 24, 39, .08);
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}

/* Öffentliche Pergament-Ansicht. Der Adminbereich behält sein sachliches UI. */
body.public-site {
  --bg: #cbb889;
  --card: rgba(239, 220, 171, .94);
  --text: #352417;
  --muted: #755f43;
  --brand: #7b281d;
  --brand-dark: #50160f;
  --border: rgba(90, 61, 33, .42);
  --shadow: 0 14px 32px rgba(55, 35, 17, .25);
  --radius: 4px;
  background-color: #cbb889;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(255, 246, 205, .45) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 71%, rgba(82, 50, 22, .14) 0 1px, transparent 2px),
    repeating-linear-gradient(8deg, rgba(72, 46, 24, .025) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #d8c594 0%, #c4ad78 52%, #d5c08e 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "IM Fell English", Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  letter-spacing: .006em;
}

.public-site main {
  position: relative;
  isolation: isolate;
}
.public-site main::before {
  position: absolute;
  z-index: -1;
  inset: 10px 8px 22px;
  border: 1px solid rgba(81, 52, 28, .16);
  box-shadow: inset 0 0 48px rgba(83, 53, 24, .08);
  content: "";
  pointer-events: none;
}
main { flex: 1; }
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.page-content { padding-top: 24px; padding-bottom: 36px; }
.spacer-sm { height: 12px; }
.spacer-md { height: 16px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-150%);
  border-radius: 8px;
  background: #fff;
  color: #111;
  padding: 10px 14px;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: #111318;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
}
.public-site .site-header {
  border-bottom: 1px solid #8d7049;
  background:
    linear-gradient(rgba(48, 31, 19, .95), rgba(39, 25, 15, .98)),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(255, 255, 255, .025) 16px 17px);
  box-shadow: 0 5px 18px rgba(48, 29, 12, .3);
}
.header-shell {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.public-site .brand {
  color: #f1dfb4;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.42rem;
  font-weight: 400;
  letter-spacing: .055em;
  text-shadow: 0 1px 1px #160d07;
}
.public-site .brand:hover { color: #fff0c9; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
  background: #b81212;
  box-shadow: 0 0 0 4px rgba(184, 18, 18, .17);
}
.public-site .brand-dot {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  border: 1px solid #d3a862;
  background: #812e20;
  box-shadow: 0 0 0 3px rgba(210, 165, 91, .17), inset 0 0 0 2px rgba(70, 15, 10, .28);
}
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  border-radius: 9px;
  color: #f4f4f5;
  padding: 9px 10px;
  text-decoration: none;
}
.public-site .nav a {
  border-radius: 2px;
  color: #ead7ac;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.01rem;
  letter-spacing: .035em;
}
.public-site .nav a:hover,
.public-site .nav a:focus-visible {
  background: rgba(235, 208, 151, .12);
  color: #fff1ce;
}
.public-site .nav .admin-link { border-color: rgba(224, 192, 129, .4); }
.nav a:hover, .nav a:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }
.nav .admin-link { border: 1px solid rgba(255, 255, 255, .2); margin-left: 4px; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.3rem;
}

.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 20px;
}
.public-site .card {
  position: relative;
  border-color: rgba(87, 57, 30, .4);
  background-color: var(--card);
  background-image:
    radial-gradient(circle at 15% 18%, rgba(255, 250, 220, .42), transparent 36%),
    repeating-linear-gradient(2deg, transparent 0 4px, rgba(72, 45, 22, .018) 4px 5px);
  box-shadow:
    0 15px 30px rgba(61, 39, 18, .21),
    inset 0 0 30px rgba(111, 73, 31, .08);
}
.public-site .card::after {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(90, 58, 30, .15);
  content: "";
  pointer-events: none;
}
.public-site .hero-card {
  border-top: 4px double #7b281d;
  text-align: center;
}
.hero-card { border-top: 4px solid var(--brand); padding-top: 22px; }
.h1, h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.2; }
.h2, h2 { margin: 0 0 10px; font-size: 1.18rem; line-height: 1.3; }
h3 { margin: 22px 0 8px; font-size: 1.02rem; }
.public-site .h1,
.public-site h1,
.public-site .h2,
.public-site h2,
.public-site h3,
.public-site h4 {
  color: #4b2817;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-weight: 400;
  letter-spacing: .035em;
}
.public-site .h1,
.public-site h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  text-shadow: 0 1px 0 rgba(255, 244, 205, .8);
}
.public-site .h2,
.public-site h2 { font-size: 1.4rem; }
p:first-child { margin-top: 0; }
p:last-child { margin-bottom: 0; }
.meta { color: var(--muted); font-size: .86rem; }
.public-site .meta { font-style: italic; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}
.post-title { margin: 4px 0 8px; font-size: 1.28rem; }
.public-site .post-title { font-size: 1.55rem; }
.post-title a { text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-excerpt { margin-top: 10px; }
.post-content { overflow-wrap: anywhere; }
.post-content p { margin: 0 0 1em; }
.post-content p:last-child { margin-bottom: 0; }
.post-content h2 { margin-top: 1.35em; font-size: 1.45rem; }
.post-content h3 { margin-top: 1.25em; font-size: 1.2rem; }
.post-content h4 { margin: 1.15em 0 .5em; font-size: 1.05rem; }
.post-content blockquote {
  margin: 1em 0;
  border-left: 4px solid var(--brand);
  background: #f8f9fa;
  padding: 10px 14px;
  color: #3d4652;
}
.public-site .post-title a { color: #64251a; }
.public-site .post-content blockquote {
  border-left-color: #7b281d;
  background: rgba(191, 164, 106, .2);
  color: #483321;
}
.post-content ul, .post-content ol { padding-left: 1.6em; }
.post-content a { overflow-wrap: anywhere; }
.category-list { display: grid; gap: 7px; }

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #262b33;
  padding: 9px 14px;
  cursor: pointer;
  line-height: 1.2;
  text-decoration: none;
}
.public-site .btn {
  border-color: #8d704b;
  border-radius: 3px;
  background: rgba(244, 226, 181, .62);
  color: #3d291a;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  letter-spacing: .025em;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 218, .38);
}
.public-site .btn:hover {
  border-color: #6b4b2e;
  background: rgba(249, 233, 192, .86);
  color: #26170e;
}
.public-site .btn.primary {
  border-color: #5d1b13;
  background: #7b281d;
  color: #fff0cd;
}
.public-site .btn.primary:hover {
  border-color: #3f100b;
  background: #5d1b13;
  color: #fff4d9;
}
.btn:hover { border-color: #b9c0c8; color: #111; text-decoration: none; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.btn.primary:hover { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }
.btn.danger { border-color: #b91c1c; background: #b91c1c; color: #fff; }
.btn.danger:hover { border-color: #8f1111; background: #8f1111; color: #fff; }
.btn.small { min-height: 36px; padding: 7px 11px; font-size: .84rem; }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.input, textarea, select {
  width: 100%;
  border: 1px solid #cfd5dc;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}
.public-site .input,
.public-site textarea,
.public-site select {
  border-color: #9a7c50;
  border-radius: 3px;
  background: rgba(249, 235, 199, .8);
  color: #342316;
}
textarea { min-height: 220px; resize: vertical; }
label { display: inline-block; margin-bottom: 5px; }
.row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.rich-editor {
  overflow: hidden;
  border: 1px solid #c8cfd7;
  border-radius: 12px;
  background: #fff;
}
.rich-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: #f5f6f8;
  padding: 9px;
}
.rich-editor__group {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  border-left: 1px solid #d8dde3;
  padding-left: 6px;
}
.rich-editor__select-label { margin: 0; }
.rich-editor__select {
  width: auto;
  min-width: 120px;
  height: 38px;
  border: 1px solid #c8cfd7;
  border-radius: 7px;
  background: #fff;
  padding: 5px 8px;
  font-size: .84rem;
}
.rich-editor__select-label--size .rich-editor__select { min-width: 105px; }
.rich-editor__button {
  min-width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #252b33;
  padding: 5px 8px;
  cursor: pointer;
  line-height: 1;
}
.rich-editor__button:hover,
.rich-editor__button:focus-visible {
  border-color: #b9c0c8;
  background: #fff;
}
.rich-editor__button.is-active {
  border-color: #b76b6b;
  background: #f7e8e8;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(139, 30, 30, .12);
}
.rich-editor__button--wide {
  min-width: auto;
  font-size: .78rem;
}
.rich-editor__button--align {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
}
.rich-editor__align-icon {
  display: flex;
  width: 20px;
  height: 18px;
  flex-direction: column;
  justify-content: space-between;
}
.rich-editor__align-icon > span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.rich-editor__align-icon > span:nth-child(2) { width: 65%; }
.rich-editor__align-icon > span:nth-child(3) { width: 85%; }
.rich-editor__align-icon > span:nth-child(4) { width: 52%; }
.rich-editor__align-icon--left > span { align-self: flex-start; }
.rich-editor__align-icon--center > span { align-self: center; }
.rich-editor__align-icon--right > span { align-self: flex-end; }
.rich-editor__align-icon--justify > span { width: 100%; }
.rich-editor__align-icon--justify > span:last-child { width: 72%; }
.rich-editor__color-label {
  display: inline-flex;
  height: 38px;
  margin: 0;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 7px;
  cursor: pointer;
  font-weight: 700;
}
.rich-editor__color-label:hover { border-color: #b9c0c8; background: #fff; }
.rich-editor__color-label input {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.rich-editor__surface {
  min-height: 360px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  padding: 18px;
  outline: none;
  line-height: 1.65;
}
.rich-editor__surface:focus { box-shadow: inset 0 0 0 3px rgba(230, 170, 0, .35); }
.rich-editor__surface:empty::before {
  content: "Beitragstext eingeben …";
  color: #8993a1;
}
.rich-editor__status {
  min-height: 31px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  padding: 5px 10px;
  text-align: right;
}

hr { margin: 16px 0; border: 0; border-top: 1px solid var(--border); }
.public-site hr {
  height: 7px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(102, 65, 34, .45), transparent) center / 100% 1px no-repeat;
}
.badge, .tag {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .75rem;
}
.badge { background: #111318; color: #fff; }
.tag { border: 1px solid var(--border); background: #fff; color: #374151; }
.notice { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 11px 13px; }
.notice.ok { border-color: #7bcf99; background: #eefbf3; }
.notice.warn { border-color: #e8c65d; background: #fff9e7; }
.notice.err { border-color: #ef9a9a; background: #fff1f1; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.stat { border: 1px solid var(--border); border-radius: 12px; background: #f8f9fa; padding: 14px; }
.stat strong { display: block; font-size: 1.55rem; line-height: 1.1; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: .88rem;
}
.table th { color: #414854; font-size: .8rem; }

.site-footer { border-top: 1px solid var(--border); background: #fff; }
.public-site .site-footer {
  border-top: 1px solid #755534;
  background:
    linear-gradient(rgba(55, 36, 22, .96), rgba(38, 25, 15, .99)),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(255, 255, 255, .022) 16px 17px);
  color: #ead8b2;
  box-shadow: 0 -4px 15px rgba(52, 32, 15, .18);
}
.public-site .site-footer a { color: #efc884; }
.public-site .site-footer .meta { color: #cbb990; }
.public-site .site-footer strong {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: .04em;
}
.footer-inner {
  min-height: 110px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 36%);
  grid-template-areas:
    "heading photo"
    "copy photo";
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}
.about-layout > h1 {
  grid-area: heading;
  margin-bottom: -14px;
}
.about-copy {
  grid-area: copy;
  min-width: 0;
}
.about-copy h2 {
  margin: 0 0 1em;
  color: #5d2119;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
}
.about-copy p {
  margin: 0 0 1.15em;
}
.about-copy .about-signature {
  margin: 1.8em 0 0;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.18rem;
}
.about-photo {
  position: relative;
  z-index: 1;
  grid-area: photo;
  margin: 4px 0 0;
  border: 1px solid #76583a;
  background: #e2c991;
  box-shadow: 0 10px 22px rgba(52, 33, 16, .28);
  padding: 8px 8px 10px;
  transform: rotate(.45deg);
}
.about-photo img {
  display: block;
  width: 100%;
  border: 1px solid rgba(61, 39, 21, .55);
  height: auto;
  filter: contrast(1.025);
}
.about-photo figcaption {
  margin-top: 7px;
  color: #6c5336;
  font-size: .78rem;
  font-style: italic;
  text-align: center;
}

:focus-visible { outline: 3px solid #e6aa00; outline-offset: 3px; }

@media (max-width: 820px) {
  .grid, .row.two { grid-template-columns: 1fr; }
  .about-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "photo"
      "copy";
    gap: 18px;
  }
  .about-layout > h1 { margin-bottom: -4px; }
  .about-photo {
    width: min(100%, 560px);
    margin: 4px auto 0;
    transform: none;
  }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    margin: 0;
    border-bottom: 1px solid #2f333a;
    background: #111318;
    padding: 10px 20px 16px;
  }
  .public-site .nav {
    border-bottom-color: #755534;
    background: #302015;
  }
  .nav.is-open { display: grid; }
  .nav a { width: 100%; padding: 11px 12px; }
  .nav .admin-link { margin: 4px 0 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; padding-top: 24px; padding-bottom: 24px; }
}

@media (max-width: 520px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .header-shell { min-height: 62px; }
  .page-content { padding-top: 16px; }
  .card { border-radius: 12px; padding: 16px; }
  .stats { grid-template-columns: 1fr; }
  .actions .btn, .actions .inline-form { width: 100%; }
  .actions .inline-form .btn { width: 100%; }
  .rich-editor__toolbar { align-items: stretch; }
  .rich-editor__select-label,
  .rich-editor__select { width: 100%; }
  .rich-editor__group { border-left: 0; padding-left: 0; }
  .rich-editor__surface { min-height: 300px; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
