/* Galerie „This is AI“ als Rundgang (Services/AiGalerie.php, frontend/js/ai-galerie.js).
   Maßstab: Die Wand ist 250 cm hoch und nimmt 82 % der Saalhöhe ein, --cm ist die Länge eines Zentimeters. */
.fsag { --hoch: clamp(430px, 62vh, 700px); --wandcm: 250; --cm: calc(var(--hoch) * 0.8 / var(--wandcm)); color: #1f2328; margin: 0 0 2.5rem; max-width: 100%; }
.fsag *, .fsag *::before, .fsag *::after { box-sizing: border-box; }

/* Saalwahl */
.fsag-saele { position: sticky; top: 3.6rem; z-index: 6; margin: 0 0 .6rem; background: rgba(250, 250, 249, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: .6rem; }
.fsag-saele ul { list-style: none; margin: 0; padding: .35rem .25rem; display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.fsag-saele ul::-webkit-scrollbar { display: none; }
.fsag-saele li { flex: 0 0 auto; scroll-snap-align: center; }
.fsag-saele a, .fsag-auswahl { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .8rem 0 .35rem; border-radius: 999px;
  border: 1px solid #d9dce1; background: #fff; color: #1f2328 !important; font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none !important;
  white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s, border-color .15s, transform .12s ease; }
.fsag-saele a span { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #eceef1; font-size: .72rem; font-weight: 700; }
.fsag-saele a:active, .fsag-auswahl:active { transform: scale(.96); }
.fsag-saele a[aria-current="true"] { background: #1f2328; border-color: #1f2328; color: #fff !important; }
.fsag-saele a[aria-current="true"] span { background: rgba(255, 255, 255, .22); color: #fff; }
.fsag-auswahl { padding: 0 .8rem; border-color: #b71818; color: #b71818 !important; }
.fsag-auswahl span { font-variant-numeric: tabular-nums; }
.fsag-auswahl[hidden] { display: none; }

/* Saal: Wand, Licht, Sockelleiste, Boden */
.fsag-saal { position: relative; height: var(--hoch); margin: 0 0 1.25rem; border-radius: .9rem; overflow: hidden; background: var(--wand, #3d4f47);
  --schrift: #f4f1ea; --leise: rgba(244, 241, 234, .72); isolation: isolate; }
.fsag-saal.fsag-hell { --schrift: #23262b; --leise: rgba(35, 38, 43, .66); }
.fsag-saal::before { content: ""; position: absolute; inset: 0 0 20% 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, .16)),
    linear-gradient(180deg, transparent calc(8% - 1px), rgba(255, 255, 255, .22) calc(8% - 1px), rgba(255, 255, 255, .22) 8%, transparent 8%); }
.fsag-aktiv .fsag-saal:not(.fsag-da) { display: none; }
.fsag-wand { position: absolute; inset: 0 0 20% 0; z-index: 1; display: flex; align-items: flex-start; gap: calc(62 * var(--cm));
  padding: 0 calc(70 * var(--cm)) 0 calc(34 * var(--cm)); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; outline: none; }
.fsag-wand::-webkit-scrollbar { display: none; }
.fsag-wand.fsag-zieht { cursor: grabbing; scroll-snap-type: none; }
.fsag-wand:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6); }
.fsag-boden { position: absolute; left: 0; right: 0; bottom: 0; height: 20%; z-index: 2; pointer-events: none; overflow: hidden; perspective: 260px;
  perspective-origin: 50% 0; background: #7d5f3f; border-top: calc(8 * var(--cm)) solid #efe9dd; box-shadow: 0 -1px 0 rgba(0, 0, 0, .3); }
/* Dielen laufen auf den Betrachter zu: gekippte Fläche, Fugen gehen nach vorn auseinander */
.fsag-boden::before { content: ""; position: absolute; left: -75%; right: -75%; top: 0; height: 420%; transform-origin: 50% 0; transform: rotateX(68deg);
  background: repeating-linear-gradient(90deg, rgba(40, 24, 10, .34) 0 2px, rgba(255, 255, 255, .05) 2px 4px, transparent 4px 46px),
    repeating-linear-gradient(0deg, rgba(40, 24, 10, .16) 0 2px, transparent 2px 190px),
    linear-gradient(180deg, #a98359, #c09a6c 55%, #cfab7d); }
/* Schatten der Wand am Boden und Glanz vom Licht */
.fsag-boden::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, 0) 60%),
    radial-gradient(60% 120% at 50% 100%, rgba(255, 244, 222, .2), rgba(255, 244, 222, 0)); }
@keyframes fsag-rein { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
.fsag-saal.fsag-eintritt .fsag-wand { animation: fsag-rein .5s cubic-bezier(.2, .7, .2, 1); }

/* Saalschrift an der Wand */
.fsag-eingang { flex: 0 0 auto; align-self: center; width: min(47vw, 19rem); color: var(--schrift); scroll-snap-align: start; padding-right: .5rem; }
.fsag-saalnr { margin: 0 0 .35rem; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--leise); }
.fsag-eingang h2 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 6.4vw, 2.9rem); overflow-wrap: anywhere; line-height: 1.05; color: var(--schrift); letter-spacing: -.01em; }
.fsag-saalinfo { margin: 0; font-size: .88rem; color: var(--leise); }

/* Bild an der Wand: Mitte auf 145 cm über dem Boden, Lichtkegel, Schild darunter */
.fsag-bild { position: relative; flex: 0 0 auto; margin: calc((var(--wandcm) - 145 - var(--h) / 2) * var(--cm)) 0 0; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; width: calc(var(--b) * var(--cm)); }
.fsag-bild::before { content: ""; position: absolute; z-index: 0; left: 50%; top: calc(var(--h) * var(--cm) / 2); width: 210%; height: calc(var(--h) * var(--cm) * 2.1);
  transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0)); pointer-events: none; }
.fsag-haengung { position: relative; z-index: 1; display: block; width: 100%; height: calc(var(--h) * var(--cm)); padding: 0; border: 0; background: #ddd;
  cursor: pointer; border-radius: 1px; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 calc(5 * var(--cm)) calc(13 * var(--cm)) rgba(0, 0, 0, .46), calc(1.2 * var(--cm)) calc(1.6 * var(--cm)) 0 rgba(0, 0, 0, .28);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s; }
.fsag-haengung img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.fsag-haengung:active { transform: scale(.975); }
.fsag-haengung:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.fsag-schild { position: relative; z-index: 1; margin: calc(8 * var(--cm)) 0 0; padding: .22rem .5rem .26rem; max-width: 118%; background: #f6f3ec; color: #23262b;
  border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .45); text-align: center; line-height: 1.2; }
.fsag-schild strong { display: block; font-size: .7rem; font-weight: 700; }
.fsag-schild span { display: block; font-size: .6rem; color: #6a6f77; letter-spacing: .04em; }
.fsag-bild.fsag-gemerkt .fsag-schild::after { content: "♥"; position: absolute; right: -.45rem; top: -.5rem; display: grid; place-items: center; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: #b71818; color: #fff; font-size: .62rem; }

/* Bank (160 cm) zum Größenvergleich */
.fsag-bank { flex: 0 0 auto; align-self: flex-end; width: calc(160 * var(--cm)); height: calc(46 * var(--cm)); margin: 0 calc(-20 * var(--cm));
  background: linear-gradient(#4a3828, #4a3828) left 0 top 0 / 100% 20% no-repeat,
    linear-gradient(#3a2c20, #3a2c20) left 8% top 20% / 5% 80% no-repeat, linear-gradient(#3a2c20, #3a2c20) right 8% top 20% / 5% 80% no-repeat;
  filter: drop-shadow(0 calc(3 * var(--cm)) calc(4 * var(--cm)) rgba(0, 0, 0, .35)); opacity: .96; }

/* Tür in den nächsten Saal */
.fsag-tuer { flex: 0 0 auto; align-self: flex-end; position: relative; width: calc(108 * var(--cm)); height: calc(min(214, var(--wandcm) - 14) * var(--cm)); margin-left: calc(20 * var(--cm));
  scroll-snap-align: end; text-decoration: none !important; color: #fff !important; -webkit-tap-highlight-color: transparent; }
.fsag-tuerblatt { position: absolute; inset: 0; border: calc(6 * var(--cm)) solid #efe9dd; border-bottom: 0; border-radius: 2px 2px 0 0;
  background: linear-gradient(100deg, #0e0f12 0%, #23262c 55%, #3b3f47 100%); box-shadow: inset 0 0 calc(30 * var(--cm)) rgba(0, 0, 0, .8), 0 calc(3 * var(--cm)) calc(10 * var(--cm)) rgba(0, 0, 0, .35);
  transition: filter .2s; }
.fsag-tuer:hover .fsag-tuerblatt, .fsag-tuer:focus-visible .fsag-tuerblatt { filter: brightness(1.35); }
.fsag-tuertext { position: absolute; left: 0; right: 0; bottom: 16%; padding: 0 .5rem; text-align: center; font-size: .7rem; letter-spacing: .06em; line-height: 1.3; color: rgba(255, 255, 255, .78); }
.fsag-tuertext strong { display: block; margin-top: .2rem; font-size: .92rem; letter-spacing: 0; color: #fff; }
.fsag-tuertext strong::after { content: " →"; }

/* Pfeile (nur mit Maus) */
.fsag-pfeil { position: absolute; z-index: 4; top: 41%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94);
  color: #1f2328; font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); display: none; }
.fsag-zurueck { left: .75rem; } .fsag-vor { right: .75rem; }
@media (hover: hover) and (pointer: fine) { .fsag-pfeil:not([hidden]) { display: block; } }

/* Nahansicht */
.fsag-nah { width: min(100vw, 68rem); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: #fff; color: #1f2328; overflow: hidden; }
.fsag-nah[open] { display: flex; flex-direction: column; }
.fsag-nah::backdrop { background: rgba(10, 11, 13, .82); }
.fsag-nah-zu { position: absolute; z-index: 3; right: .6rem; top: .6rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .95);
  font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.fsag-nah-buehne { position: relative; flex: 1 1 auto; min-height: 0; background: #15171a; display: grid; place-items: center; touch-action: pan-y; }
.fsag-nah-bild { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .6)); }
.fsag-nah-raum { position: absolute; inset: 0; overflow: hidden; background: #2b3a3c; }
.fsag-nah-raum[hidden], .fsag-nah-bild[hidden] { display: none; }
.fsag-nah-rauminnen { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; aspect-ratio: 16 / 9; transform: translateX(-50%); background: center / cover no-repeat; }
.fsag-nah-anwand { position: absolute; left: 50%; top: 36%; width: calc(var(--cmb, 120) / 500 * 100%); height: auto; transform: translate(-50%, -50%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .5), 2px 3px 0 rgba(0, 0, 0, .25); transition: width .35s cubic-bezier(.2, .7, .2, 1); }
.fsag-nah-pfeil { position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92);
  font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.fsag-nah-zurueck { left: .6rem; } .fsag-nah-vor { right: .6rem; }
.fsag-nah-text { flex: 0 0 auto; padding: .9rem 1rem max(.9rem, env(safe-area-inset-bottom)); border-radius: 1rem 1rem 0 0; margin-top: -1rem; position: relative; z-index: 2; background: #fff; }
.fsag-nah-saal { margin: 0 0 .15rem; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: #6a6f77; }
.fsag-nah-text h3 { margin: 0 0 .7rem; font-size: 1.3rem; line-height: 1.2; }
.fsag-nah-ansicht, .fsag-nah-groessen { display: inline-flex; padding: .2rem; border-radius: 999px; background: #eceef1; margin: 0 .5rem .6rem 0; }
.fsag-nah-groessen[hidden] { display: none; }
.fsag-nah-ansicht button, .fsag-nah-groessen button { min-height: 40px; padding: 0 .85rem; border: 0; border-radius: 999px; background: none; font: inherit; font-size: .88rem; font-weight: 600;
  color: #5f6670; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.fsag-nah-ansicht button[aria-pressed="true"], .fsag-nah-groessen button[aria-pressed="true"] { background: #fff; color: #1f2328; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.fsag-nah-aktion { display: flex; gap: .6rem; align-items: stretch; }
.fsag-merken { flex: 0 0 auto; min-height: 50px; min-width: 50px; padding: 0 .8rem; border: 1px solid #d9dce1; border-radius: .5rem; background: #fff; font: inherit; font-weight: 600; color: #1f2328; cursor: pointer;
  transition: transform .12s ease, border-color .15s, color .15s; }
.fsag-merken::before { content: "♡ "; }
.fsag-merken[aria-pressed="true"] { border-color: #b71818; color: #b71818; }
.fsag-merken[aria-pressed="true"]::before { content: "♥ "; }
.fsag-merken:active { transform: scale(.95); }
.fsag-nah-weiter { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 .75rem; white-space: nowrap; border-radius: .5rem; background: #111; color: #fff !important;
  font-weight: 700; text-decoration: none !important; text-align: center; transition: transform .12s ease, background-color .15s; }
.fsag-nah-weiter:hover { background: #2b2f36; }
.fsag-nah-weiter:active { transform: scale(.985); }
.fsag-nah-klein { margin: .55rem 0 0; font-size: .78rem; line-height: 1.4; color: #6a6f77; }
.fsag button:focus-visible, .fsag a:focus-visible, .fsag-nah button:focus-visible, .fsag-nah a:focus-visible { outline: 2px solid #1f2328; outline-offset: 2px; }
@media (min-width: 900px) {
  .fsag-nah { height: min(92dvh, 46rem); margin: auto; border-radius: 1rem; }
  .fsag-nah[open] { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(19rem, 1fr); }
  .fsag-nah-text { margin: 0; border-radius: 0; padding: 3.5rem 1.5rem 1.5rem; align-self: center; }
  .fsag-saele { top: 9.4rem; }
  .fsag-eingang { width: 21rem; }
}
@media (max-width: 767px) { body:has(.fsag-seite):not(:has(.fs-hero-section)):not(:has(#product-offer)) #content-wrapper { margin-top: 1.75rem; } }
@media (prefers-reduced-motion: reduce) { .fsag * { animation: none !important; transition: none !important; } }

/* Text der Seite */
.fsag-seite { color: #1f2328; }
.fsag-einleitung { font-size: 1.05rem; line-height: 1.6; max-width: 52rem; margin: .25rem 0 1rem; color: #3a4048; }
.fsag-text { max-width: 52rem; margin: 0 0 2rem; }
.fsag-text h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .75rem; }
.fsag-text p, .fsag-text li { font-size: 1rem; line-height: 1.65; color: #3a4048; }
.fsag-text ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.fsag-text li { margin: 0 0 .45rem; }

/* Einleitung auf dem Handy kurz: der Saal soll im ersten Bildschirm beginnen */
.fsag-weiterlesen { display: none; }
@media (max-width: 767px) {
  .fsag-einleitung:not(.fsag-offen) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; margin-bottom: .2rem; }
  .fsag-weiterlesen { display: inline-flex; align-items: center; min-height: 40px; margin: 0 0 .35rem; padding: 0; border: 0; background: none; color: #1f2328; font: inherit;
    font-size: .92rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
}
@media (min-width: 900px) { .fsag { --hoch: clamp(480px, 66vh, 720px); } }

/* Handy: Wand nur 216 cm hoch gezeigt (Decke angeschnitten), dadurch hängen die Bilder größer und tiefer im Bild */
@media (max-width: 767px) {
  .fsag { --wandcm: 216; }
  .fsag-saal::before { background: linear-gradient(180deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, .16)); }
  .fsag-wand { gap: calc(46 * var(--cm)); }
}
