/* Levamio – Scroll-Show (Gerät + Kapitel). Gehört zu scroll-show.js; alle Regeln greifen erst, wenn das Skript
   die Klasse .sshow-on setzt – ohne JavaScript bleibt .scroll-show-fallback unverändert sichtbar.
   Farben ausschließlich über die Design-Tokens aus /assets/style.css (hell/dunkel, prefers-color-scheme + [data-theme]). */

.scroll-show.sshow-on > .scroll-show-fallback { display: none; }
.scroll-show.sshow-on { --sshow-top: 5.25rem; --sshow-accent: var(--app, var(--brand, #0e5a52)); }

/* ---------------------------------------------------------------- Spur und Bühne */
.scroll-show.sshow-on { width: 100%; }
.sshow-track { position: relative; width: 100%; container-type: inline-size; }
.sshow-scrub .sshow-track {
  height: calc(var(--sshow-n, 6) * 62vh + 100vh);
  height: calc(var(--sshow-n, 6) * 62svh + 100svh);
}
.sshow-stage {
  display: grid; gap: 1.25rem; justify-items: center; align-content: center;
  width: 100%;
}
.sshow-scrub .sshow-stage {
  position: sticky; top: var(--sshow-top);
  height: calc(100vh - var(--sshow-top) - 1rem);
  height: calc(100svh - var(--sshow-top) - 1rem);
}

/* ---------------------------------------------------------------- Gerät: Handy */
.sshow-device { position: relative; margin: 0; }
.sshow-phone {
  width: min(18rem, 64vw);
}
.sshow-scrub .sshow-phone {
  width: min(18rem, 64vw, calc((100vh - var(--sshow-top) - 12rem) * .445));
  width: min(18rem, 64vw, calc((100svh - var(--sshow-top) - 12rem) * .445));
}
.sshow-phone-frame {
  position: relative; border-radius: 15% / 7%; padding: 3.4%;
  background: linear-gradient(160deg, #2a3432, #0b100f 60%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 0 0 1.5px #0b100f, var(--shadow-l, 0 20px 48px -12px rgba(0, 0, 0, .35));
}
.sshow-phone-frame::after {
  content: ""; position: absolute; right: -1.2%; top: 22%; width: 1.2%; height: 9%;
  border-radius: 0 3px 3px 0; background: #1b2321;
}
.sshow-phone-screen { position: relative; overflow: hidden; border-radius: 12% / 5.6%; background: #fff; }
.sshow-status {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  aspect-ratio: 390 / 44; padding: 0 9% 0 11%; background: #fff; color: #13201e;
  font: 600 clamp(.56rem, 3.3cqi, .8rem)/1 var(--font, system-ui, sans-serif); letter-spacing: -.01em;
}
.sshow-island {
  position: absolute; left: 50%; top: 18%; width: 30%; height: 64%; transform: translateX(-50%);
  border-radius: 999px; background: #0b100f;
}
.sshow-icons { display: inline-flex; align-items: center; gap: .3em; }
.sshow-icons i { display: block; }
.sshow-sig, .sshow-wifi { background: currentColor; }
.sshow-sig { width: 1.05em; height: .7em; clip-path: polygon(0 100%, 100% 0, 100% 100%); border-radius: 1px; }
.sshow-wifi { width: .95em; height: .7em; clip-path: polygon(50% 100%, 0 25%, 15% 8%, 50% 0, 85% 8%, 100% 25%); }
.sshow-bat { width: 1.55em; height: .72em; border-radius: .2em; box-shadow: 0 0 0 1.5px currentColor; padding: 1.5px; background: linear-gradient(90deg, currentColor 78%, transparent 78%) content-box; }

/* ---------------------------------------------------------------- Gerät: Browserfenster */
.sshow-browser { width: 100%; }
.sshow-scrub .sshow-browser {
  max-width: calc((100vh - var(--sshow-top) - 13rem) * 1.6);
  max-width: calc((100svh - var(--sshow-top) - 13rem) * 1.6);
}
.sshow-browser-frame {
  border-radius: 14px; overflow: hidden; background: var(--bg-elev, #fff);
  border: 1px solid var(--line, #e6e2d8); box-shadow: var(--shadow-l, 0 20px 48px -12px rgba(0, 0, 0, .3));
}
.sshow-browser-bar {
  display: flex; align-items: center; gap: .75rem; height: 2.1rem; padding: 0 .8rem;
  background: var(--bg-sunk, #f4f2eb); border-bottom: 1px solid var(--line, #e6e2d8);
}
.sshow-dots { display: inline-flex; gap: 6px; flex: none; }
.sshow-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2, #d3cec1); }
.sshow-url {
  flex: 0 1 60%; margin: 0 auto; padding: .12rem .75rem; border-radius: 7px; background: var(--bg-elev, #fff);
  border: 1px solid var(--line, #e6e2d8); color: var(--ink-3, #5b6764); font-size: .74rem; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translateX(-18px);
}

/* ---------------------------------------------------------------- Schmale Viewports (< 600 px)
   Bühne oben ausrichten (kein Leerraum über dem Gerät). Forderungs-Agent: Handy-Aufnahme der App (390 CSS-px breit,
   Video 624×1024) statt verkleinertem Desktop – so groß wie möglich, damit die App-Schrift (15 px) effektiv ≥ 12 px bleibt. */
@media (max-width: 37.4375rem) {
  .scroll-show.sshow-on { --sshow-top: 4.25rem; }
  .sshow-scrub .sshow-stage { align-content: start; gap: .7rem; padding-top: .25rem; }
  .sshow-scrub .sshow-count { display: none; }
  .sshow-scrub .sshow-progress { margin-bottom: .6rem; }
  .sshow-scrub .sshow-tx strong { font-size: 1rem; }
  .sshow-scrub .sshow-tx span { font-size: .88rem; line-height: 1.45; }
  .sshow-small .sshow-browser { width: 100%; }
  /* Handy-Aufnahme: ohne Browserleiste (spart Höhe), Breite so, dass Gerät + Kapitel in den Bildschirm passen */
  .sshow-small .sshow-browser-bar { display: none; }
  .sshow-scrub.sshow-small .sshow-browser {
    max-width: calc((100vh - var(--sshow-top) - 9.75rem) * .609);
    max-width: calc((100svh - var(--sshow-top) - 9.75rem) * .609);
  }
  .sshow-small .sshow-note { margin-top: .35rem; font-size: .72rem; }
}

/* ---------------------------------------------------------------- Bildfläche: Standbild + Video darüber */
.sshow-media { position: relative; aspect-ratio: var(--sshow-ar, 600 / 1298); background: #fff; overflow: hidden; }
.sshow-media .sshow-pic, .sshow-media img, .sshow-video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: top;
}
.sshow-video { opacity: 0; background: transparent; pointer-events: none; }
.sshow-ready .sshow-video { opacity: 1; }
.sshow-note { margin: .7rem 0 0; text-align: center; font-size: .78rem; color: var(--ink-3, #5b6764); }

/* ---------------------------------------------------------------- Kapitel */
.sshow-caption { width: 100%; max-width: 30rem; }
.sshow-count {
  margin: 0 0 .4rem; font: 600 .78rem/1 var(--mono, ui-monospace, monospace); letter-spacing: .04em;
  color: var(--sshow-accent); font-variant-numeric: tabular-nums;
}
.sshow-progress { position: relative; height: 3px; border-radius: 3px; background: var(--line, #e6e2d8); overflow: hidden; margin-bottom: .9rem; }
.sshow-progress i { position: absolute; inset: 0; background: var(--sshow-accent); transform: scaleX(0); transform-origin: 0 50%; }
.sshow-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sshow-ch { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; align-items: baseline; }
.sshow-n { font: 600 .74rem/1.4 var(--mono, ui-monospace, monospace); color: var(--ink-3, #5b6764); font-variant-numeric: tabular-nums; }
.sshow-tx { display: grid; gap: .15rem; }
.sshow-tx strong { font-size: 1.06rem; line-height: 1.3; letter-spacing: -.01em; color: var(--ink, #13201e); }
.sshow-tx span { font-size: .95rem; line-height: 1.5; color: var(--ink-2, #3f4c49); }

/* Schmal (Handy, schmale Spalte): nur das aktive Kapitel, alle liegen übereinander (Höhe bleibt ruhig).
   Inaktive Einträge sind nur durchsichtig, nicht versteckt – Screenreader lesen die ganze Liste. */
.sshow-scrub .sshow-ch { grid-area: 1 / 1; opacity: 0; pointer-events: none; }
.sshow-scrub .sshow-ch.is-active { opacity: 1; pointer-events: auto; }
.sshow-scrub .sshow-caption { text-align: left; }

/* Breite Spalte + Handy: Gerät links, alle Kapitel rechts (aktives hervorgehoben) */
@container (min-width: 34rem) {
  .sshow-stage-phone .sshow-caption { max-width: 17rem; }
  .sshow-stage-phone { grid-template-columns: auto minmax(0, 17rem); justify-content: center; align-items: center; gap: clamp(1.5rem, 4cqi, 2.75rem); }
  .sshow-scrub .sshow-stage-phone .sshow-list { gap: .9rem; }
  .sshow-scrub .sshow-stage-phone .sshow-ch { grid-area: auto; opacity: .38; pointer-events: auto; }
  .sshow-scrub .sshow-stage-phone .sshow-ch.is-active { opacity: 1; }
  .sshow-scrub .sshow-stage-phone .sshow-ch:not(.is-active) .sshow-tx span { display: none; }
  .sshow-scrub .sshow-stage-phone .sshow-ch.is-active .sshow-n { color: var(--sshow-accent); }
}

/* Ruhige Fassung (Bewegung reduzieren, Datensparen, Ladefehler): Standbild + vollständige Kapitelliste */
.sshow-static .sshow-stage { gap: 1.5rem; }
.sshow-static .sshow-count, .sshow-static .sshow-progress { display: none; }
.sshow-static .sshow-list { gap: .85rem; counter-reset: none; }
.sshow-static .sshow-caption { max-width: 34rem; }
@container (min-width: 34rem) {
  .sshow-static .sshow-stage-phone .sshow-caption { max-width: 19rem; }
  .sshow-static .sshow-stage-phone { grid-template-columns: auto minmax(0, 19rem); }
}

/* Übergänge nur, wenn Bewegung erwünscht ist */
@media (prefers-reduced-motion: no-preference) {
  .sshow-ch { transition: opacity .35s var(--ease, ease); }
  .sshow-video { transition: opacity .3s ease; }
}

@media (forced-colors: active) {
  .sshow-phone-frame, .sshow-browser-frame { border: 1px solid CanvasText; }
  .sshow-progress i { background: Highlight; }
}
@media print {
  .sshow-scrub .sshow-track { height: auto; }
  .sshow-scrub .sshow-stage { position: static; height: auto; }
  .sshow-video { display: none; }
}
