:root  {
    /* Set --vh to 1% of the viewport height to handle mobile UI bars */
    --vh: 1vh;
  }
  /* Use the custom vh unit for the spread container */
  .slide.spread.double.active, #sliderScroll  {
    height: calc(var(--vh) * 100) !important;
    overflow-y: auto !important;
  }

/* ---- nächste Style-Sektion ---- */

/* Remove tap highlight on all elements */
    *  {
      -webkit-tap-highlight-color: transparent !important;
      touch-action: manipulation;
    }
    /* Prevent image dragging and blue overlay */
    img  {
      -webkit-user-drag: none;
    }

/* ---- nächste Style-Sektion ---- */

/* Basis-Reset */
    *  {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    html, body {
    box-sizing: content-box !important;
}
	
	html, body  {
      min-height: calc(var(--vh) * 100);
      overflow-y: auto;
      width: 100%;
      overflow-y: auto;
      margin: 0;
      padding: 0;
      
    }
    body  {
      font-family: Arial, sans-serif;
      line-height: 1.5;
      
      display: block;
    }

    /* Container für Slider und Controls */
    .slider-container  {
      position: relative;
      width: 100%;
      height: calc(var(--vh) * 100);
      
      border: 0;
    }

    /* Scrollbarer Bereich für Slides */
    .slider  {
      width: 100%;
      height: 100%;
      overflow: auto; /* Damit gezoomte Bilder gescrollt werden können */
      cursor: grab;
      user-select: none; /* Keine Textauswahl */
      
    }
    .slider:active  {
      cursor: grabbing;
    }

    /* Container für alle Slides */
    #slides-container  {
      position: relative;
      width: 100%;
      height: 100%;
	    z-index: 2;
 }

    /* Eine Slide belegt 100% Breite & Höhe, wird per JS ein-/ausgeblendet */
    .slide  {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: none;
      justify-content: center;
      align-items: center;
      transform-origin: center center;
      
    }
    .slide.active  {
      display: flex;
    }

    /* Doppelseiten-Spread: zwei Wrapper nebeneinander, zentriert, ohne Abstand */
    .slide.spread.double  {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0;
      gap: 0; /* Kein Zwischenraum */
      
    }

    /* Wrapper für linke Seite, damit Shadow-Overlay positioniert werden kann */
    .page-left-wrapper  {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      flex: 0 0 auto;
      margin: 0;
      padding: 0;
      z-index: 0;

      cursor: pointer;
    }
    .page-left-wrapper .page-img  {
      position: relative !important;
      z-index: 0 !important; /* Basisbild in Schicht 0 */
      height: 100%;
      width: auto;
      display: block;
	  padding: 18px 0px 18px 0px;
	  /*border-radius: 25px 0px 0px 25px;*/
	  /* clip-path: inset(18px round 7px);*/
      user-select: none;
    }
    .page-left-wrapper .overlay-img  {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      z-index: 1 !important; /* Overlay in Schicht 1 */
      height: 100% !important;
      width: auto !important;
      pointer-events: none;
      user-select: none;
      opacity: 0.7;
    }

    /* Wrapper für rechte Seite, analog zum linken */
    .page-right-wrapper  {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      flex: 0 0 auto;
      margin: 0;
      padding: 0;
      z-index: 0;

      cursor: pointer;
    }
    .page-right-wrapper .page-img  {
      position: relative !important;
      z-index: 0 !important;
      height: 100%;
      width: auto;
      display: block;
	  padding: 18px 0px 18px 0px;
	 /*border-radius: 25px 0px 0px 25px;*/
	   /*clip-path: inset(18px round 7px);*/
      user-select: none;
    }
    .page-right-wrapper .overlay-img  {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      z-index: 1 !important;
      height: 100% !important;
      width: auto !important;
      pointer-events: none;
      user-select: none;
      opacity: 0.7;
    }

    /* Einzelseiten-Spread */
    .slide.spread.single  {
      display: flex;
      justify-content: center;
      align-items: center;
	  padding: 18px;
    }
	
	.page-img {
border-radius: 6px;
filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
	
    .slide.spread.single .page-img  {
      height: 100%;
      width: auto;
      user-select: none;
    }

    /* Einzelseiten-Modus */
    .slide.page  {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0;
      
      cursor: pointer;
    }
    .slide.page .page-img  {
      max-height: 100%;
      max-width: 100%;
      height: auto;
      width: auto;
      user-select: none;
    }

    /* Vollflächige Prev/Next-Buttons */
    .nav-overlay  {
      position: absolute;
      top: 0;
      height: 100%;
      width: 0px;
      background: transparent;
      cursor: pointer;
      z-index: 5;
    }
    .nav-left  { left: 0; }
    .nav-right  { right: 0; }

    .nav-overlay:focus  {
      outline: 3px solid #ffbf47;
    }

    /* Zoom-Controls */
    .zoom-controls  {
      position: absolute;
      bottom: 1rem;
      right: 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      z-index: 10;
      user-select: none;
    }
    .zoom-controls button {
      font-size: 1.25rem;
      padding: 0.125rem 0.5rem 0.25rem; 
      background: #333;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    .zoom-controls button:focus {
      outline: 3px solid #ffbf47;
    }
    #zoom-level  {
      font-size: 1rem;
      color: #000;
    }

    /* Page-Nummer-Anzeige */
    .page-indicator  {
      font-size: 1rem;
      color: #000;
      margin: 0 0.5rem;
    }

    /* Container für Badge, Exit-Button und Nav-Buttons */
    #zoomContainer  {
      position: absolute;
      top: 1rem;
      left: 50%;
      transform: translateX(-50%);
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      z-index: 20;
      user-select: none;
    }
    /* Zoom-Badge */
    #zoomBadge  {
      background: rgba(255, 223, 0, 0.9);
      color: #000;
      padding: 0.25rem 0.75rem;
      border-radius: 4px;
      font-size: 0.9rem;
      display: none;
    }
    /* Button „X Zoom verlassen“ */
    #zoomExitBtn {
      background: #333;
      color: #fff;
      border: none;
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
      font-size: 1.25rem;
      cursor: pointer;
      display: none;
    }
    #zoomExitBtn:focus {
      outline: 3px solid #ffbf47;
    }

    /* Screenreader: ausgeblendete Slides */
    .slide[aria-hidden="true"]  {
      display: none !important;
    }

/* ---- nächste Style-Sektion ---- */

/* CSS für die erste Seite im mobilen Portrait-Modus */
  @media only screen and (orientation: portrait)  {
    /* Erster Slide in Single-Page- oder Single-Spread-Modus */
    #slides-container > .slide.page:first-child .page-img,
    #slides-container > .slide.spread.single:first-child .page-img {
      max-width: 100vw !important;
      max-height: 100vh !important;
      width: auto !important;
      height: auto !important;
    }
  }

/* ---- nächste Style-Sektion ---- */

/* Stil für deaktivierten Zurück-Button */
    #btnNavPrev:disabled {
      opacity: 0.4;
    }

/* ---- nächste Style-Sektion ---- */

@media only screen and (max-width: 900px) and (orientation: landscape)  {
  /* Zoom-Funktion deaktivieren */
  .zoom-in, .zoom-out, .zoom-slider { display: none !important; pointer-events: none !important; }


      /* Hide inactive slides in mobile landscape */
      .slide.page:not(.active), .slide.single:not(.active), .slide.spread.single:not(.active)  {
        display: none !important;
      }

      /* Ensure active single slide is visible */
      .slide.page.active  {
        display: flex !important;
        width: 100vw !important;
        height: 100vh !important;
      }

      .slide.spread.double:not(.active)  { display: none !important; }
      .slide.spread.double.active  {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        height: 100vh !important;
        overflow-y: auto !important; overflow-x: hidden !important;
      }
      .slide.spread.double.active .page-left-wrapper,
      .slide.spread.double.active .page-right-wrapper  {
        width: 50vw !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
      }
      .slide.spread.double.active .page-left-wrapper .page-img,
      .slide.spread.double.active .page-right-wrapper .page-img  {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
      }

    }

/* ---- nächste Style-Sektion ---- */

/* Hide scrollbars on html and body but allow scrolling */
  html, body  {
    overflow-y: auto !important;
    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* IE 10+ */
    margin: 0;
    padding: 0;
  }
  html::-webkit-scrollbar, body::-webkit-scrollbar  {
    display: none;                 /* Safari and Chrome */
    width: 0;
    height: 0;
  }

/* ---- nächste Style-Sektion ---- */

/* Moderner Scrollbalken für gezoomten Bereich */
  #sliderScroll.zoomed::-webkit-scrollbar  {
    width: 8px;
  }
  #sliderScroll.zoomed::-webkit-scrollbar-track  {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
  }
  #sliderScroll.zoomed::-webkit-scrollbar-thumb  {
    background: rgba(0,0,0,0.4);
    border-radius: 4px;
  }
  #sliderScroll.zoomed  {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.4) rgba(0,0,0,0.1);
  }

/* ---- nächste Style-Sektion ---- */

.slide.spread.double.active::-webkit-scrollbar  {
  width: 8px;
}
.slide.spread.double.active::-webkit-scrollbar-track  {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}
.slide.spread.double.active::-webkit-scrollbar-thumb  {
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
}
.slide.spread.double.active  {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.4) rgba(0,0,0,0.1);
}

/* ---- nächste Style-Sektion ---- */

.slide.page.active::-webkit-scrollbar,
        .slide.spread.double.active::-webkit-scrollbar  {
          width: 8px !important;
        }
        .slide.page.active::-webkit-scrollbar-track,
        .slide.spread.double.active::-webkit-scrollbar-track  {
          background: transparent !important;
        }
        .slide.page.active::-webkit-scrollbar-thumb,
        .slide.spread.double.active::-webkit-scrollbar-thumb  {
          background: rgba(0,0,0,0.4) !important;
          border-radius: 4px !important;
        }
        .slide.page.active, .slide.spread.double.active  {
          scrollbar-width: thin;
          scrollbar-color: rgba(0,0,0,0.4) transparent;
        }

/* ---- nächste Style-Sektion ---- */

.slide.spread.double.active::-webkit-scrollbar  {
  width: 8px !important;
}
.slide.spread.double.active::-webkit-scrollbar-track  {
  background: transparent !important;
}
.slide.spread.double.active::-webkit-scrollbar-thumb  {
  background: rgba(0,0,0,0.4) !important;
  border-radius: 4px !important;
}
.slide.spread.double.active  {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.4) transparent;
}

/* ---- nächste Style-Sektion ---- */

.slide.spread.double.active  {
  position: relative;
}

.double-click-area  {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 5;
}

.double-click-area.left  {
  left: 0;
}

.double-click-area.right  {
  right: 0;
}

.page-left-wrapper, .page-right-wrapper  {
  z-index: 10; /* Bilder sollen über den Click-Areas bleiben */
}

/* ---- nächste Style-Sektion ---- */

html, body {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  background-clip: padding-box !important;
}

/* ---- nächste Style-Sektion ---- */

html, body {
  background: #fff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  min-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
}
body {
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
#app, .app-container, .wrapper, #sliderScroll {
  background: #fff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
@media (prefers-color-scheme: dark) {
  html, body, #app, .app-container, .wrapper, #sliderScroll {
    background: #fff !important;
  }
}

/* ---- nächste Style-Sektion ---- */

.slide:focus,
#sliderScroll:focus {
  outline: none !important;
  -webkit-focus-ring-color: transparent !important;
}

/* ---- nächste Style-Sektion ---- */

/* Mobile portrait buttons */
@media only screen and (orientation: portrait) {
  .mobile-buttons {
    margin: 0; position: absolute; bottom: 0; left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 14px;
    height: 65px;
    box-sizing: border-box;
    
    z-index: 50;
  }
  .mobile-buttons button {
    border: 2px solid #444;
    background: #fff;
    color: #444;
    font-size: 32px;
    height: 100%;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    flex-shrink: 0;
  }
  #mobilePrev, #mobileNext {
    width: 35%;
  }
  #mobileInfo {
    width: 20%;
  }
}

/* Info overlay */
#infoOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#infoOverlay .overlay-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  color: #000;
  width:  90vw;       
  height: 75vh;     
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: auto;
  
}
#infoOverlay .overlay-content h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
#infoOverlay .overlay-content ul {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}
#infoOverlay .overlay-content li {
  margin: 0.5rem 0;
}
#infoOverlay .overlay-content a,
#infoOverlay .overlay-content button {
  color: #0077aa;
  text-decoration: underline;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
#closeOverlay {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid #444;
  background: #fff;
  color: #444;
  border-radius: 4px;
}

/* ---- nächste Style-Sektion ---- */

.info-btn{
    background:#000;color:#fff;border:none;border-radius:50%;
    width:34px;height:34px;font:700 1rem/34px Arial,Helvetica,sans-serif;
    text-align:center;cursor:pointer;margin-left:auto;
  }
  .info-btn:focus{outline:3px solid #ffbf47;}

  /* Sidebar overlay panel (slides in) */
  #dim{
    position:fixed;inset:0;background:rgba(0,0,0,.5);
    opacity:0;pointer-events:none;transition:opacity .35s linear;z-index:9000;
  }
  #dim.show{opacity:1;pointer-events:auto;}

  #infoPanel{
    position:fixed;top:0;right:-30vw;width:30vw;max-width:400px;height:100vh;
    background:#fff;color:#000;overflow:auto;
    box-shadow: none !important;
    transition:right .35s linear;z-index:10001;padding:1rem 1.25rem;
  }
  #infoPanel.open{right:0;}

  #infoCloseBtn{
    position:absolute;top:.5rem;right:.75rem;background:transparent;
    border:none;font-size:1.5rem;cursor:pointer;
  }
  #infoCloseBtn:focus{outline:3px solid #ffbf47;}
  
  
  .bg-blur {
  position: relative;
  z-index: 0;         /* neuer Stacking‐Context */
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.bg-blur::before {
  content: "";
  position: fixed;    /* immer im Viewport */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://www.blickinsbuch.de/viewer/page/733f79cc14177eeeb07b0346578f4cd9.jpg') center/cover no-repeat;
  filter: blur(40px);
  transform: scale(2.5);
  z-index: 1;
  opacity: 1; 
  top: 100px;
  left: 100px;
  pointer-events: none;
}
/* Dynamischer Hintergrund via CSS-Variable */
:root {
  --dynamic-bg: url('fallback.jpg');
}

.bg-blur::before {
  background: var(--dynamic-bg) center/cover no-repeat;
}


/* Fullscreen-Button NUR sichtbar, wenn kleiner als 700px Breite oder Höhe */
@media only screen and (max-width: 699px), (max-height: 699px) {
  #fullscreenBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* gleiche Größe wie andere Buttons */
    padding: 0.125rem 0.5rem 0.25rem; /* gleiche Abstände wie andere Buttons */
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
}

/* Fullscreen-Button ausblenden bei 700px oder größer */
@media only screen and (min-width: 700px) and (min-height: 700px) {
  #fullscreenBtn {
    display: none !important;
  }
}

/* Andere Buttons visibility=hidden unterhalb 700px Breite oder Höhe */
@media only screen and (max-width: 699px), (max-height: 699px) {
  #infoBtn, #zoomOutBtn, #zoomInBtn, #zoom-level, #zoom-level-div {
    display: none !important; /* visibility statt display */
  }
}

/* Sicherstellen, dass Fullscreen-Button exakt gleiche Größe wie andere Buttons hat */
.zoom-controls button {
  font-size: 1.25rem;
  padding: 0.125rem 0.5rem 0.25rem;
}

.zoom-controls {
    display: none; /* Standardmäßig ausgeblendet, JS aktiviert Sichtbarkeit im Desktop-Modus */
}

/* Panoramen-Notbremse: nur Desktop, nur wenn NICHT gezoomt */
@media (min-width: 901px) {

  /* Doppelseite: sehr breite Bilder auf halbe Viewportbreite begrenzen */
  #sliderScroll:not(.zoomed) .slide.spread.double .page-left-wrapper.is-pano img.page-img.is-pano,
  #sliderScroll:not(.zoomed) .slide.spread.double .page-right-wrapper.is-pano img.page-img.is-pano {
    height: auto !important;           /* schlägt die Inline-Höhe */
    width: auto !important;
    max-width: 50vw !important;
    max-height: calc(var(--vh) * 100) !important;
    object-fit: contain;
  }

  /* Einzelseite: sehr breite Bilder auf volle Viewportbreite */
  #sliderScroll:not(.zoomed) .slide.spread.single.is-pano img.page-img.is-pano {
    height: auto !important;
    width: auto !important;
    max-width: 100vw !important;
    max-height: calc(var(--vh) * 100) !important;
    object-fit: contain;
  }

  /* Wrapper dürfen die Bildgröße nicht mehr festnageln */
  #sliderScroll:not(.zoomed) .page-left-wrapper.is-pano,
  #sliderScroll:not(.zoomed) .page-right-wrapper.is-pano,
  #sliderScroll:not(.zoomed) .slide.spread.single.is-pano {
    width: auto !important;
    height: auto !important;
  }

  /* Optional: Overlay-Bilder passend mitschieben */
  #sliderScroll:not(.zoomed) .page-left-wrapper.is-pano img.overlay-img,
  #sliderScroll:not(.zoomed) .page-right-wrapper.is-pano img.overlay-img {
    height: auto !important;
    width: auto !important;
    max-width: 50vw !important;
    max-height: calc(var(--vh) * 100) !important;
    object-fit: contain;
  }
}

@media (min-width: 901px) {

  /* Single-Spread: Slide selbst bleibt vollflächig & zentriert */
  #sliderScroll:not(.zoomed) .slide.spread.single.is-pano {
    width: 100% !important;
    height: 100% !important;                    /* wichtig: NICHT auto */
    justify-content: center !important;
    align-items: center !important;
  }

  /* Double-Spread: Wrapper bleiben hochkant voll, damit Flex zentrieren kann */
  #sliderScroll:not(.zoomed) .page-left-wrapper.is-pano,
  #sliderScroll:not(.zoomed) .page-right-wrapper.is-pano {
    height: 100% !important;                    /* statt height:auto */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;                     /* Breite darf schrumpfen/expandieren */
  }

  /* Bildzentrierung + Begrenzung (Single) */
  #sliderScroll:not(.zoomed) .slide.spread.single.is-pano img.page-img.is-pano {
    height: auto !important;
    width: auto !important;
    max-width: 100vw !important;
    max-height: calc(var(--vh) * 100) !important;
    object-fit: contain;
    object-position: center center;             /* falls künftig feste Boxen greifen */
    display: block;
    margin: 0 auto;                             
  }

  /* Bildzentrierung + Begrenzung (Double) */
  #sliderScroll:not(.zoomed) .slide.spread.double .page-left-wrapper.is-pano img.page-img.is-pano,
  #sliderScroll:not(.zoomed) .slide.spread.double .page-right-wrapper.is-pano img.page-img.is-pano {
    height: auto !important;
    width: auto !important;
    max-width: 50vw !important;
    max-height: calc(var(--vh) * 100) !important;
    object-fit: contain;
    object-position: center center;
    display: block;
  }
}

@media (min-width: 901px) {
  .slide.spread.double { gap: 0 !important; }
  .page-left-wrapper, .page-right-wrapper {
    margin: 0 !important;
    min-width: 0 !important; /* verhindert min-content Clamp in Flex-Layouts */
  }
  .page-left-wrapper .page-img, .page-right-wrapper .page-img {
    display: block !important; /* kein Inline-Whitespace */
  }
}


/* === BEGIN: white placeholder behavior (no fixed px, CSS-driven scaling) === */
img.page-img[data-special-placeholder="1"] {
  object-fit: contain !important;
  display: block !important;
}
/* === END === */

