/* ============================================================================
   KIDZ.ME — Das fertige Buch, Seite für Seite
   Farben und Schriften kommen aus tokens.css.

   Seit 16-10 zeigt die Seite das echte Beispielbuch: zehn Doppelseiten als Bilder aus dem Druck-PDF
   (beispielbuch-bauen.py). Zwanzig Seiten, zehn Zeilen.

   Der Kopfbereich (.top/.back/.logo) steht als dieselbe Regelmenge in
   buch.css, recht.css, seite.css und so-funktionierts.css, dazu
   abgewandelt in generator.css — jede Seite bringt ihr eigenes Stylesheet mit.
   Änderungen am Kopf an allen fünf Stellen prüfen.
   ============================================================================ */

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.15; }
p { margin: 0; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--pink-deep); outline-offset: 3px; border-radius: var(--radius-sm); }

/* ---------- Kopf ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(250,249,253,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.back { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft); font-size: .94rem; }
.back svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--blue); }
.logo { display: inline-flex; align-items: center; gap: .5rem; }
.logo-mark { width: 24px; aspect-ratio: 1; fill: var(--pink); }
.logo-word { font-family: var(--display); font-size: 1.25rem; letter-spacing: -.02em; }
.logo-me { color: var(--pink-deep); font-style: italic; }

/* ---------- Rahmen ---------- */
.wrap { width: min(1040px, calc(100% - 2.5rem)); margin-inline: auto; }

.buch-kopf { padding: clamp(2rem, 5vh, 3.4rem) 0 clamp(1.4rem, 3vh, 2rem); text-align: center; }
.buch-kopf .kicker {
  font-size: .74rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--pink-deep); font-weight: 650;
}
.buch-kopf h1 { font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.7rem); margin-top: .7rem; }
.buch-kopf p { color: var(--ink-soft); margin-top: .8rem; }

/* ---------- Doppelseiten (USER 16-10: das Beispielbuch aus dem Druck-PDF, beispielbuch-bauen.py) ----------
   Jede Doppelseite ist ein Bild 2:1, so wie gedruckt. Auf dem Telefon wäre sie zum Lesen zu klein: dort ist sie doppelt
   so breit wie der Bildschirm und wird seitwärts gewischt, eine Buchseite je Bildschirm. */
.wrap-breit { width: min(1100px, calc(100% - 2.5rem)); margin-inline: auto; }
.buch-seiten { display: grid; gap: clamp(1.4rem, 4vh, 2.6rem); padding-bottom: 2.5rem; }
.ds { margin: 0; }
.ds img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 2px rgba(40,30,60,.08), 0 10px 30px rgba(40,30,60,.12); background: #fff; }
.ds figcaption { margin-top: .5rem; text-align: center; font-size: .8rem; color: var(--ink-faint); }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.buch-ende { text-align: center; padding: 0 0 3.5rem; }
.buch-ende .ende { font-family: var(--hand); font-size: 1.35rem; color: var(--pink-deep); }
.buch-ende .klein { font-size: .86rem; color: var(--ink-faint); margin: .6rem 0 1.4rem; }
.buch-ende .knopf-haupt { display: inline-flex; }

/* ---------- Fuß ---------- */
.fuss {
  border-top: 1px solid var(--line); padding: 1rem 1.6rem;
  text-align: center; font-size: .85rem; color: var(--ink-faint);
}
.fuss a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .wrap-breit { width: 100%; }
  .ds { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .ds img { width: 200%; max-width: none; border-radius: 0; box-shadow: none; }
  .ds-nr::after { content: " · zum Weiterlesen wischen →"; }
  .ds figcaption { position: sticky; left: 0; width: 100vw; }
}

/* ---------- Druck ---------- */
@media print {
  .top, .buch-kopf, .fuss, .buch-ende { display: none; }
  body { background: #fff; }
  .ds { break-inside: avoid; page-break-inside: avoid; }
  .ds img { box-shadow: none; }
}

/* Betatest: das fertige Buch + Feedback (betatest-buch.html, USER 23-10) */
.bb-anmelden { max-width: 420px; display: grid; gap: .8rem; }
.bb-feedback { padding: 2rem 0 4rem; max-width: 760px; }
.bb-abschnitt { font-family: var(--display); font-size: 1.2rem; margin: 1.8rem 0 .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.bb-frage { margin-bottom: 1.2rem; }
.bb-feedback .g-feld textarea { min-height: 5.5rem; }
.bb-feedback .knopf-haupt { margin-top: 1rem; }
.bb-pdf { display: inline-block; margin: .6rem 0 1rem; }
.bb-sterne { display: flex; gap: .15rem; }
.bb-stern { position: relative; cursor: pointer; font-size: 2rem; line-height: 1; color: #d8d3e6; padding: 0 .1rem; }
.bb-stern input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bb-stern.ist-an { color: #f2b33d; }
.bb-stern:focus-within { outline: 2px solid var(--cta); outline-offset: 2px; border-radius: 4px; }
.bb-sternname { display: block; margin: .1rem 0 .3rem; }
.bb-zusatz { display: block; width: 100%; margin-top: .5rem; font: inherit; padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.bb-teilen { margin-top: 2.2rem; }
.bb-teilen-knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; }
.bb-teilen-knopf { width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; cursor: pointer;
  color: #fff; background: #555; text-decoration: none; transition: transform .15s ease; }
.bb-teilen-knopf:hover, .bb-teilen-knopf:focus-visible { transform: scale(1.08); }
.bb-teilen-knopf svg { width: 22px; height: 22px; fill: currentColor; }
.bb-whatsapp { background: #25D366; } .bb-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.bb-tiktok { background: #000; } .bb-facebook { background: #0866FF; } .bb-pinterest { background: #BD081C; } .bb-x { background: #000; }
.bb-mail { background: #6b4fa8; } .bb-link { background: #2b3a44; }
.bb-teilen-hinweis { min-height: 1.2em; margin-top: .5rem; }
.bb-teilen-mehr { margin-top: .4rem; }
main img.bb-maskottchen { float: right; height: 140px; max-height: 140px; width: auto; margin: 0 0 .5rem 1rem; }
.bb-feedback, .bb-teilen { display: flow-root; }
@media (max-width: 640px) { main img.bb-maskottchen { height: 92px; max-height: 92px; } }

/* Betatest-Admin: Liste aller Bücher (betatest-admin.html) */
.ba-rahmen { overflow-x: auto; margin: 1rem 0; }
/* Nutzer: Bücher je Nutzer (USER 24-10) */
.ba-nutzer { margin-top: 2.2rem; }
.ba-erlaubt { display: flex; align-items: center; gap: .5rem; }
.ba-zahl { width: 4.2rem; padding: .3rem .4rem; font: inherit; border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.ba-speichern { padding: .25rem .7rem; font-size: .88rem; }
.ba-meldung { font-size: .85rem; color: var(--ink-soft); }
.ba-tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; }
.ba-tabelle th, .ba-tabelle td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ba-tabelle th { font-weight: 600; background: var(--flieder-hauch); }
.ba-in_customer_review, .ba-approved { color: var(--salbei-tief, #3f7a52); font-weight: 600; }
.bb-anmelden .g-linkknopf { display: inline-block; margin-top: .4rem; color: var(--cta); font-size: .92rem; }
