/*
 * 1.50.0 – Galerien als Erlebnis (Story-Innenseite)
 * Zwei Blockstile für core/gallery, Verhalten in js/stories/galerie.js:
 *   is-style-sm-mosaik   Abend-Mosaik: gemischtes Raster (groß, breit, hoch), Fotos gleiten beim Scrollen herein,
 *                        antippen = Vollbild mit Wischen, Filmstreifen und „Neu mischen“
 *   is-style-sm-stapel   Fotobox-Stapel: Abzüge liegen schräg übereinander, oberster lässt sich wegschnippen,
 *                        „Alle zeigen“ legt alle auf den Tisch
 * Ohne Script: ein ruhiges Raster, alle Fotos sichtbar. Namensraum sg-.
 * Nur transform/opacity werden animiert (Compositor), Bewegung entfällt bei „Bewegung reduzieren“.
 */

/* ---------- gemeinsamer Rahmen ---------- */
.sm-i-galerie:has(.is-style-sm-mosaik), .sm-i-galerie:has(.is-style-sm-stapel) { max-width: none !important; }
.wp-block-gallery:is(.is-style-sm-mosaik, .is-style-sm-stapel) { margin: 0; gap: 0 !important; }
.wp-block-gallery.is-style-sm-stapel figure { margin: 0 !important; width: auto !important; }
.sg-zahl { font: 600 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: .7; font-variant-numeric: tabular-nums; }
.sg-knopf { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: 600 14px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform .16s var(--ease-out), background-color .2s ease, color .2s ease; }
.sg-knopf:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .sg-knopf:hover { background: rgba(127, 127, 127, .2); } }
.sg-knopf svg { width: 16px; height: 16px; flex: none; }
.sg-knopf:focus-visible, .sg-kachel:focus-visible, .sg-abzug:focus-visible { outline: 3px solid var(--g); outline-offset: 3px; }

/* ---------- 1 · Abend-Mosaik: Bildstrecke wie im Heft ----------
   Keine Reihen: zehn „Doppelseiten-Figuren“ wiederholen sich (sg-p1 … sg-p10) – große Fotos laufen an den Bildschirmrand,
   Details schweben klein und versetzt, Ausschnitte werden bewusst angeschnitten. Die Reihenfolge der Galerie in WordPress
   ist die Dramaturgie (Kapitel des Abends); die Figur ergibt sich aus der Position. Raster: Rand | 12 Spalten | Rand.
   Handy: Rand | 6 Spalten | Rand. Versatz in vw, damit er mit der Breite mitwächst. */
.sm-i-galerie:has(.is-style-sm-mosaik) { width: calc(100vw - var(--scrollbar-width, 0px)); margin-left: calc(50% - (100vw - var(--scrollbar-width, 0px)) / 2) !important; }
.wp-block-gallery.is-style-sm-mosaik { --sg-rand: 16px; display: grid !important; grid-template-columns: var(--sg-rand) repeat(6, minmax(0, 1fr)) var(--sg-rand); column-gap: 10px !important; row-gap: 0 !important; align-items: start; }
.wp-block-gallery.has-nested-images.is-style-sm-mosaik figure.wp-block-image:not(#individual-image) { width: auto !important; margin-left: 0 !important; margin-right: 0 !important; margin-bottom: 0 !important; }
.wp-block-gallery.is-style-sm-mosaik > figure { position: relative; overflow: hidden; background: rgba(127, 127, 127, .14); grid-column: 2 / 8; aspect-ratio: 3 / 2; margin-top: 6vw !important; }
.is-style-sm-mosaik > figure img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
/* Handy */
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p1 { grid-column: 1 / 9; aspect-ratio: 4 / 3; margin-top: 0 !important; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p2 { grid-column: 2 / 6; aspect-ratio: 4 / 5; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p3 { grid-column: 6 / 9; aspect-ratio: 1; margin-top: 22vw !important; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p4 { grid-column: 1 / 7; aspect-ratio: 4 / 3; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p5 { grid-column: 1 / 9; aspect-ratio: 16 / 9; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p6 { grid-column: 2 / 5; aspect-ratio: 4 / 5; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p7 { grid-column: 5 / 9; aspect-ratio: 3 / 4; margin-top: 16vw !important; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p8 { grid-column: 3 / 9; aspect-ratio: 3 / 2; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p9 { grid-column: 2 / 6; aspect-ratio: 1; }
.wp-block-gallery.is-style-sm-mosaik > figure.sg-p10 { grid-column: 1 / 9; aspect-ratio: 3 / 2; }
@media (min-width: 768px) {
	.wp-block-gallery.is-style-sm-mosaik { --sg-rand: max(24px, var(--rand, 48px) - 16px); grid-template-columns: var(--sg-rand) repeat(12, minmax(0, 1fr)) var(--sg-rand); column-gap: 16px !important; }
	.wp-block-gallery.is-style-sm-mosaik > figure { grid-column: 2 / 14; margin-top: 3vw !important; }
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p1 { grid-column: 1 / 10; aspect-ratio: 3 / 2; margin-top: 0 !important; } /* groß, läuft links hinaus */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p2 { grid-column: 11 / 15; aspect-ratio: 4 / 5; margin-top: 7vw !important; } /* klein, tiefer gesetzt */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p3 { grid-column: 2 / 7; aspect-ratio: 1; margin-top: 2vw !important; } /* Detail */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p4 { grid-column: 8 / 15; aspect-ratio: 4 / 3; margin-top: 6vw !important; } /* läuft rechts hinaus */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p5 { grid-column: 4 / 13; aspect-ratio: 21 / 9; } /* schmales Panorama */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p6 { grid-column: 2 / 6; aspect-ratio: 4 / 5; }
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p7 { grid-column: 7 / 15; aspect-ratio: 3 / 2; margin-top: 6vw !important; } /* groß rechts */
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p8 { grid-column: 3 / 9; aspect-ratio: 3 / 2; margin-top: 3vw !important; }
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p9 { grid-column: 10 / 14; aspect-ratio: 1; margin-top: 7vw !important; }
	.wp-block-gallery.is-style-sm-mosaik > figure.sg-p10 { grid-column: 1 / 15; aspect-ratio: 16 / 7; margin-top: 4vw !important; } /* randlos über die ganze Breite */
}
@media (max-height: 520px) and (orientation: landscape) { .wp-block-gallery.is-style-sm-mosaik > figure { max-height: 85svh; } } /* Handy quer / Zoom: nie höher als der Bildschirm */
@media (min-width: 1600px) { .wp-block-gallery.is-style-sm-mosaik > figure { margin-top: 80px !important; } .wp-block-gallery.is-style-sm-mosaik > figure.sg-p1 { margin-top: 0 !important; } }
.sg-kachel { cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) { .sg-kachel.sg-da:hover img { transform: scale(1.035); transition: transform .9s var(--ease-out); } }
/* Aufdecken beim Scrollen (nur mit Script): Vorhang von unten, das Foto kommt dabei zur Ruhe */
.sm-js .sg-an .sg-kachel:not(.sg-da) { background: transparent; }
/* 1.57.0: ab der Leselinie (jhSmAuf), hinein ruhig und gestaffelt (--sm-stufe), beim Zurückscrollen zügig wieder zu */
.sm-js .sg-an .sg-kachel img { clip-path: inset(100% 0 0 0); transform: scale(1.14); transition: clip-path .45s var(--ease-out), transform .6s var(--ease-out); } /* Vorhang am Bild, nicht am Rahmen: sonst sieht die Sichtbarkeits-Prüfung den Rahmen nie */
.sm-js .sg-an .sg-kachel.sg-da img { clip-path: inset(0 0 0 0); transform: scale(1); transition: clip-path 1.1s var(--ease-out) calc(var(--sm-stufe, 0) * 100ms), transform 1.6s var(--ease-out) calc(var(--sm-stufe, 0) * 100ms); }
/* kleine Figuren nicht mit Vorhang, sondern weich eingeblendet – damit 59 Aufdeckungen nicht gleich wirken */
.sm-js .sg-an :is(.sg-p2, .sg-p3, .sg-p6, .sg-p9).sg-kachel img { clip-path: none; opacity: 0; transform: scale(1.04); transition: opacity .45s var(--ease-out), transform .6s var(--ease-out); }
.sm-js .sg-an :is(.sg-p2, .sg-p3, .sg-p6, .sg-p9).sg-kachel.sg-da img { opacity: 1; transform: scale(1); transition: opacity 1.1s var(--ease-out) calc(var(--sm-stufe, 0) * 100ms), transform 1.4s var(--ease-out) calc(var(--sm-stufe, 0) * 100ms); }

/* ---------- 2 · Fotobox-Stapel ---------- */
.sg-tisch { position: relative; }
.wp-block-gallery.is-style-sm-stapel { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 14px !important; }
.is-style-sm-stapel > figure img { width: 100% !important; height: auto !important; display: block; }
.sg-abzug { position: relative; background: #fff; padding: 0; border-radius: 2px; cursor: zoom-in;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 3px 6px rgba(0, 0, 0, .14), 0 12px 24px -6px rgba(0, 0, 0, .28); /* wie ein Abzug auf dem Tisch: kurzer Kontaktschatten + weicher Schlagschatten */
	-webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sg-abzug img { pointer-events: none; -webkit-user-drag: none; }

/* Stapel-Ansicht */
.sg-tisch.sg-stapelt .wp-block-gallery.is-style-sm-stapel { display: block !important; position: relative; width: min(calc(100% - 36px), 560px); aspect-ratio: 3 / 2.15; margin: 8px auto 0; touch-action: pan-y; }
.wp-block-gallery.has-nested-images.is-style-sm-stapel figure.sg-abzug { flex-grow: 0; } /* gegen die Galerie-Regeln von WordPress */
.sg-tisch.sg-stapelt .wp-block-gallery figure.sg-abzug.wp-block-image { position: absolute !important; inset: 0; display: block; width: 100% !important; transform: translate(var(--sg-x, 0px), var(--sg-y, 0px)) rotate(var(--sg-dreh, 0deg)); transition: transform .45s var(--ease-out), opacity .3s ease; will-change: transform; }
.sg-tisch.sg-stapelt .sg-abzug:not(.sg-sicht) { opacity: 0; pointer-events: none; }
.sg-tisch.sg-stapelt .sg-abzug.sg-oben { cursor: grab; }
.sg-tisch.sg-stapelt .sg-abzug.sg-zieht { transition: none; cursor: grabbing; }
.sg-steuer { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 0; }
.sg-rund { width: 52px; height: 52px; padding: 0; justify-content: center; }
.sg-rund svg { width: 20px; height: 20px; }
.sg-tipp { margin: 14px 0 0; text-align: center; font: 400 14px/1.4 var(--sans); opacity: .7; }
/* Fallen auf den Tisch, wenn der Stapel die Leselinie erreicht; beim Zurückscrollen heben sich die Abzüge wieder ab (1.57.0, galerie.js) */.sm-js .sg-tisch.sg-stapelt:not(.sg-gelandet) .sg-abzug.sg-sicht { opacity: 0; transform: translate(var(--sg-x, 0px), calc(var(--sg-y, 0px) - 60px)) rotate(calc(var(--sg-dreh, 0deg) * 3)) scale(1.06); }

/* Wand-Ansicht: alle Abzüge auf dem Tisch */
.sg-tisch.sg-wand .wp-block-gallery.is-style-sm-stapel { grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 3vw, 34px) !important; padding: 8px 4px; }
.sg-tisch.sg-wand .sg-abzug { transform: rotate(var(--sg-dreh, 0deg)); transition: transform .5s var(--ease-out), opacity .4s ease; transition-delay: var(--sg-v, 0ms); }
.sg-tisch.sg-wand.sg-legt .sg-abzug { opacity: 0; transform: translateY(-40px) rotate(calc(var(--sg-dreh, 0deg) * 3)) scale(1.05); transition: none; }
@media (hover: hover) and (pointer: fine) { .sg-tisch.sg-wand .sg-abzug:hover { transform: rotate(0deg) scale(1.04); z-index: 2; transition-delay: 0ms; } }
@media (min-width: 768px) { .sg-tisch.sg-wand .wp-block-gallery.is-style-sm-stapel { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .sg-tisch.sg-wand .wp-block-gallery.is-style-sm-stapel { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .sg-tisch.sg-stapelt .wp-block-gallery.is-style-sm-stapel { width: min(100%, 640px); } }

/* ---------- Vollbild ---------- */
.sg-vb, .sg-vb *, .sg-fb, .sg-fb *, .sg-tisch, .sg-tisch * { box-sizing: border-box; } /* das Theme setzt das nicht global */
.sg-vb, .sg-fb { /* liegen außerhalb der Story (direkt im body): Schriften und Kurven hier selbst festlegen */
	--serif: new-spirit-condensed, "Instrument Serif", Georgia, serif;
	--sans: acumin-pro-condensed, "Roboto Condensed", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--ease-out: cubic-bezier(.23, 1, .32, 1); --ease-io: cubic-bezier(.77, 0, .175, 1); --g: var(--jh-accent, #b0c7a6);
	font-family: var(--sans); -webkit-font-smoothing: antialiased;
}
.sg-vb { position: fixed; inset: 0; z-index: 100000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; overscroll-behavior: contain; touch-action: none; }
.sg-vb[hidden] { display: none; }
.sg-vb-grund { position: absolute; inset: 0; background: #0b0b0b; opacity: 0; transition: opacity .35s ease; }
.sg-vb.sg-offen .sg-vb-grund { opacity: 1; }
.sg-vb-kopf { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); opacity: 0; transition: opacity .3s ease .1s; }
.sg-vb.sg-offen .sg-vb-kopf, .sg-vb.sg-offen .sg-vb-film { opacity: 1; }
.sg-vb-zahl { font: 600 14px/1 var(--sans); letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .85; }
.sg-vb-zu, .sg-vb-pfeil { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; touch-action: manipulation; transition: background-color .2s ease, transform .16s var(--ease-out); }
.sg-vb-zu:active, .sg-vb-pfeil:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .sg-vb-zu:hover, .sg-vb-pfeil:hover { background: rgba(255, 255, 255, .24); } }
.sg-vb-zu svg, .sg-vb-pfeil svg { width: 22px; height: 22px; }
.sg-vb-zu:focus-visible, .sg-vb-pfeil:focus-visible, .sg-vb-film button:focus-visible { outline: 3px solid var(--g, #b0c7a6); outline-offset: 2px; }
.sg-vb-buehne { position: relative; overflow: hidden; }
.sg-vb-bahn { position: absolute; inset: 0; display: flex; will-change: transform; }
.sg-vb-bahn.sg-gleitet { transition: transform .38s var(--ease-out); }
.sg-vb-seite { flex: 0 0 100%; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
.sg-vb-seite img { display: block; min-width: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; -webkit-user-drag: none; user-select: none; border-radius: 2px; }
.sg-vb-seite img { transition: transform .35s var(--ease-out); cursor: zoom-in; touch-action: none; }
.sg-vb-seite img.sg-zoom { cursor: grab; position: relative; z-index: 2; }
.sg-vb-seite.sg-abzug-seite img { box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .7); }
.sg-vb-pfeil { position: absolute; top: 50%; margin-top: -24px; display: none; }
.sg-vb-pfeil.sg-l { left: 18px; } .sg-vb-pfeil.sg-r { right: 18px; }
@media (hover: hover) and (pointer: fine) { .sg-vb-pfeil { display: grid; } }
.sg-vb-pfeil:disabled { opacity: 0; pointer-events: none; }
.sg-vb-film { position: relative; display: flex; gap: 6px; overflow-x: auto; padding: 10px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)); scrollbar-width: none; opacity: 0; transition: opacity .3s ease .1s; scroll-behavior: smooth; overscroll-behavior-x: contain; touch-action: pan-x; }
.sg-vb-film::-webkit-scrollbar { display: none; }
.sg-vb-film button { flex: 0 0 auto; width: 60px; height: 44px; padding: 0; border: 0; border-radius: 3px; overflow: hidden; background: #222; opacity: .45; cursor: pointer; transition: opacity .2s ease, transform .2s var(--ease-out); }
.sg-vb-film button[aria-current="true"] { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 2px #fff; }
.sg-vb-film img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-height: 520px) { .sg-vb-film { display: none; } .sg-vb { grid-template-rows: auto minmax(0, 1fr); } }
.sg-flug { position: fixed; z-index: 100001; margin: 0; object-fit: cover; pointer-events: none; border-radius: 3px; will-change: transform; transform-origin: 0 0; }
html.sg-vb-auf { overflow: hidden; } /* nur html: so bleibt die Story an ihrer Stelle stehen */

/* ---------- 4 · Fotobox-Kabine (Versteck in der Story) ---------- */
.sg-kabine { display: block; width: clamp(78px, 9vw, 120px); margin: 8px 0 26px; padding: 6px; border: 0; background: none; color: inherit; cursor: pointer; transform: rotate(var(--sg-dreh, 0deg)); transition: transform .4s var(--ease-out); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sg-kabine.sg-links { margin-left: max(4%, var(--rand, 16px)); }
.sg-kabine.sg-rechts { margin-left: auto; margin-right: max(6%, var(--rand, 16px)); }
.sg-kabine svg { display: block; width: 100%; height: auto; overflow: visible; }
.sg-k-linie { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sg-k-schild { font: 700 9px/1 var(--sans); letter-spacing: .14em; fill: currentColor; }
.sg-k-blitz { fill: var(--g, #b0c7a6); opacity: .9; }
.sg-k-abzug rect { fill: #fff; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sg-k-abzug path { fill: var(--g, #b0c7a6); }
.sg-kabine .sg-k-abzug { transform: translateY(-14px); transition: transform .45s var(--ease-out); }
.sg-k-vorhang { transform-origin: 80px 34px; transition: transform .6s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
	.sg-kabine:hover { transform: rotate(0deg) scale(1.06); }
	.sg-kabine:hover .sg-k-abzug { transform: translateY(0); }
	.sg-kabine:hover .sg-k-vorhang { transform: skewX(-4deg); }
}
.sg-kabine:active { transform: scale(.96); }
.sg-kabine:focus-visible { outline: 3px solid var(--g); outline-offset: 4px; border-radius: 6px; }
.sg-k-licht { fill: #fff; opacity: 0; }
.sg-kabine.sg-blitzt .sg-k-licht { animation: sg-lock 1.1s ease-out; } /* nur Deckkraft: weiße Kopie über dem Blitz */
@keyframes sg-lock { 0%, 100% { opacity: 0; } 12% { opacity: 1; } 30% { opacity: 0; } }
@media (min-width: 1200px) { .sg-kabine { margin-top: -10px; margin-bottom: 10px; } }

/* Fotobox-Fenster */
.sg-fb { position: fixed; inset: 0; z-index: 99990; display: grid; grid-template-rows: auto minmax(0, 1fr); color: #fff; overscroll-behavior: contain; }
.sg-fb[hidden] { display: none; }
.sg-fb-grund { position: absolute; inset: 0; background: #121212; opacity: 0; transition: opacity .3s ease; }
.sg-fb.sg-offen .sg-fb-grund { opacity: 1; }
.sg-fb-blitz { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sg-fb.sg-blitzt .sg-fb-blitz { animation: sg-blitz .55s ease-out; }
.sg-fb-zaehler { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; font: 300 clamp(120px, 34vw, 280px)/1 var(--serif); color: #fff; text-shadow: 0 8px 40px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; }
.sg-tisch.sg-wartet .sg-steuer, .sg-tisch.sg-wartet .sg-tipp { opacity: 0; } /* während des Countdowns nur die Zahl */
.sg-steuer, .sg-tipp { transition: opacity .3s ease; }
@keyframes sg-blitz { 0% { opacity: 0; } 10% { opacity: .92; } 100% { opacity: 0; } }
.sg-fb-kopf { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left)); opacity: 0; transition: opacity .3s ease .15s; }
.sg-fb.sg-offen .sg-fb-kopf, .sg-fb.sg-offen .sg-fb-inhalt { opacity: 1; }
.sg-fb-titel { font: 300 clamp(22px, 4.6vw, 40px)/1.05 var(--serif); text-wrap: balance; }
.sg-fb-inhalt { position: relative; overflow: auto; overscroll-behavior: contain; padding: 4px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); opacity: 0; transition: opacity .25s ease; }
.sg-fb-kabine { width: 64px; margin: 0 auto -6px; position: relative; z-index: 0; }
.sg-fb-kabine svg { width: 100%; height: auto; display: block; }
.sg-fb-kabine .sg-k-abzug { display: none; }
.sg-fb .sg-tisch { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; }
.sg-fb .sg-tisch.sg-wand .sg-steuer { position: sticky; bottom: 0; z-index: 5; margin: 0; padding: 22px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, #121212 40%); } /* „Als Stapel“ immer erreichbar */
.sg-fb .sg-tisch.sg-wand .sg-tipp { display: none; }
.sg-fb .sg-tisch.sg-stapelt .wp-block-gallery.is-style-sm-stapel { width: min(calc(100% - 36px), clamp(560px, 38vw, 820px), max(240px, calc((100svh - 300px) * 1.4))); } /* Platz für die schrägen Ecken; nie kleiner als 240 px */
@media (max-height: 520px) and (orientation: landscape) { /* Handy quer: Stapel links, Knöpfe rechts daneben, Kabine weg */
	.sg-fb-kabine { display: none; }
	.sg-fb .sg-tisch.sg-stapelt { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 28px; }
	.sg-fb .sg-tisch.sg-stapelt .wp-block-gallery.is-style-sm-stapel { width: min(56vw, calc((100svh - 90px) * 1.4)); margin: 4px 0 0 8px; grid-row: 1 / 3; }
	.sg-fb .sg-tisch.sg-stapelt .sg-steuer { flex-wrap: wrap; margin: 0; }
}
/* Abzüge kommen aus dem Schlitz der Kabine (oben) und gleiten auf den Stapel */
.sm-js .sg-fb .sg-tisch.sg-stapelt:not(.sg-gelandet) .sg-abzug.sg-sicht { opacity: 0; transform: translate(0, -48%) rotate(0deg) scale(.14); }
.sg-fb .sg-tisch.sg-stapelt .sg-abzug { transition: transform .62s var(--ease-out), opacity .35s ease; }

@media (prefers-reduced-motion: reduce) {
	.sg-fb .sg-tisch.sg-stapelt .sg-abzug.sg-sicht:not(.sg-zieht) { opacity: 1 !important; transform: translate(var(--sg-x, 0px), var(--sg-y, 0px)) rotate(var(--sg-dreh, 0deg)) !important; }
	.sg-kabine, .sg-kabine *, .sg-fb-grund { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
	.sm-js .sg-an .sg-kachel img { clip-path: none !important; transform: none !important; }
	.sm-js .sg-tisch.sg-stapelt:not(.sg-gelandet) .sg-abzug.sg-sicht, .sg-tisch.sg-wand.sg-legt .sg-abzug { opacity: 1 !important; transform: rotate(var(--sg-dreh, 0deg)) !important; }
	.sg-kachel, .sg-abzug, .sg-vb-bahn.sg-gleitet, .sg-vb-grund, .is-style-sm-mosaik > figure img { transition: none !important; }
}
@media print {
	.sg-steuer, .sg-tipp, .sg-vb { display: none !important; }
	.sg-kachel, .sg-abzug { opacity: 1 !important; transform: none !important; }
	.sg-kachel img { clip-path: none !important; transform: none !important; } /* beim Drucken alle Fotos aufgedeckt */
}
.is-style-sm-mosaik > figure[hidden] { display: none !important; } /* zeigt die Story schon über dem Text (data-sg-foto) */
