/* ============================================================================
   KIDZ.ME — Gemeinsame Bauteile aller Seiten (seit 2026-10-12)

   Nach dem Seiten-CSS und vor motive.css eingebunden. Enthält, was jede Seite
   gleich haben soll:
     1. Logo in Kopfbalken und Hero
     2. Töne: die vier Logofarben je Abschnitt (.ton-rose … .ton-flieder)
     3. Zwei Spalten: Text neben Bild, Zeichnung, Zitat oder Kasten (.zwei)
     4. Bildplätze: Platzhalter, bis echte Bilder da sind (.bildplatz)
     5. Führung zum Generator: Knopf im Kopf, Hinweis im Text, nächster Schritt
     6. Bewegung: Einblenden, Linien, die sich zeichnen, der Bauklotzturm —
        alles leise und bei „weniger Bewegung“ abgeschaltet
   Alle Ecken klein (fast rechte Winkel), alle Farben aus tokens.css.
   ============================================================================ */

/* ---------- 1. Logo ---------- */
.logo-bild { display: block; height: 34px; width: auto; }
.brand-logo { display: block; width: clamp(230px, 24vw, 360px); height: auto; }
@media (max-width: 560px) { .logo-bild { height: 28px; } }

/* ---------- 2. Töne ---------- */
.ton-rose    { --ton: var(--rose-tief);    --ton-mitte: var(--rose);    --ton-hauch: var(--rose-hauch); }
.ton-himmel  { --ton: var(--himmel-tief);  --ton-mitte: var(--himmel);  --ton-hauch: var(--himmel-hauch); }
.ton-salbei  { --ton: var(--salbei-tief);  --ton-mitte: var(--salbei);  --ton-hauch: var(--salbei-hauch); }
.ton-flieder { --ton: var(--flieder-tief); --ton-mitte: var(--flieder); --ton-hauch: var(--flieder-hauch); }

/* ---------- 3. Zwei Spalten ---------- */
.zwei {
  width: min(1080px, calc(100% - 2.6rem)); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.zwei + .zwei { margin-top: clamp(3rem, 7vw, 5.5rem); }
.zwei.umgekehrt { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.zwei.umgekehrt > .seitlich { order: -1; }
.zwei > .textseite { min-width: 0; max-width: 62ch; }
.zwei > .seitlich { min-width: 0; }
.zwei > .seitlich .bildplatz { max-width: 400px; margin-inline: auto; }
.zwei.umgekehrt > .seitlich .bildplatz { margin-inline: 0 auto; }
.zwei:not(.umgekehrt) > .seitlich .bildplatz { margin-inline: auto 0; }
.zwei.oben { align-items: start; }

/* Eine Überschrift mit kleiner Farbmarke davor, im Ton des Abschnitts */
.marke-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ton, var(--pink-deep)); margin-bottom: .7rem;
}
.marke-kicker::before { content: ""; width: 18px; height: 3px; background: currentColor; border-radius: var(--radius-xs); }

/* Zitat in der Seitenspalte */
.zitat {
  font-family: var(--display); font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.3; color: var(--ton, var(--ink)); text-wrap: balance;
  padding: 1.2rem 0 1.4rem; border-top: 2px solid var(--ton-mitte, var(--line));
}
.zitat svg { display: block; width: 120px; height: 18px; margin-top: .9rem; color: var(--ton-mitte, var(--pink)); }

/* Kasten in der Seitenspalte */
.seitlich .kasten {
  background: var(--ton-hauch, var(--sand-deep));
  border: 0; border-left: 3px solid var(--ton, var(--pink-deep));
  border-radius: var(--radius-sm); padding: 1.2rem 1.35rem;
}
.seitlich .kasten h3 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin-bottom: .5rem; }
.seitlich .kasten p { margin: 0 0 .6rem; }
.seitlich .kasten p:last-child { margin-bottom: 0; }

/* Liste als kleine Tafeln über die volle Breite */
.tafeln { list-style: none; padding: 0; margin: 1.2rem auto 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.tafeln li {
  margin: 0; background: var(--paper-card); border: 1px solid var(--line);
  border-top: 3px solid var(--ton-mitte, var(--line-strong));
  border-radius: var(--radius-sm); padding: .9rem 1rem 1rem; font-size: .96rem; line-height: 1.55;
}

/* ---------- 4. Bildplätze ----------
   Platzhalter für Bilder, die noch kommen: eine Fläche im Ton des Abschnitts
   mit einer Linienzeichnung darin. Wird später durch ein echtes Bild ersetzt
   (gleiches Seitenverhältnis 5:4). */
.bildplatz {
  position: relative; aspect-ratio: 5 / 4; max-width: 100%;
  background: var(--ton-hauch, var(--sand-deep));
  border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center;
}
.bildplatz::after {   /* feiner Rahmen, leicht eingerückt, wie ein Passepartout */
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--ton-mitte, var(--line-strong));
  border-radius: var(--radius-xs); opacity: .55; pointer-events: none;
}
.bildplatz svg.zeichnung { width: 64%; height: auto; color: var(--ton, var(--ink)); }
.zeichnung { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 5. Führung ---------- */
/* Knopf im Kopfbalken, links vom Menü: leise, aber immer da */
.top-cta {
  margin-left: auto; margin-right: .2rem;
  font-size: .9rem; font-weight: 600; color: var(--cta);
  border: 1.5px solid var(--cta); border-radius: var(--radius-sm);
  padding: .45rem .85rem; white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.top-cta:hover { background: var(--cta); color: #fff; }
.top-cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.top .top-cta + .logo { margin-left: 1rem; }
@media (max-width: 640px) { .top-cta { display: none; } }

/* Kleiner Hinweis mitten im Text */
.anstoss {
  width: min(1080px, calc(100% - 2.6rem)); margin: clamp(2.5rem, 6vw, 4rem) auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
  padding: 1rem 1.25rem; background: var(--flieder-hauch);
  border-left: 3px solid var(--cta); border-radius: var(--radius-sm);
}
.anstoss p { margin: 0; flex: 1 1 320px; color: var(--ink); }
.anstoss a { font-weight: 600; color: var(--cta); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.anstoss a:hover { color: var(--cta-hover); }
.anstoss.forschung { border-left-color: var(--salbei-tief); background: var(--salbei-hauch); }
.anstoss.forschung a { color: var(--salbei-tief); }

/* Knöpfe */
.knopf-haupt, .knopf-neben {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: 1rem; border-radius: var(--radius-sm);
  padding: .8rem 1.35rem; transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.knopf-haupt { background: var(--cta); color: #fff; border: 1.5px solid var(--cta); }
.knopf-haupt:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.knopf-neben { color: var(--blue); border: 1.5px solid var(--blue-pastel); background: var(--paper-card); }
.knopf-neben:hover { border-color: var(--blue); }
.knopf-haupt:focus-visible, .knopf-neben:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Nächster Schritt am Seitenende */
.weiter-schritt {
  width: min(1080px, calc(100% - 2.6rem)); margin: clamp(3rem, 7vw, 5rem) auto 0;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center; padding: clamp(1.6rem, 4vw, 2.6rem);
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius);
}
.weiter-schritt h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.8vw, 1.9rem); line-height: 1.2; margin: 0 0 .6rem; text-wrap: balance; }
.weiter-schritt p { margin: 0 0 1.2rem; color: var(--ink-soft); }
.weiter-schritt .knoepfe { display: flex; flex-wrap: wrap; gap: .7rem; }
.weiter-schritt .klein { margin-top: .9rem; font-size: .85rem; color: var(--ink-faint); }
/* USER 16-10 „do not stretch“: Bilder mit width/height-Angabe behalten ihr Seitenverhältnis, wenn eine Regel nur die Breite
   setzt (sonst bleibt die Höhe aus dem Attribut stehen und die Figur wird in die Länge gezogen). */
img[width][height]:not([src*=".svg"]) { height: auto; }   /* SVG (Logo) ausgenommen: ohne eigene Größe fiele es mit height:auto
   auf 0 × 0 zusammen — so war das Logo am 16-10 einige Stunden unsichtbar */
/* Die zwei Maskottchen (USER 15-10) führen zum nächsten Schritt — freigestellt, im Stil der Seite */
.maskottchen { display: flex; justify-content: center; align-items: flex-end; }
.maskottchen img { width: auto; max-width: 100%; height: auto; display: block; }   /* Größe aus srcset „2x“: die Datei ist größer als die Anzeige */
.maskottchen.gespiegelt img { transform: scaleX(-1); }
.zwei > .seitlich .maskottchen { min-height: 100%; padding-block: 1rem; }
/* Kopf mit einer Figur rechts daneben (Gutscheine, fertige Geschichten) */
.kopf-mit-figur { display: flow-root; }
.kopf-mit-figur > .maskottchen { float: right; margin: 0 0 .6rem 1.4rem; }
.kopf-mit-figur > .maskottchen img { max-height: 220px; width: auto; }
.einloesen-mit-figur { display: flow-root; }
.einloesen-mit-figur > .maskottchen { float: left; margin: 0 1.4rem .4rem 0; }
.einloesen-mit-figur > .maskottchen img { max-height: 200px; width: auto; }
@media (max-width: 640px) { .kopf-mit-figur > .maskottchen img { max-height: 140px; } .einloesen-mit-figur > .maskottchen { display: none; } }

@media (max-width: 820px) {
  .zwei, .zwei.umgekehrt, .weiter-schritt { grid-template-columns: 1fr; }
  .zwei.umgekehrt > .seitlich { order: 0; }
  .zwei > .seitlich .bildplatz { max-width: 420px; }
  .weiter-schritt .bildplatz { max-width: 320px; }
  .weiter-schritt .maskottchen img { max-height: 240px; width: auto; }
}

/* ---------- 6. Bewegung ----------
   Nur, wenn gemeinsam.js läuft (Klasse .bewegt am html) und niemand „weniger
   Bewegung“ eingestellt hat. Alles, was beim Laden schon im Bild ist, bleibt
   sofort sichtbar; eingeblendet wird nur, was beim Scrollen dazukommt. */
@media (prefers-reduced-motion: no-preference) {
  .bewegt .einblenden { opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.3,1); }
  .bewegt .einblenden.sichtbar { opacity: 1; transform: none; }

  /* Linien, die sich selbst zeichnen (Länge setzt gemeinsam.js) */
  .bewegt .bildplatz .zeichnet path, .bewegt .bildplatz .zeichnet circle, .bewegt .bildplatz .zeichnet ellipse, .bewegt .bildplatz .zeichnet line, .bewegt .bildplatz .zeichnet rect, .bewegt .bildplatz .zeichnet polyline {
    stroke-dasharray: var(--laenge, 1000); stroke-dashoffset: var(--laenge, 1000);
    transition: stroke-dashoffset 2.2s cubic-bezier(.45,.05,.3,1); transition-delay: var(--verzug, 0ms);
  }
  .bewegt .bildplatz .zeichnet.sichtbar path, .bewegt .bildplatz .zeichnet.sichtbar circle, .bewegt .bildplatz .zeichnet.sichtbar ellipse,
  .bewegt .bildplatz .zeichnet.sichtbar line, .bewegt .bildplatz .zeichnet.sichtbar rect, .bewegt .bildplatz .zeichnet.sichtbar polyline { stroke-dashoffset: 0; }

  /* Der Bauklotzturm: Klötze fallen nacheinander und federn leicht nach */
  .bewegt .turm .klotz { opacity: 0; transform: translateY(-46px); }
  .bewegt .turm.sichtbar .klotz { animation: klotzFaellt .75s cubic-bezier(.3,.6,.35,1.25) forwards; animation-delay: calc(var(--n) * 420ms + 150ms); }
  .bewegt .turm .stern-funkeln { opacity: 0; }
  .bewegt .turm.sichtbar .stern-funkeln { animation: funkeln 1.4s ease forwards; animation-delay: 2.1s; }
}
@keyframes klotzFaellt { 0% { opacity: 0; transform: translateY(-46px); } 60% { opacity: 1; transform: translateY(3px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes funkeln { 0% { opacity: 0; transform: scale(.4) rotate(-20deg); } 60% { opacity: 1; transform: scale(1.15) rotate(6deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.turm .klotz, .turm .stern-funkeln { transform-box: fill-box; transform-origin: center; }

/* ---------- Bildkacheln: Links mit kleiner Zeichnung ----------
   Für Altersstufen, Anlässe, Ratgeber: die Zeichnung zeichnet sich beim
   Darüberfahren einmal nach. */
.bildkacheln { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.bildkacheln.drei { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.bildkacheln.eng { grid-template-columns: 1fr; margin: 0; }
.bildkacheln a {
  height: 100%; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr; column-gap: 1rem; align-items: start;
  background: var(--paper-card); border: 1px solid var(--line); border-top: 3px solid var(--ton-mitte, var(--line-strong));
  border-radius: var(--radius-sm); padding: 1rem 1.1rem;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.bildkacheln a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--ton-mitte, var(--line-strong)); }
.bildkacheln a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.bildkacheln svg.zeichnung { grid-row: 1 / 3; width: 64px; height: 64px; color: var(--ton, var(--ink)); stroke-width: 9; }
.bildkacheln svg.zeichnung.klein { stroke-width: 12 !important; }
.bildkacheln strong { font-family: var(--display); font-weight: 400; font-size: 1.08rem; line-height: 1.25; color: var(--ink); }
.bildkacheln span { font-size: .9rem; line-height: 1.45; color: var(--ink-soft); margin-top: .25rem; }
.bildkacheln:not(.eng):not(.drei) a { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
.bildkacheln:not(.eng):not(.drei) svg.zeichnung { grid-row: auto; margin-bottom: .6rem; width: 56px; height: 56px; }

/* Wasserzeichen leiser, wo Abschnitte schon eigene Zeichnungen haben */
body:has(.bildplatz) .motiv.farbig { opacity: .17; }
body:has(.bildplatz) .motiv.klein.farbig { opacity: .09; }

/* Auf dem Telefon: Bildplätze kleiner, damit der Text nicht nach unten rutscht */
@media (max-width: 820px) {
  .kopf .bildplatz { max-width: 200px; aspect-ratio: 5 / 4; margin: .4rem 0 0; }
  .zwei > .seitlich .bildplatz, .zwei.umgekehrt > .seitlich .bildplatz, .zwei:not(.umgekehrt) > .seitlich .bildplatz { max-width: 260px; margin: 0; aspect-ratio: 5 / 4; }
  .weiter-schritt .bildplatz { max-width: 200px; }
}

/* ---------- Kasse (kasse.js) ---------- */
.kasse-hinweis {
  width: min(1080px, calc(100% - 2.6rem)); margin: 1rem auto 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .8rem 1.1rem; background: var(--himmel-hauch); border-left: 3px solid var(--himmel-tief); border-radius: var(--radius-sm);
}
.kasse-hinweis p { margin: 0; flex: 1 1 280px; }
.kasse-hinweis button { font: inherit; font-size: .88rem; color: var(--blue); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.kasse-fehler { margin: .5rem 0 0; font-size: .88rem; color: var(--rose-tief); }
.knopf-kasse {
  font: inherit; font-weight: 600; font-size: .95rem; color: #fff; background: var(--cta);
  border: 0; border-radius: var(--radius-sm); padding: .6rem 1.1rem; cursor: pointer; display: inline-block; text-decoration: none;
  transition: background-color .16s ease;
}
.knopf-kasse:hover { background: var(--cta-hover); }
.knopf-kasse:disabled { opacity: .7; cursor: wait; }
.knopf-kasse:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.testmodus { font-size: .82rem; color: var(--ink-faint); }

/* ---------- Upsell: zusätzliche Exemplare (kasse.js) ---------- */
.upsell { width: min(640px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: var(--radius); background: var(--paper-card); color: var(--ink); box-shadow: var(--shadow-md); }
.upsell::backdrop { background: rgba(43, 58, 68, .45); }
.upsell-innen { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 1.4rem; padding: 1.8rem 1.8rem 1.6rem; }
.upsell-bild { width: 120px; height: 120px; padding: 18px; background: var(--rose-hauch); border-radius: var(--radius); fill: none; stroke: var(--rose-tief); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.upsell-text > p.upsell-kicker, .upsell-kicker { display: inline-flex; align-items: center; gap: .55rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rose-tief); margin: 0 0 .5rem; }
.upsell-kicker::before { content: ""; width: 18px; height: 3px; background: currentColor; border-radius: var(--radius-xs); }
.upsell h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.2; margin: 0 0 .6rem; text-wrap: balance; }
.upsell-text > p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .96rem; }
.upsell-zaehler { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.upsell-zaehler button { width: 38px; height: 38px; font-size: 1.25rem; line-height: 1; color: var(--ink); background: var(--paper-card); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.upsell-zaehler button:hover:not(:disabled) { border-color: var(--flieder-tief); }
.upsell-zaehler button:disabled { opacity: .4; cursor: default; }
.upsell-zaehler output { min-width: 1.6rem; text-align: center; font-family: var(--display); font-size: 1.3rem; }
.upsell-zaehler span { font-size: .9rem; color: var(--ink-soft); }
.upsell-knoepfe { display: grid; gap: .6rem; }
.upsell-knoepfe button { width: 100%; justify-content: center; font: inherit; font-weight: 600; cursor: pointer; }
.upsell-knoepfe button:disabled { opacity: .7; cursor: wait; }
.upsell-fehler { margin: .6rem 0 0; font-size: .88rem; color: var(--rose-tief); }
.upsell-fehler:empty { display: none; }
.upsell-zu { position: absolute; top: .6rem; right: .7rem; width: 36px; height: 36px; font-size: 1.4rem; line-height: 1; color: var(--ink-soft); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.upsell-zu:hover { color: var(--ink); background: var(--sand-deep); }
.preise-hinweis { font-size: .88rem; color: var(--ink-soft); }
@media (max-width: 560px) {
  .upsell-innen { grid-template-columns: 1fr; padding: 1.5rem 1.2rem 1.3rem; }
  .upsell-bild { width: 80px; height: 80px; padding: 12px; }
}

/* Willkommens-Banner zum Betatest (gemeinsam.js, USER 23-10). USER 28-10: seit dem Cookie-Banner (unten) als Leiste ganz OBEN auf der
   Seite, im Fluss (scrollt weg, der sticky Kopf bleibt), sofort sichtbar — nicht mehr nach der Cookie-Wahl. */
.willkommen { position: relative; z-index: 25; display: flex; align-items: center; justify-content: center; gap: .6rem 1.2rem;
  padding: .55rem 3rem .55rem 1.2rem; background: var(--flieder-hauch, #f1effa); border-bottom: 1px solid var(--line); }
.willkommen p { margin: 0; max-width: 860px; font-size: .92rem; line-height: 1.4; }
.willkommen-knopf { flex: none; white-space: nowrap; padding-block: .35rem; }
.willkommen-zu { position: absolute; top: 50%; right: .5rem; transform: translateY(-50%); width: 2rem; height: 2rem; border: 0; background: none;
  font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink-faint, #777); border-radius: 50%; }
.willkommen-zu:hover, .willkommen-zu:focus-visible { background: var(--paper-card, #fff); color: var(--ink, #222); }
@media (max-width: 640px) {
  .willkommen { flex-direction: column; align-items: flex-start; padding: .6rem 2.8rem .7rem 1rem; }
  .willkommen p { font-size: .86rem; }
  .willkommen-zu { top: .3rem; transform: none; }
}

/* Cookie-Einwilligung (USER 28-10): unten mittig (der Willkommens-Hinweis steht oben); beide Wahl-Knöpfe gleich stark. */
.einwilligung { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 70; width: min(760px, calc(100% - 32px));
  padding: 1rem 1.2rem 1.1rem; border-radius: 14px; background: var(--paper-card, #fff); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(40, 30, 60, .22); }
.einwilligung p { margin: 0 0 .8rem; font-size: .92rem; line-height: 1.45; }
.einwilligung-auswahl { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0 0 .9rem; font-size: .92rem; }
.einwilligung-auswahl[hidden] { display: none; }
.einwilligung-haken { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.einwilligung-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.einwilligung-knoepfe .knopf-haupt { flex: 1 1 12rem; justify-content: center; cursor: pointer; font-family: inherit; }
.einwilligung-link { border: 0; background: none; padding: .4rem .2rem; font: inherit; color: var(--cta, #7560AF);
  text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  .einwilligung { bottom: .7rem; padding: .9rem 1rem 1rem; max-height: calc(100vh - 1.4rem); overflow: auto; }
  .einwilligung p { font-size: .88rem; }
}
