/* Durchblättern eines Buchs, Bühne zu blaettern.js (24.11.2026).
   Maße in cqw, also relativ zur Breite der Bühne. Werte, die von Format und Einband abhängen, setzt das Skript als Variablen.
   Vorbild sind Fotos echter Bücher: Gelenk und runder Rücken beim Hardcover, Rillung beim Softcover, Kanten des Buchblocks,
   weicher Schatten. Zurückhaltend gehalten, kein Glanz. */
.aihb{position:relative;width:100%}
.aihb-buehne{position:relative;width:100%;container-type:inline-size;touch-action:pan-y;-webkit-user-select:none;user-select:none}
.aihb-buch{position:absolute;perspective:240cqw}
.aihb-buch>*{position:absolute}

/* Deckel des Hardcovers, offen zu sehen als Kante rund um die Seiten. */
.aihb-deckel{top:0;height:100%;background-color:var(--aihb-farbe,#34332f);
 box-shadow:0 .1cqw .25cqw rgba(0,0,0,.26),0 1.4cqw 2.6cqw -1cqw rgba(0,0,0,.36),inset 0 0 0 .08cqw rgba(255,255,255,.07)}
.aihb-deckel.l{border-radius:.45cqw 0 0 .45cqw;background-image:linear-gradient(to left,rgba(0,0,0,.34),rgba(0,0,0,0) 1.4cqw)}
.aihb-deckel.r{border-radius:0 .45cqw .45cqw 0;background-image:linear-gradient(to right,rgba(0,0,0,.34),rgba(0,0,0,0) 1.4cqw)}

/* Seiten. Die Kanten des Buchblocks schauen außen leicht versetzt hervor. */
.aihb-seite{overflow:hidden;background-color:#fbfaf7}
.aihb-seite.l{box-shadow:-.1cqw .04cqw 0 #efebe3,-.2cqw .08cqw 0 #ddd7cb,-.3cqw .12cqw 0 #ebe6dd,-.4cqw .16cqw 0 #d4cdc0}
.aihb-seite.r{box-shadow:.1cqw .04cqw 0 #efebe3,.2cqw .08cqw 0 #ddd7cb,.3cqw .12cqw 0 #ebe6dd,.4cqw .16cqw 0 #d4cdc0}
.aihb-sc .aihb-seite.l{box-shadow:-.1cqw .04cqw 0 #efebe3,-.2cqw .08cqw 0 #ddd7cb,-.3cqw .12cqw 0 #ebe6dd,-.42cqw .17cqw 0 var(--aihb-farbe,#34332f),0 1.4cqw 2.6cqw -1cqw rgba(0,0,0,.36)}
.aihb-sc .aihb-seite.r{box-shadow:.1cqw .04cqw 0 #efebe3,.2cqw .08cqw 0 #ddd7cb,.3cqw .12cqw 0 #ebe6dd,.42cqw .17cqw 0 var(--aihb-farbe,#34332f),0 1.4cqw 2.6cqw -1cqw rgba(0,0,0,.36)}
.aihb-ohne .aihb-seite.l,.aihb-ohne .aihb-seite.r{box-shadow:none}

/* Inhalt einer Doppelseite, je Seite die passende Hälfte. */
.aihb-inhalt{position:absolute;top:0;height:100%;width:200%;background-size:100% 100%;background-repeat:no-repeat}
.aihb-seite.l>.aihb-inhalt{left:0}.aihb-seite.r>.aihb-inhalt{left:-100%}
.aihb-inhalt img{position:absolute;display:block;object-fit:cover}
.aihb-inhalt span{position:absolute;line-height:1.35;white-space:pre-wrap;overflow:hidden}

/* Wölbung am Bund: leichtes Licht, dann Schatten in die Falz. Beim Softcover tiefer, es liegt nicht flach. */
.aihb-bund,.aihb-wurf,.aihb-licht{position:absolute;inset:0;pointer-events:none}
.aihb-seite.l>.aihb-bund{background:linear-gradient(to right,rgba(0,0,0,.05),rgba(0,0,0,0) 2.5%,rgba(255,255,255,0) 80%,rgba(255,255,255,.07) 89%,rgba(0,0,0,.05) 94%,rgba(0,0,0,.15) 98.4%,rgba(0,0,0,.25))}
.aihb-seite.r>.aihb-bund{background:linear-gradient(to left,rgba(0,0,0,.05),rgba(0,0,0,0) 2.5%,rgba(255,255,255,0) 80%,rgba(255,255,255,.07) 89%,rgba(0,0,0,.05) 94%,rgba(0,0,0,.15) 98.4%,rgba(0,0,0,.25))}
.aihb-sc .aihb-seite.l>.aihb-bund{background:linear-gradient(to right,rgba(0,0,0,.06),rgba(0,0,0,0) 3%,rgba(255,255,255,0) 70%,rgba(255,255,255,.09) 84%,rgba(0,0,0,.08) 92%,rgba(0,0,0,.24) 97.5%,rgba(0,0,0,.38))}
.aihb-sc .aihb-seite.r>.aihb-bund{background:linear-gradient(to left,rgba(0,0,0,.06),rgba(0,0,0,0) 3%,rgba(255,255,255,0) 70%,rgba(255,255,255,.09) 84%,rgba(0,0,0,.08) 92%,rgba(0,0,0,.24) 97.5%,rgba(0,0,0,.38))}
.aihb-wurf{opacity:0}
.aihb-seite.l>.aihb-wurf{background:linear-gradient(to left,rgba(0,0,0,.2),rgba(0,0,0,0) 40%)}
.aihb-seite.r>.aihb-wurf{background:linear-gradient(to right,rgba(0,0,0,.2),rgba(0,0,0,0) 40%)}

/* Das Blatt, das gerade umschlägt. Vorderseite rechts, Rückseite landet links. */
.aihb-blatt{top:0;height:100%;transform-origin:0 50%;transform-style:preserve-3d}
.aihb-vorn,.aihb-hinten{position:absolute;inset:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}
/* Beide Seiten brauchen eine eigene 3D-Transformation, sonst zeigt WebKit die Rückseite gespiegelt über der Vorderseite. */
.aihb-vorn{transform:rotateY(0deg)}
.aihb-hinten{transform:rotateY(180deg)}
.aihb-vorn>*,.aihb-hinten>*{position:absolute}
.aihb-licht{opacity:0}
.aihb-vorn .aihb-licht{background:linear-gradient(to right,rgba(0,0,0,.4),rgba(0,0,0,.1) 45%,rgba(255,255,255,.04))}
.aihb-hinten .aihb-licht{background:linear-gradient(to left,rgba(0,0,0,.4),rgba(0,0,0,.1) 45%,rgba(255,255,255,.04))}
.aihb-innen{inset:0;background-color:var(--aihb-farbe,#34332f);border-radius:.45cqw 0 0 .45cqw}

/* Umschlag, geschlossen. Hardcover: runder Rücken, Gelenk als Rille, Überzug um die Pappkante. Softcover: flacher Rücken, Rillung. */
.aihb-umschlag{inset:0;overflow:hidden;background:var(--aihb-farbe,#34332f) center/cover no-repeat;
 box-shadow:0 .1cqw .25cqw rgba(0,0,0,.26),0 1.4cqw 2.6cqw -1cqw rgba(0,0,0,.36)}
.aihb-hc .aihb-umschlag{border-radius:0 .45cqw .45cqw 0}
.aihb-gelenk{position:absolute;inset:0;pointer-events:none}
.aihb-hc .aihb-gelenk{border-radius:inherit;
 background:linear-gradient(to right,rgba(0,0,0,.34),rgba(0,0,0,.1) .5cqw,rgba(255,255,255,.1) .95cqw,rgba(255,255,255,0) 1.35cqw,rgba(0,0,0,.26) 1.8cqw,rgba(0,0,0,.06) 2cqw,rgba(255,255,255,.2) 2.15cqw,rgba(255,255,255,0) 2.7cqw),
  linear-gradient(100deg,rgba(255,255,255,.07),rgba(255,255,255,0) 45%);
 box-shadow:inset 0 0 0 .08cqw rgba(0,0,0,.2),inset -.14cqw 0 .12cqw rgba(255,255,255,.13),inset 0 .12cqw .1cqw rgba(255,255,255,.08)}
.aihb-sc .aihb-gelenk{
 background:linear-gradient(to right,rgba(0,0,0,.24),rgba(0,0,0,0) .45cqw,rgba(0,0,0,0) 1.1cqw,rgba(0,0,0,.12) 1.25cqw,rgba(255,255,255,.14) 1.36cqw,rgba(255,255,255,0) 1.7cqw),
  linear-gradient(100deg,rgba(255,255,255,.05),rgba(255,255,255,0) 45%);
 box-shadow:inset 0 0 0 .06cqw rgba(0,0,0,.16)}
.aihb-titel{position:absolute;left:9%;right:9%;bottom:8%;color:#fff;font-size:2.1cqw;line-height:1.15;text-shadow:0 .1cqw .8cqw rgba(0,0,0,.35)}

/* Steuerung: Pfeile und eine Leiste mit den Doppelseiten. */
/* Klickbar sichtbar machen (Produktseite, Variante A, Henning 24.11.2026): Hand über dem Buch. Auf dem Handy statt aller Marken ein Zähler. */
.aihb-buehne[role=group]{cursor:pointer}
/* Steuerung, Variante A (24.11.2026): eckige Knöpfe am Buch, beim Darüberfahren dunkel. Auf dem Handy liegen sie innen am Rand. */
.aihb-pfeil{position:absolute;top:50%;z-index:6;width:44px;height:44px;margin-top:-22px;display:grid;place-items:center;padding:0;font:inherit;font-size:18px;line-height:1;color:var(--schrift);background:var(--flaeche);border:1px solid rgba(27,29,31,.12);border-radius:0;box-shadow:0 4px 14px rgba(0,0,0,.14);cursor:pointer;opacity:.9;transition:opacity .2s,background .2s,color .2s}
.aihb-pfeil-l{left:0}.aihb-pfeil-r{right:0}
.aihb-buehne:hover .aihb-pfeil:not(:disabled){opacity:1}
.aihb-pfeil:focus-visible{background:var(--schrift);color:var(--flaeche)}
@media(hover:hover){.aihb-pfeil:hover{background:var(--schrift);color:var(--flaeche)}}
.aihb-pfeil:disabled{opacity:0;pointer-events:none}
@media(max-width:600px){.aihb-pfeil{width:38px;height:38px;margin-top:-19px;font-size:16px}.aihb-pfeil-l{left:4px}.aihb-pfeil-r{right:4px}}
/* Leiste Variante A (Henning, 28.11.2026). Grundfall ist der Filmstreifen für Finger: gleich hohe Vorschauen, die Mitte rastet ein.
   Feste Höhen und feste Breiten (blaettern.js), weil Safari height:100% im Knopf nicht auflöst und den Knopf sonst so breit macht
   wie das Bild. Am Rechner steht alles in einer Zeile, die Höhe --passt rechnet blaettern.js aus der Breite. */
.aihb-leiste{margin-top:18px}
.aihb-streifen{--hoehe:44px;display:flex;align-items:center;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;padding:12px 0;-webkit-overflow-scrolling:touch}
.aihb-streifen::-webkit-scrollbar{display:none}
/* Abstandhalter, damit auch die erste und die letzte Vorschau in die Mitte kommen. */
.aihb-streifen::before,.aihb-streifen::after{content:"";flex:none;width:50%}
.aihb-vorschau{flex:none;display:block;position:relative;height:var(--hoehe);padding:0;margin:0;border:0;border-radius:0;background:none;-webkit-appearance:none;appearance:none;cursor:pointer;scroll-snap-align:center}
.aihb-vorschau:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.aihb-mini{position:relative;display:block;height:var(--hoehe);overflow:hidden;background:var(--flaeche);box-shadow:0 1px 3px rgba(0,0,0,.14);transition:transform .18s ease-out}
.aihb-mini>img{display:block;height:100%;width:100%;object-fit:cover;pointer-events:none}
/* Filmstreifen: die Mitte groß, nur über transform, damit beim Wischen nichts im Layout springt. */
.aihb-mitte{z-index:1}.aihb-mitte .aihb-mini{transform:scale(1.36);box-shadow:0 0 0 4px var(--flaeche),0 2px 8px rgba(0,0,0,.22)}
/* Rechner: alle Doppelseiten in einer Zeile, ohne Schieben. Die aktive trägt den Rahmen. */
@media(hover:hover) and (min-width:761px){
.aihb-streifen{--hoehe:var(--passt,60px);gap:8px;justify-content:center;overflow:visible;scroll-snap-type:none;padding:6px 0}
.aihb-streifen::before,.aihb-streifen::after{content:none}
.aihb-mitte .aihb-mini{transform:none;box-shadow:0 1px 3px rgba(0,0,0,.14)}
.aihb-vorschau[aria-current="true"] .aihb-mini::after{content:"";position:absolute;inset:0;border:2px solid var(--schrift);pointer-events:none}
.aihb-vorschau:hover .aihb-mini{box-shadow:0 1px 3px rgba(0,0,0,.14),0 0 0 1px var(--schrift)}
}
@media(prefers-reduced-motion:reduce){.aihb-mini{transition:none}}
@media(prefers-reduced-motion:reduce){.aihb-pfeil{transition:none}}
