/* ==========================================================================
   Schreibwettbewerb Augsburg – Stylesheet
   Ein Designsystem für alle Jahrgänge. Farben 2026/27: Blattgrün und
   Umschlag-Gelb aus dem Lesebuch „Natürlich!“ auf hellem Grau.

   Jahreswechsel: siehe README.md (Farben unten in :root, Texte im HTML).
   ========================================================================== */

/* ---------- Schrift (lokal, keine externen Requests) ---------- */
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light; /* bewusst immer hell, unabhängig von der Systemeinstellung */

  /* Marke: Farben aus dem Umschlag des Lesebuchs „Natürlich!“ (2026).
     Für einen neuen Jahrgang hier die Akzentfarben tauschen. */
  --brand: oklch(0.50 0.13 140);          /* Blattgrün, abgedunkelt für Kontrast */
  --brand-strong: oklch(0.42 0.11 140);
  --dark: oklch(0.34 0.005 110);          /* Dunkelgrau für Akzentflächen */
  --on-dark: oklch(0.97 0.003 110);
  --on-dark-2: oklch(0.83 0.005 110);
  --leaf: oklch(0.70 0.158 140);          /* Blattgrün wie im Foto, nur als Fläche */
  --on-brand: oklch(0.99 0 0);
  --marker: oklch(0.863 0.157 99);        /* Umschlag-Gelb */
  --on-marker: oklch(0.22 0.01 140);

  /* Neutrale Flächen: helles Grau wie der Hintergrund im Buchfoto */
  --bg: oklch(0.955 0.002 110);
  --surface: oklch(0.925 0.003 110);
  --surface-2: oklch(0.88 0.004 110);
  --field: oklch(0.995 0 0);              /* Eingabefelder und Karten: Weiß */
  --ink: oklch(0.22 0.01 140);
  --ink-2: oklch(0.40 0.008 140);
  --line: oklch(0.85 0.004 110);
  --line-strong: oklch(0.66 0.006 110);
  --error: oklch(0.52 0.19 25);
  --success: oklch(0.48 0.13 150);

  /* Buchrücken im Regal */
  --spine-1: var(--brand);
  --spine-2: var(--brand-strong);
  --spine-3: var(--marker);
  --spine-4: oklch(0.84 0.09 128);     /* helles Lindgrün */
  --spine-5: var(--surface-2);
  --spine-6: var(--leaf);

  /* Formen: Buttons und Pills rund, alles andere 12px */
  --r-pill: 999px;
  --r: 12px;
  --r-s: 8px;

  /* Bewegung */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-fast: 160ms;
  --t-base: 240ms;

  /* Layout */
  --gutter: 16px;
  --measure: 66ch;
  --nav-h: 84px;

  /* Ebenen */
  --z-sticky: 10;
  --z-menu: 20;
  --z-toast: 30;

  --shadow-tint: oklch(0.3 0.02 140 / 0.14);
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 48px; }
}


/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: "Bricolage", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 1.0625rem;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
  font-variation-settings: "opsz" 96;
}
h1 { font-size: clamp(2.5rem, 1.9rem + 3vw, 4.25rem); font-weight: 750; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3.25rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); letter-spacing: -0.015em; }
h4 { font-size: 1.125rem; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }

a { color: var(--brand); text-underline-offset: 0.15em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--brand-strong); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--marker); color: var(--on-marker); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: var(--r-s);
  z-index: var(--z-menu);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin-inline: auto;
}

.measure { max-width: var(--measure); }
.muted { color: var(--ink-2); }
.small { font-size: 0.9375rem; }

/* Textmarker-Hervorhebung */
.mark {
  background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%);
  color: var(--on-marker);
  padding-inline: 0.08em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn:hover { --btn-bg: var(--brand-strong); color: var(--btn-fg); }
.btn:active { transform: scale(0.97); }
.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line-strong);
}
.btn--secondary:hover { --btn-bg: var(--surface); border-color: var(--ink); }
.btn--marker { --btn-bg: var(--marker); --btn-fg: var(--on-marker); }
.btn--marker:hover { --btn-bg: oklch(from var(--marker) calc(l - 0.06) c h); }
.btn--sm { min-height: 40px; padding: 0.45rem 1rem; font-size: 0.9375rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn .arrow { transition: transform var(--t-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .arrow { transform: translateX(3px); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: var(--nav-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; line-height: 1.05;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.06em;
  flex: none;
}
.brand__text span { display: block; font-weight: 500; font-size: 0.78rem; color: var(--ink-2); letter-spacing: 0; }

.nav { display: flex; align-items: center; gap: 0.25rem 1.5rem; }
.nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 500; padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover, .nav a[aria-current="page"] { border-bottom-color: var(--brand); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-s);
  background: transparent; border: 1.5px solid var(--line-strong); color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .ico-close { display: none; }
.nav-toggle[aria-expanded="true"] .ico-burger { display: none; }
.nav-toggle[aria-expanded="true"] .ico-close { display: block; }

@media (max-width: 979px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    padding: 0.75rem var(--gutter) 1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-6px); visibility: hidden;
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility 0s var(--t-base);
  }
  .nav[data-open="true"] { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav a:not(.btn) { padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--line); }
  .nav .btn { margin-top: 0.75rem; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 4vw, 4.5rem) clamp(2rem, 4vw, 4rem);
}
.hero .wrap {
  display: grid; gap: 2.5rem;
  align-items: center;
}
.hero .wrap > * { min-width: 0; }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.5rem; }
}
.hero__intro { margin-top: 1.25rem; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); max-width: 34ch; color: var(--ink-2); }
.hero__intro strong { color: var(--ink); font-weight: 650; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Logo Stadt Augsburg (Graustufen) oben rechts über dem Regal */
.hero__city { display: flex; justify-content: flex-end; margin-bottom: clamp(0.75rem, 2vw, 1.5rem); }
.hero__city img { height: clamp(48px, 4.8vw, 72px); width: auto; max-width: 100%; display: block; }

/* Bücherregal: alle Bücher füllen die Breite, auf jedem Gerät ohne Scrollen */
.shelf {
  --shelf-h: clamp(220px, 32vw, 380px);
  position: relative;
  display: flex; align-items: flex-end; gap: 3px;
  height: calc(var(--shelf-h) + 18px);
  padding: 0 6px 18px;
  border-bottom: 10px solid var(--brand-strong);
  border-radius: 0 0 3px 3px;
}
@media (min-width: 600px) { .shelf { gap: 4px; padding-inline: 12px; } }
.shelf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 12px;
  background: linear-gradient(var(--shadow-tint), transparent);
  pointer-events: none;
}
/* Buch nach Vorlage assets/bilder/Buch.svg: Kopf und Fuß als SVG-Symbol
   (#buch-oben, #buch-unten in index.html), dazwischen ein dehnbarer Rücken.
   Farben: nur Gelbtöne, je Buch über --b-main / --b-dark / --b-label (book--1 … book--6). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.book {
  /* Nur Gelbtöne, abgeleitet aus der Vorlage (#fec703 / #d4a907 / #fff4c4) */
  --b-main: #fec703;
  --b-dark: #d4a907;
  --b-label: #fff4c4;
  --b-page: #eee0d7;
  --b-ink: var(--ink);
  --year-space: 2.9rem;
  position: relative;
  flex: 1 1 0; min-width: 0;
  height: calc(var(--shelf-h) - var(--year-space));  /* alle Bücher gleich hoch */
  display: flex; flex-direction: column;
  color: var(--b-ink);
  text-decoration: none;
  transition: transform var(--t-base) var(--ease-out);
  transform-origin: bottom center;
}
.book__cap { display: block; width: 100%; flex: none; }
.book__cap--top { aspect-ratio: 55.6 / 42.94; margin-bottom: -0.5px; }
.book__cap--bottom { aspect-ratio: 55.6 / 30.19; margin-top: -0.5px; }
.book__body {
  position: relative; flex: 1 1 auto; min-height: 0;
  background: linear-gradient(90deg,
    var(--b-dark) 0 1.8%, var(--b-main) 1.8% 19.41%, var(--b-label) 19.41% 80.59%,
    var(--b-main) 80.59% 98.2%, var(--b-dark) 98.2%);
}
/* Titel mittig im hellen Feld */
.book__label {
  position: absolute; top: 6px; bottom: 6px; left: 19.41%; width: 61.18%;
  display: flex; align-items: center; justify-content: center;
  container-type: inline-size;
}
.book__label b {
  writing-mode: vertical-rl;
  max-height: 100%;
  /* nur in Leserichtung kürzen, Unterlängen nicht abschneiden */
  overflow-x: visible; overflow-y: clip; text-overflow: ellipsis; white-space: nowrap;
  font-size: min(78cqi, 13px);
  font-weight: 750; line-height: 1; letter-spacing: 0.01em;
}
/* Zu schmal für lesbare Schrift (kleine Handys): nur die Buchform zeigen */
@container (max-width: 9px) { .book__label b { display: none; } }
/* Jahreszahl über dem Buch */
.book__year {
  position: absolute; bottom: calc(100% + 5px); left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-size: clamp(9px, 0.45rem + 0.25vw, 11px);
  font-weight: 600; line-height: 1; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.book--2 { --b-main: #ffd53f; --b-dark: #d9b01a; --b-label: #fff8da; }   /* hell */
.book--3 { --b-main: #fec703; --b-dark: #d4a907; --b-label: #fff4c4; }   /* Original */
.book--4 { --b-main: #f4b800; --b-dark: #c49300; --b-label: #fff0bd; }   /* goldgelb */
.book--5 { --b-main: #ffe070; --b-dark: #dcb935; --b-label: #fffbe8; }   /* blass */
.book--6 { --b-main: #f9be1b; --b-dark: #cc9a06; --b-label: #fff2c9; }   /* warm */
.book--next {
  --b-main: #fff8da;
  --b-dark: #e3c65a;
  --b-label: #fffdf2;
  --b-page: #fffdf2;
  --b-ink: #6b5300;
  flex-grow: 1.35;
  outline: 2px dashed #d4a907; outline-offset: 3px; border-radius: 4px;
}
.book--next .book__year { color: #6b5300; font-weight: 750; bottom: calc(100% + 10px); }
@media (hover: hover) and (pointer: fine) {
  .book:hover { transform: translateY(-10px); }
}
.shelf-caption { margin-top: 1.75rem; color: var(--ink-2); font-size: 0.9375rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Sektionen ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--surface { background: var(--surface); }
.section--brand { background: var(--dark); color: var(--on-dark); }
.section--brand .section__head p { color: var(--on-dark-2); }
.section--brand .btn { --btn-bg: var(--marker); --btn-fg: var(--on-marker); }
.section--brand .btn:hover { --btn-bg: oklch(0.80 0.15 99); }
.section__head { max-width: 40ch; margin-bottom: clamp(1.75rem, 3vw, 2.75rem); }
.section__head p { margin-top: 0.9rem; font-size: 1.1rem; color: var(--ink-2); }

/* Thema */
.theme { display: grid; gap: 2.5rem; }
@media (min-width: 900px) {
  .theme { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }
  .theme__lead { position: sticky; top: calc(var(--nav-h) + 24px); }
}
.theme__word {
  font-size: clamp(3.5rem, 2rem + 8vw, 7rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 0.95;
  font-variation-settings: "opsz" 96;
  margin: 0.25rem 0 1rem;
}
.theme__word .mark { padding-inline: 0.12em; }
.formats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; padding: 0; list-style: none; }
.formats li {
  padding: 0.35rem 0.85rem; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); font-weight: 500; font-size: 0.9375rem;
}
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; counter-reset: q; }
@media (min-width: 600px) { .questions { grid-template-columns: 1fr 1fr; } .questions li:first-child { grid-column: 1 / -1; } }
.questions li {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  border-radius: var(--r);
  background: var(--surface);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 1.5rem;
  min-height: 150px;
}
.questions li:first-child { background: var(--dark); color: var(--on-dark); }
.questions li:nth-child(3) { background: var(--marker); color: var(--on-marker); }
.questions li::before {
  content: "?";
  font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  opacity: 0.35;
}

/* Eckdaten */
.facts {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .facts { grid-template-columns: repeat(4, 1fr); border-top: 0; } }
.facts > div { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 1000px) {
  .facts > div { padding: 0.5rem 1.5rem 0.5rem 0; border-bottom: 0; border-left: 1px solid var(--line); padding-left: 1.5rem; }
}
.facts dt { font-size: 0.9375rem; color: var(--ink-2); font-weight: 500; }
.facts dd { margin: 0.3rem 0 0; font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.facts dd small { display: block; font-size: 0.95rem; font-weight: 500; color: var(--ink-2); margin-top: 0.3rem; letter-spacing: 0; }

/* Ablauf (echte Reihenfolge, deshalb nummeriert) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; max-width: 760px; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 52px 1fr; gap: 1.25rem;
  padding-block: 1.5rem;
  position: relative;
}
.steps li::before {
  content: counter(step);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--dark); color: var(--on-dark);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em;
  position: relative; z-index: 1;
}
.steps li:first-child::before { background: var(--brand); color: var(--on-brand); }
.steps li::after {
  content: ""; position: absolute; left: 21.5px; top: 1.5rem; bottom: -1.5rem;
  width: 2px; background: var(--line);
}
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: 0.4rem; }
.steps p { color: var(--ink-2); max-width: 58ch; }

/* Hinweisbox */
.note {
  display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start;
  padding: 1.1rem 1.25rem; border-radius: var(--r);
  background: var(--dark); color: var(--on-dark);
  max-width: 760px;
}
.note svg { width: 22px; height: 22px; margin-top: 0.15rem; color: var(--marker); flex: none; }
.note strong { display: block; margin-bottom: 0.2rem; }

/* Vorjahresbuch */
.prev-book { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 800px) { .prev-book { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4rem; } }
.prev-book__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.section--brand .btn--secondary { --btn-bg: transparent; --btn-fg: var(--on-dark); border-color: var(--on-dark-2); }
.section--brand .btn--secondary:hover { --btn-bg: oklch(1 0 0 / 0.08); border-color: var(--on-dark); }
.book-photo {
  margin: 0; width: 100%; max-width: 520px; justify-self: center;
  border-radius: var(--r);
  overflow: hidden;
  background: #fff; /* das Foto hat einen weißen Hintergrund, auch im Dunkelmodus */
  box-shadow: 0 10px 30px oklch(0.4 0.05 140 / 0.18);
}
.book-photo img { width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .book-photo { transition: transform var(--t-base) var(--ease-out); }
  .book-photo:hover { transform: rotate(-1deg) translateY(-4px); }
}

/* ---------- Seitenkopf für Unterseiten ---------- */
.page-head { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.75rem); hyphens: auto; overflow-wrap: anywhere; }
.page-head p { margin-top: 1rem; font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }

/* ---------- Formulare ---------- */
.form { max-width: 720px; display: grid; gap: 1.5rem; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 1.25rem; }
.fieldset > legend { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.015em; padding: 0; margin-bottom: 0.75rem; }
.fieldset > legend + * { margin-top: 0; }
.row { display: grid; gap: 1.25rem; }
@media (min-width: 600px) { .row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; }
.field label, .field .label { font-weight: 600; font-size: 1rem; }
.req { color: var(--brand); font-weight: 700; margin-left: 0.15em; }
.hint { color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; }
.field .hint { order: 10; } /* Fehlertext steht direkt unter dem Feld, der Hinweis darunter */
.input, .select, .textarea {
  width: 100%;
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 0.75rem 0.9rem;
  min-height: 50px;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-2); opacity: 1; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 25%, transparent);
}
.select:disabled { color: var(--ink-2); background-color: var(--surface); cursor: not-allowed; }
.textarea { min-height: 320px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.field[data-invalid="true"] .input, .field[data-invalid="true"] .select, .field[data-invalid="true"] .textarea { border-color: var(--error); }
.error { display: none; color: var(--error); font-size: 0.9375rem; font-weight: 500; }
.field[data-invalid="true"] .error { display: block; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; }
.check input { width: 22px; height: 22px; margin: 0.15rem 0 0; accent-color: var(--brand); }
.check label { font-weight: 500; font-size: 1rem; line-height: 1.5; }
.check.field[data-invalid="true"] label { color: var(--error); }
.radios { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radios label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1rem; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); font-weight: 500; cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.radios label:has(input:checked) { border-color: var(--brand); background: var(--surface); }
.radios input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.counter { font-variant-numeric: tabular-nums; }
.form__actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 0.5rem; }
.form__status { display: none; }
.form__status[data-show="true"] { display: block; }
.form-success {
  padding: 2rem; border-radius: var(--r); background: var(--dark); color: var(--on-dark);
  max-width: 720px;
  animation: pop 320ms var(--ease-out) both;
}
.form-success h2 { font-size: 1.8rem; }
.form-success p { margin-top: 0.75rem; color: var(--on-dark-2); }
.form-success .btn--secondary { --btn-fg: var(--on-dark); border-color: var(--on-dark-2); }
.form-success .btn--secondary:hover { --btn-bg: oklch(1 0 0 / 0.08); border-color: var(--on-dark); }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } }
[hidden] { display: none !important; }

/* Kontakt-Layout */
.contact { display: grid; gap: 3rem; }
@media (min-width: 900px) { .contact { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 5rem; align-items: start; } }
.address { padding: 1.5rem; border-radius: var(--r); background: var(--surface); }
.address h3 { margin-bottom: 0.75rem; }
.address p + p { margin-top: 0.75rem; }
@media (min-width: 900px) { .address { position: sticky; top: calc(var(--nav-h) + 24px); } }

/* ---------- Prosa-Seiten (Impressum, Datenschutz) ---------- */
.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); margin-top: 2.75rem; margin-bottom: 0.9rem; }
.prose h3 { margin-top: 1.9rem; margin-bottom: 0.5rem; }
.prose p, .prose ul { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.3em; }
.prose address { font-style: normal; padding: 1rem 1.25rem; border-radius: var(--r); background: var(--surface); margin-bottom: 1em; }
.prose a { overflow-wrap: anywhere; word-break: break-all; }
.prose .table-scroll { overflow-x: auto; margin: 0 0 1em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95em; background: var(--field); border-radius: var(--r); overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface); font-weight: 650; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose code { font-size: 0.88em; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .prose thead { display: none; }
  .prose tr { display: block; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
  .prose tbody tr:last-child { border-bottom: 0; }
  .prose td { display: block; padding: 0; border: 0; }
  .prose td:first-child { font-weight: 650; margin-bottom: 0.25rem; }
  .prose td:last-child { margin-top: 0.35rem; color: var(--ink-2, inherit); }
  .prose td:last-child::before { content: "Speicherdauer: "; font-weight: 650; }
}

/* ---------- Logoband über dem Footer ---------- */
.sponsors { padding-block: clamp(0.5rem, 2vw, 1.5rem) 0; }
.sponsors__title {
  font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--ink-2);
  text-align: center; margin-bottom: 1rem;
  font-variation-settings: "opsz" 14;
}
.sponsors__band {
  list-style: none; margin: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: clamp(1rem, 3vw, 3rem) clamp(1.25rem, 5vw, 4.5rem);
  background: #fff; /* Logos liegen auf Weiß, auch im Dunkelmodus */
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 2rem);
}
/* Alle Logos gleich hoch skaliert: Größenverhältnisse bleiben wie im Original-Band */
.sponsors__band img { height: clamp(52px, 4.5vw + 24px, 76px); width: auto; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 5vw, 4rem) 2rem; margin-top: clamp(2rem, 5vw, 4rem); color: var(--ink-2); font-size: 0.9375rem; }
.site-footer .wrap { display: grid; gap: 2rem; }
@media (min-width: 800px) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; } }
.site-footer h4 { color: var(--ink); margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer .legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ---------- Bewegung ---------- */
/* Einstieg der Startseite: nur beim ersten Laden, gestaffelt, kurz */
@media (prefers-reduced-motion: no-preference) {
  .hero [data-enter] {
    animation: enter 560ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
  .shelf .book {
    animation: rise 640ms var(--ease-out) both;
    animation-delay: calc(180ms + var(--n, 0) * 22ms);
  }
  }
}
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) {
  .form-success { animation: none; }
  .book, .btn { transition: none; }
}

/* ---------- Druck ---------- */
@media print {
  .site-header, .site-footer, .hero__actions, .nav-toggle { display: none; }
  body { background: white; color: black; }
}

/* ---------- Login (nur Aufbauphase, kann zum Livegang bleiben oder raus) ---------- */
.gate { min-height: 100dvh; display: grid; }
.gate__main {
  display: grid; place-content: center; justify-items: center; gap: 1.5rem;
  padding: 2rem var(--gutter);
  background: var(--surface);
}
.gate__card {
  width: min(100%, 440px);
  display: grid; gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.gate__title { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.35rem); margin-top: 1rem; }
.gate__lead { color: var(--ink-2); }
.gate__form { gap: 1.1rem; margin-top: 0.5rem; }
.gate__form .btn { justify-content: center; width: 100%; margin-top: 0.25rem; }
.gate__msg { padding: 0.75rem 1rem; border-radius: var(--r-s); background: var(--dark); color: var(--on-dark); font-weight: 500; }
.gate__msg--error { background: color-mix(in oklab, var(--error) 12%, var(--bg)); color: var(--error); }
.gate__foot { color: var(--ink-2); font-size: 0.875rem; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .gate__card { animation: enter 480ms var(--ease-out) both; }
}

.sponsors + .site-footer { margin-top: clamp(2rem, 4vw, 3rem); }
.site-footer { padding-bottom: calc(2rem + 64px); } /* Platz fürs Cookie-Symbol unten links */
main > .section:last-child { padding-bottom: clamp(2.5rem, 4vw, 3.5rem); }

/* ---------- Formular: Serverfehler und Spamschutz ---------- */
.form-alert {
  padding: 0.9rem 1.1rem; border-radius: var(--r-s);
  background: color-mix(in oklab, var(--error) 10%, var(--field));
  color: var(--error); font-weight: 500;
}
/* Honeypot: für Menschen unsichtbar, Bots füllen es aus */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Verwaltung ---------- */
.admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-filter { display: grid; gap: 1rem; align-items: end; }
@media (min-width: 900px) { .admin-filter { grid-template-columns: 1fr 1fr 2fr auto; } }
.admin-filter__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th { text-align: left; font-weight: 600; color: var(--ink-2); background: var(--surface); padding: 0.7rem 0.9rem; white-space: nowrap; }
.admin-table td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table td:first-child, .admin-table td:nth-last-child(-n+2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table a { font-weight: 600; }
.admin-empty { padding: 2rem; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--field); }
.admin-detail h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); margin-top: 1rem; }
.admin-meta { display: grid; gap: 1rem; margin: 1.5rem 0; padding: 1.25rem; border-radius: var(--r); background: var(--field); border: 1px solid var(--line); }
@media (min-width: 800px) { .admin-meta { grid-template-columns: repeat(4, 1fr); } }
.admin-meta dt { font-size: 0.875rem; color: var(--ink-2); }
.admin-meta dd { margin: 0.2rem 0 0; font-weight: 600; }
.admin-meta .muted { font-weight: 400; }
.admin-text { max-width: 70ch; font-size: 1.1rem; line-height: 1.7; white-space: normal; }

/* ---------- Einsendeschluss-Hinweis (Hero, Mitmachen) ---------- */
.deadline {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  grid-template-areas: "icon label left" "icon date left";
  align-items: center;
  column-gap: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem 0.75rem 0.9rem;
  border-radius: var(--r);
  background: var(--field);
  border: 2px solid var(--brand);
  color: var(--ink);
  box-shadow: 0 4px 14px oklch(0.4 0.08 140 / 0.12);
}
.deadline__icon { grid-area: icon; width: 30px; height: 30px; color: var(--brand); }
.deadline__label { grid-area: label; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.deadline__date {
  grid-area: date;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); font-weight: 750; letter-spacing: -0.015em;
  color: var(--brand-strong); line-height: 1.15; white-space: nowrap;
}
.deadline__left {
  grid-area: left;
  padding: 0.35rem 0.8rem; border-radius: var(--r-pill);
  background: var(--marker); color: var(--on-marker);
  font-weight: 750; font-size: 1rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 400px) {
  .deadline { grid-template-columns: auto 1fr; grid-template-areas: "icon label" "icon date" "left left"; display: grid; }
  .deadline__left { justify-self: start; margin-top: 0.6rem; }
}
.deadline[data-state="vorbei"] { border-color: var(--line-strong); }
.deadline[data-state="vorbei"] .deadline__left { background: var(--surface-2); }
.page-head .deadline { margin-bottom: 1rem; }
.brand { flex-shrink: 0; }
.brand__logo { height: 60px; width: auto; display: block; }
/* Schmale Handys: etwas kleiner, damit Logo und Menü-Knopf nebeneinander passen */
@media (max-width: 479px) { .brand__logo { height: 52px; } }
@media (max-width: 359px) { .brand__logo { height: 42px; } }
.gate__card .brand__logo { height: 40px; }

/* ---------- Spamschutz (ALTCHA-Widget) ---------- */
.altcha-wrap { margin-block: 0.25rem 1.25rem; }
.altcha-wrap .hint { margin-top: 0.5rem; }
altcha-widget {
  display: block;
  --altcha-max-width: 100%;
  --altcha-border-radius: var(--r);
  --altcha-border-color: var(--line-strong);
  --altcha-color-base: var(--field);
  --altcha-color-base-content: var(--ink);
  --altcha-color-primary: var(--brand);
  --altcha-color-primary-content: var(--on-brand);
  --altcha-color-success: var(--success);
  --altcha-color-error: var(--error);
  --altcha-spinner-color: var(--brand);
  --altcha-checkbox-border-color: var(--line-strong);
  font-family: inherit;
}
