/* css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');


:root {
  --color-bg: #f4f6f8;
  --color-card: #ffffff;
  --color-text: #2c3e50;
  --color-primary: #3498db;
  --color-primary-hover: #217dbb;
  --color-footer-bg: #ffffff;
  --color-footer-text: #2c3e50;
  --brand: #008c4a;
  --brand-dark: #217dbb;
  --muted: #777;
  /* 👉 sagt dem Browser: bitte NICHT automatisch abdunkeln */
  color-scheme: light;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body */
body {
  font-family: 'Inter', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--color-primary-hover);
}

/* HEADER */
header {
  position: relative;
  /* etwas geringere Höhe, damit Logo drübersteht */
  height: 140px;
  background: url("../img/bg.png") center center / cover no-repeat;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;            /* Dicke des weißen Streifens */
  background: #fff;
  z-index: 3;             /* vor dem Header-BG, aber hinter dem Logo */
}

/* Logo-Container macht den Überstand */
.logo-container {
  position: absolute;
  top: 65%;               /* weier unten im Header */
  left: 50%;
  transform: translate(-50%, -50%);  /* genau zentrieren */
  background: #fff;       /* weißer Kreis hinter Logo */
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 11;
}

/* Logo-Bild */
.logo-container img {
  display: block;
  width: 160px;   /* größere Darstellung */
  height: auto;
  z-index: 10;
}

/* MAIN */
main {
  flex: 1;
  padding: 3rem 2rem 1rem;  /* oben genug Abstand nach Logo */
}

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

/* Buch-Karte */
.book {
  background: var(--color-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.book img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
}
.book-title {
  margin: 1rem 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

/* YouTube-Link */
.video-link {
  margin-top: auto;
  font-size: 0.875rem;
  text-align: center;
}
.video-link .icon {
  width: 18px;
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Buch-Viewer */
.page-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 280px);
  background: var(--color-bg);
}

/* sorgt dafür, dass beim Springen auf #page-viewer
   oben mindestens 180px Abstand (Header-Höhe) bleibt */
#page-viewer {
  scroll-margin-top: 110px;
}
img.page {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Navigation */
.nav {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.nav a {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.3s ease;
}
.nav a:hover {
  background: var(--color-primary-hover);
}



/* Intro-Text oberhalb der Galerie */
.intro {
  max-width: 800px;
  margin: 0 auto 2rem;  /* zentriert, mit Abstand nach unten */
  text-align: center;
  line-height: 1.6;
  color: var(--color-text);
}
.intro p {
  margin-bottom: 1rem;
}
.intro p strong {
  font-size: 1.25rem;
}
.intro p em {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  color: var(--color-primary);
}
.book-title-card {
  background: var(--color-card);
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  margin: 1rem auto;
}
.book-title-card h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
}
.book-title-card span {
  display: block;
  font-size: 0.875rem;
  color: var(--color-primary);
  margin-top: 0.25rem;
}
.parent {
  text-align: center;
}

/* Newsletter-Block */
.newsletter {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
}
.newsletter-message {
  margin-bottom: 1rem;
  font-weight: 500;
  color: green;
}
.newsletter-text {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.newsletter-form button {
  padding: 0.5rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}
.newsletter-form button:hover {
  background: var(--color-primary-hover);
}

/* =======================
   Ergänzungen: Buch-Viewer
   (keine Änderungen an Header/Footer-Regeln)
   ======================= */

.viewer {
  position: relative;
  max-width: min(95vw, 1100px);
  margin: 16px auto;
  touch-action: pan-y pinch-zoom pan-x;
}

/* Das Track-Element der Slides */
.carousel {
  display: flex;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  background: var(--color-card);
  will-change: transform;
  transition: transform .4s ease;
}

/* Ein Slide nimmt immer 100% Breite ein */
.slide {
  min-width: 100%;
  display: grid;
  place-items: center;
  padding: clamp(.5rem, 2vw, 1rem);
  opacity: .5;
  transition: opacity .25s ease;
}

/* Aktives Slide etwas stärker sichtbar */
.slide.is-active { opacity: 1; }

/* Bild im Slide – spezifischer als das allgemeine img.page,
   damit hier die Max-Höhe für den Viewer gilt. */
.slide img.page {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 300px);
  object-fit: contain;
  border-radius: 8px;
}

/* Overlay-Navigation links/rechts */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
}
.nav-btn:hover { background: rgba(0,0,0,.45); }
.nav-btn[disabled] { opacity: .4; cursor: default; }
.nav-btn.prev { left: .5rem; }
.nav-btn.next { right: .5rem; }

/* Dots unter dem Viewer */
.dots {
  position: relative;
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 0 0;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: #cfd6dc;
  cursor: pointer;
}
.dot.active { background: var(--color-primary); }

/* Seitenzähler unten rechts */
.counter {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  z-index: 5;
  font-size: .9rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: .25rem .5rem;
  border-radius: 8px;
}

/* Kleiner Vollbild-Button oben rechts im Viewer */
.fs-fab {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fs-fab:hover { background: rgba(0,0,0,.75); }

/* Thumbnails-Leiste (optional einblendbar) */
.thumbs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 10px;
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  margin-top: 10px;
}
.thumbs::-webkit-scrollbar { height: 8px; }
.thumbs::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 8px; }

.thumb {
  flex: 0 0 auto;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  outline-offset: 2px;
}
.thumb img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  opacity: .7;
  transition: transform .15s ease, opacity .15s;
}
.thumb:hover img { transform: translateY(-2px); opacity: .9; }
.thumb.active img { outline: 2px solid var(--color-primary); opacity: 1; }

/* Mobile Feintuning */
@media (hover:none) {
  .nav-btn {
    width: 36px;   /* gleiche Größe auch mobil */
    height: 36px;
    font-size: 22px;
    background: rgba(0,0,0,0.15); /* Transparenz auch hier */
  }
}
@media (max-width: 640px) {
  .slide img.page { max-height: calc(100vh - 240px); }
}

/* Bewegungen reduzieren */
@media (prefers-reduced-motion: reduce) {
  .carousel { transition: none; }
  .slide { transition: none; }
}


/* Ergänzung: separates Track-Element im Viewer */
.carousel { 
  /* wird zur Viewport-Hülle */
  display: block;            /* überschreibt evtl. frühere display:flex */
  overflow: hidden;          /* Viewport schneidet ab */
  position: relative;
}

.carousel-track {
  display: flex;             /* Track ist flex, enthält die Slides */
  will-change: transform;
  transition: transform .4s ease;
}

/* Slides behalten 100% Breite */
.slide { min-width: 100%; }


/* Toolbar über dem Viewer (UI-Einbettung, ohne Header/Footer-Regeln zu ändern) */
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 4px;
}
.viewer-title {
  font-weight: 600;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.viewer-toolbar .viewer-actions {  margin-inline: auto;       /* schiebt den Block in die Mitte */  width: fit-content;        /* so breit wie nötig */}

/* prevent user-select while dragging */
.viewer, .carousel, .carousel-track { -webkit-user-select: none; user-select: none; }

/* Einheitliche Buttons im Viewer */
.viewer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
}

.viewer-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

.viewer-btn:active {
  transform: translateY(0);
}

/* Home-Button in Grün */
.btn-home { background: #2ecc71; }
.btn-home:hover { background: #27ae60; }

/* Haus-Icon */
.icon-home {
  width: 20px;
  height: 20px;
  display: block;
}

/* Nur Icon auf sehr kleinen Screens */
@media (max-width: 50px) {
  .viewer-btn .btn-text {
    display: none;
  }
}

/* Vollbild in mobiler Ansicht ausblenden (wie gewünscht) */
@media (max-width: 640px) {
  .fs-fab,
  .toggle-fs {
    display: none !important;
  }
}

/* Footer (Vorlage aus 3/4) */
.site-footer {
  background: #fefcf9;
  color: #555;
  margin-top: 30px;
  padding: 14px 12px;
  text-align: center;
  border-top: 1px solid #eee;
  font-weight: 400;
  line-height: 1.3;
}
.site-footer .inner {
  max-width: 900px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* Navigation */
.footer-nav {
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 0.82rem;
}
.footer-nav a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}
.footer-nav a:hover {
  color: var(--brand);
  text-decoration: underline;
}
/* Mail-Zeile */
.footer-mail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.footer-mail a {
  color: var(--brand-dark);
  text-decoration: none;
}
.footer-mail a:hover {
  color: var(--brand);
  text-decoration: underline;
}
/* Copyright */
.footer-copy {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Overlay Grundwerte */
:root {
  --overlay-font-size: 12px;
  --overlay-max-width: 90ch;    /* Textbreite begrenzen */
  --overlay-bg: color-mix(in srgb, #000 55%, transparent); /* Fallback für Browser ohne color-mix: siehe nächste Zeile */
  /* Fallback: */
  --overlay-bg-fallback: rgba(0,0,0,0.10);
  --overlay-text: #fff;
  --overlay-radius: 12px;
  --overlay-padding: 1rem;
  --overlay-gap: .6rem;
}

.viewer .slide {
  position: relative;
}

.overlay-text {
  position: absolute;
  inset: auto 0 0 0;         /* unten über ganze Breite */
  display: flex;
  justify-content: center;
  pointer-events: none;      /* keine Klicks abfangen, Bildswipe bleibt nutzbar */
  padding: 1rem;
}

.overlay-text .overlay-inner {
  pointer-events: auto;      /* Interaktion im Text erlauben (z.B. Select/Copy) */
  max-width: var(--overlay-max-width);
  width: min(95%, var(--overlay-max-width));
  font-size: var(--overlay-font-size);
  line-height: 1.4;
  color: var(--overlay-text);
  background: var(--overlay-bg-fallback);
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--overlay-radius);
  padding: var(--overlay-padding);
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
}

.overlay-text .overlay-title {
  margin: 0 0 .5rem 0;
  font-weight: 700;
  font-size: calc(var(--overlay-font-size) * 1.15);
}

/* Absatzabstände */
.overlay-text p {
  margin: 0 0 var(--overlay-gap) 0;
}
.overlay-text p:last-child {
  margin-bottom: 0;
}

/* Ganze Overlays aus-/einblenden über Toggle */
.overlay-hidden .overlay-text {
  display: none !important;
}

/* Responsive Feinschliff für sehr kleine Screens */
@media (max-width: 480px) {
  :root { --overlay-font-size: 12px; }
  .overlay-text { padding: .75rem; }
  .overlay-text .overlay-inner { padding: .75rem; border-radius: 10px; }
}

/* Slider-Label etwas kompakter */
.textsize-ctl {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-left: .5rem;
}
.textsize-ctl input[type="range"] {
  width: 30px;
  vertical-align: middle;
}

/* Mobile: kein Box-Hintergrund, nur Text mit Schatten */
@media (max-width: 640px) {
  .overlay-text .overlay-inner {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;

    padding: 0.5rem 0.75rem;
    border-radius: 0;

    color: #fff;
    font-weight: 600;

    /* dezenter Schatten */
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);

    /* ganz dünner Rand für helle Stellen */
    -webkit-text-stroke: 0.25px rgba(0,0,0,0.3);
  }
}



@media (max-width: 640px) {
  .nav-btn {
    top: 25%; /* statt 40% → höher im Bild */
    transform: translateY(-50%);
  }
}

.font-ctl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: .25rem;
}

.btn-font {
  padding: .25rem .5rem;          /* kompakt */
  line-height: 1;
  border-radius: 6px;
  font-weight: 700;               /* „A“ wirkt klarer */
  min-width: 2rem;                /* angenehme Klickfläche */
}

/* Kleines A optisch etwas kleiner */
.btn-font.font-smaller { font-size: .85rem; }

/* Großes A (das innere <span> hat bereits 1.25em) */
.btn-font.font-bigger { font-size: 1rem; } 

/* Optional: Mobile leicht größere Klickfläche */
@media (hover:none) {
  .btn-font { padding: .35rem .6rem; }
}
/* Container der zwei A-Buttons */
.font-ctl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

/* Schmale A-Buttons: gleiche Höhe wie .viewer-btn, aber ohne seitliche Polsterung */
/* Container */
.font-ctl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

/* Buttons haben gleiche Höhe wie .viewer-btn */
.btn-font {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  padding: 0.5rem;          /* gleiche Höhe wie andere Buttons */
  min-width: 40px;          /* einheitliche Breite */
}

/* A zentrieren */
.btn-font .glyph {
  line-height: 1;
  display: inline-block;
}

/* Kleines A optisch kleiner */
.font-smaller .glyph { font-size: 0.85em; }

/* Großes A optisch größer */
.font-bigger  .glyph { font-size: 1.25em; }

/* ================
   Bottom Sheet
   ================ */
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
  transform: translateY(85%);
  transition: transform 0.3s ease;
  max-height: 90vh;
  z-index: 50;
}

.bottom-sheet.open {
  transform: translateY(0%);
}

.bottom-handle {
  display: block;
  width: 50px;
  height: 6px;
  background: #ccc;
  border-radius: 3px;
  margin: 10px auto;
}

.bottom-content {
  padding: 1.25rem 1.5rem 2rem;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55;
  color: #222;
  overflow-y: auto;
  height: calc(90vh - 50px);
}

/* Kleiner Button rechts unten (optional) */
.bottom-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* ========================
   Untere Button-Leiste im Viewer
   ======================== */
.bottom-controls {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  z-index: 6;
}

.bottom-controls .nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
}

.bottom-controls .nav-btn:hover {
  background: rgba(0,0,0,0.45);
}

.bottom-controls .font-ctl {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.bottom-controls .btn-font {
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
}

/* ============ Bottom-Controls: dezent über dem linken Pfeil ============ */
.viewer .bottom-controls {
  position: absolute;
  left: 0.5rem;            /* gleiche Kante wie .nav-btn.prev */
  top: 50%;                /* Ausgangspunkt: Mitte wie der Pfeil */
  transform: translateY(-70%); /* etwas oberhalb vom Pfeil */
  display: flex;
  flex-direction: column;  /* senkrecht stapeln */
  gap: 0.4rem;
  z-index: 6;              /* über den Pfeilen (z-index:5) */
  pointer-events: none;    /* Swipe bleibt frei */
}

/* Buttons selbst wieder klickbar machen */
.viewer .bottom-controls .nav-btn,
.viewer .bottom-controls .btn-font {
  position: static;        /* NICHT absolut – sauber stapeln */
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
  pointer-events: auto;    /* klickbar */
}
.viewer .bottom-controls .nav-btn:hover,
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
}

/* A-/A/A+ kompakt und optisch gleich */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: column;  /* auch senkrecht */
  gap: 0.4rem;
}
.viewer .bottom-controls .btn-font {
  border-radius: 8px;
  font-weight: 700;
  width: 36px;
  height: 36px;
}

/* Mobile: Pfeile sind höher (top:25%) – Controls ebenfalls etwas höher setzen */
@media (max-width: 640px) {
  .viewer .bottom-controls {
    top: 25%;
    transform: translateY(-35%); /* leicht darüber */
  }
}

/* ============================
   Steuerelement-Leiste oben links im Bild
   ============================ */
.viewer .bottom-controls {
  position: absolute;
  top: 0.75rem;           /* Abstand von oben */
  left: 0.75rem;          /* Abstand von links */
  transform: none;        /* kein Verschieben nötig */
  display: flex;
  flex-direction: row;    /* WAAGRECHT anordnen */
  align-items: center;
  gap: 0.5rem;            /* Abstand zwischen Buttons */
  z-index: 6;             /* über dem Bild, unter Vollbild-Button */
  pointer-events: none;   /* Swipe bleibt möglich */
}

/* Buttons selbst wieder klickbar */
.viewer .bottom-controls .nav-btn,
.viewer .bottom-controls .btn-font {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
  pointer-events: auto;   /* macht sie klickbar */
  transition: background 0.3s ease;
}
.viewer .bottom-controls .nav-btn:hover,
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
}

/* A-/A/A+ kompakt */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}
.viewer .bottom-controls .btn-font {
  border-radius: 8px;
  font-weight: 700;
  width: 36px;
  height: 36px;
}

/* Mobile: Leiste bleibt oben, aber mit etwas mehr Abstand */
@media (max-width: 640px) {
  .viewer .bottom-controls {
    top: 0.5rem;
    left: 0.5rem;
    gap: 0.35rem;
  }
}

/* ============================
   Steuerelement-Leiste weit oben links im Bild
   ============================ */
.viewer .bottom-controls {
  position: absolute;
  top: -0.75rem;          /* leicht nach OBEN über die Bildkante hinaus */
  left: 0.75rem;
  transform: none;
  display: flex;
  flex-direction: row;    /* WAAGRECHT */
  align-items: center;
  gap: 0.5rem;
  z-index: 7;             /* sicher über Bild, unter Vollbild-Button */
  pointer-events: none;   /* Swipe bleibt möglich */
}

/* Buttons klickbar + Stil wie Pfeile */
.viewer .bottom-controls .nav-btn,
.viewer .bottom-controls .btn-font {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
  pointer-events: auto;
  transition: background 0.3s ease;
}
.viewer .bottom-controls .nav-btn:hover,
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
}

/* A-/A/A+ kompakt nebeneinander */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}
.viewer .bottom-controls .btn-font {
  border-radius: 8px;
  font-weight: 700;
  width: 36px;
  height: 36px;
}

/* Mobile Feintuning: noch etwas höher */
@media (max-width: 640px) {
  .viewer .bottom-controls {
    top: -1rem;
    left: 0.5rem;
    gap: 0.35rem;
  }
}


/* ============================
   Steuerelement-Leiste weit oben links im Bild
   ============================ */
.viewer .bottom-controls {
  position: absolute;
  top: -0.75rem;          /* leicht nach OBEN über die Bildkante hinaus */
  left: 0.75rem;
  transform: none;
  display: flex;
  flex-direction: row;    /* WAAGRECHT */
  align-items: center;
  gap: 0.5rem;
  z-index: 7;             /* sicher über Bild, unter Vollbild-Button */
  pointer-events: none;   /* Swipe bleibt möglich */
}

/* Buttons klickbar + Stil wie Pfeile */
.viewer .bottom-controls .nav-btn,
.viewer .bottom-controls .btn-font {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(4px);
  pointer-events: auto;
  transition: background 0.3s ease;
}
.viewer .bottom-controls .nav-btn:hover,
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
}

/* A-/A/A+ kompakt nebeneinander */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}
.viewer .bottom-controls .btn-font {
  border-radius: 8px;
  font-weight: 700;
  width: 36px;
  height: 36px;
}

/* Mobile Feintuning: noch etwas höher */
@media (max-width: 640px) {
  .viewer .bottom-controls {
    top: -15rem;
    left: 0.5rem;
    gap: 0.35rem;
  }
}

/* Kleinere A-/A/A+-Buttons */
.viewer .bottom-controls .btn-font {
  width: 28px;          /* vorher 34–36px */
  height: 28px;
  font-size: 14px;      /* etwas kleinere Schrift */
  border-radius: 6px;   /* leicht eckiger, damit's zierlicher wirkt */
  background: rgba(255,255,255,0.18);
  transition: background 0.25s ease, transform 0.2s ease;
}

.viewer .bottom-controls .btn-font:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

/* Weniger Abstand zwischen A-/A/A+ */
.viewer .bottom-controls .font-ctl {
  gap: 0.2rem;
}

/* A-/A/A+-Buttons rund wie die anderen Steuerknöpfe */
.viewer .bottom-controls .btn-font {
  width: 28px;
  height: 28px;
  border-radius: 999px;     /* macht sie komplett rund */
  font-size: 14px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.25s ease, transform 0.2s ease;
}

.viewer .bottom-controls .btn-font:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

/* Abstand innerhalb der A-/A/A+-Gruppe */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}
/* Einheitlich runde, statische A-/A/A+-Buttons im HUD */
.viewer .bottom-controls .btn-font {
  width: 28px;
  height: 28px;
  border-radius: 50%;           /* garantiert runde Form */
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.18);
  display: inline-grid;         /* perfekt zentriert */
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.25s ease; /* keine Bewegung mehr */
  transform: none !important;        /* kein Hüpfen */
}

.viewer .bottom-controls .btn-font:hover {
  background: rgba(255,255,255,0.3);
  transform: none;              /* stabil beim Hover */
}

/* Gruppe der drei Buttons kompakt nebeneinander */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

/* ===========================================
   Steuerleiste unten links – alle Buttons in einer Linie
   =========================================== */
.viewer .bottom-controls {
  position: absolute;
  left: 0.8rem;              /* leicht vom linken Rand */
  bottom: 4.2rem;            /* knapp über dem linken Pfeil */
  display: flex;
  flex-direction: row;       /* WAAGRECHT – alles in einer Linie */
  align-items: center;
  gap: 0.45rem;              /* Abstand zwischen Buttons */
  z-index: 6;
  pointer-events: none;      /* Swipe bleibt möglich */
}

/* Alle Buttons: rund, einheitlich, statisch */
.viewer .bottom-controls .nav-btn,
.viewer .bottom-controls .btn-font {
  position: static;
  width: 32px;
  height: 32px;
  border-radius: 50%;        /* rund */
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: saturate(120%) blur(4px);
  transition: background 0.25s ease;
  transform: none !important; /* kein Hüpfen */
}

/* Hover-Effekt bleibt dezent und stabil */
.viewer .bottom-controls .nav-btn:hover,
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0, 0, 0, 0.45);
  transform: none;
}

/* Gruppe der A-/A/A+-Buttons: nebeneinander, etwas kleiner */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

.viewer .bottom-controls .btn-font {
  width: 28px;
  height: 28px;
  font-size: 14px;
  border-radius: 50%; /* sicherstellen, dass sie rund bleiben */
}

/* Einheitliche Textgrößen-Buttons unten links */
.viewer .bottom-controls .font-ctl {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

/* A− / A / A+ Buttons gleich groß, rund und statisch */
.viewer .bottom-controls .btn-font {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 13px;             /* etwas kleiner, damit das Plus hineinpasst */
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;              /* kein Überstand */
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.25s ease;
  transform: none !important;  /* kein Hüpfen */
  box-sizing: border-box;
}

/* Hover-Effekt */
.viewer .bottom-controls .btn-font:hover {
  background: rgba(0,0,0,0.45);
  transform: none;
}

.viewer .bottom-controls .toggle-overlay svg {
  display: block;
  stroke: #fff;
  fill: none;
}
.overlay-hidden .bottom-controls .toggle-overlay svg {
  filter: drop-shadow(0 0 2px rgba(0,0,0,.4));
}
.overlay-hidden .bottom-controls .toggle-overlay svg::after { /* einfacher: Farbe ändern */
  /* Alternativ: du kannst bei Klick per JS eine Klasse .is-off setzen und eine zweite SVG mit Slash einblenden */
}

/* Durchgestrichenes Auge, wenn Text ausgeblendet ist */
.nav-btn.toggle-overlay svg {
  transition: opacity 0.2s ease;
}

/* Wenn Text ausgeblendet → Linie über das Auge */
.overlay-hidden .nav-btn.toggle-overlay svg::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: currentColor;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  pointer-events: none;
  opacity: 0.85;
}

/* Button wird Bezugspunkt für die Linie */
.nav-btn.toggle-overlay {
  position: relative;
}

/* Auge leicht abdunkeln, wenn Text aus */
.overlay-hidden .nav-btn.toggle-overlay svg {
  opacity: 0.9;
}

/* Die schräge Linie über dem Auge (nur wenn Text aus) */
.overlay-hidden .nav-btn.toggle-overlay::after {
  content: "";
  position: absolute;
  width: 22px;                 /* Länge der Linie */
  height: 2px;                 /* Stärke der Linie */
  background: currentColor;    /* gleiche Farbe wie das Icon */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
  pointer-events: none;        /* blockiert keine Klicks */
  z-index: 2;                  /* über dem SVG */
}

/* sicherstellen, dass das SVG unter der Linie liegt */
.nav-btn.toggle-overlay svg {
  position: relative;
  z-index: 1;
  display: block;              /* kein Inline-Gap */
}

/* Einheitliche Farbe & Übergang */
.btn-tts svg {
  color: #fff;
  stroke: #fff;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Leichtes Feedback beim Klick */
.btn-tts:active svg {
  transform: scale(0.9);
}

/* Symbolwechsel: Stop, wenn abgespielt */
.btn-tts.playing .icon-play {
  display: none;
}

.btn-tts.playing::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  background: #fff;
  box-sizing: border-box;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (min-width: 768px) {
  .viewer .bottom-controls {
    bottom: 28rem; /* statt 1rem – Buttons weiter nach oben */
  }
}

/* ===== Fix: Bottom-Controls stabil OBEN verankern (ohne Springen) ===== */
.viewer { position: relative; } /* falls noch nicht gesetzt */

.viewer .bottom-controls {
  position: absolute;
  top: 0.75rem;          /* hier stellst du "oben" ein */
  left: 0.75rem;         /* oder zentriert mit left:50%; transform:translateX(-50%) */
  bottom: auto !important;
  transform: none !important;
  transition: none !important;  /* verhindert "langsames Hochwandern" */
  pointer-events: none;         /* damit Wischen möglich bleibt */
  z-index: 10;
}

/* Buttons wieder klickbar */
.viewer .bottom-controls > * {
  pointer-events: auto;
}

/* Optional: für schmalere Fenster etwas näher an die Kante */
@media (max-width: 900px) {
  .viewer .bottom-controls {
    top: 0.5rem;
    left: 0.5rem;
  }
}

/* === iOS/Safari-Fix: Bottom-Controls stabil oben links anpinnen === */
.viewer { position: relative; } /* falls nicht schon gesetzt */

.viewer .bottom-controls {
  position: absolute !important;
  top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: auto !important;
  bottom: auto !important;

  transform: none !important;
  transition: none !important;

  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.45rem !important;

  z-index: 10 !important;
  pointer-events: none; /* Swipe bleibt möglich */
}

/* Buttons in der Leiste wieder klickbar machen */
.viewer .bottom-controls > * {
  pointer-events: auto;
}

/* iOS-spezifisch noch einmal extra „nageln“ (optional) */
@supports (-webkit-touch-callout: none) {
  .viewer .bottom-controls {
    top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  }
}

/* Inaktive Viewer-Controls: sichtbar, aber „blass“ */
.bottom-controls .nav-btn.inactive,
.bottom-controls .btn-font.inactive {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(80%);
  transform: none !important;
}

.bottom-controls .nav-btn.inactive:hover,
.bottom-controls .btn-font.inactive:hover {
  background: rgba(0,0,0,0.25) !important;
}

