/*
 * SPDX-FileCopyrightText: Moritz Oliver Benatzky
 *
 * SPDX-License-Identifier: LicenseRef-NoHouseMesh-Proprietary-1.0
 */

/* ==========================================================================
   GESTALTUNG – Variablen
   ========================================================================== */
:root {
  --page-bg: #fdfdfd;            /* Startseite wie bisher */
  --page-ink: #454545;
  --app-bg: #0d0d0d;             /* App-Modus nach dem Berühren */
  --app-ink: #e8e8e8;
  --muted: #8a8a8a;
  --accent: #ff3b30;             /* freie Pfeile, Markierung */
  --edge: rgba(255, 255, 255, .2);
  --font: "Nunito Sans", system-ui, sans-serif;

  --page-width: 940px;           /* Breite der Startseite wie bisher */
  --grid-gap: 10px;
  --grid-cols-desktop: 4;
  --grid-cols-mobile: 2;
  --slider-ratio-desktop: 940 / 360;
  --slider-ratio-mobile: 4 / 3;
  --logo-h: 44px;
  --bg-fade: 1.2s;

  --edge-hl: rgba(255, 255, 255, .7);
  --edge-width: 1px;
  --node-w: 120px;
  --node-h: 82px;
  --node-radius: 0px;
  --node-border: 0px;
  --hl-width: 2px;
  --hl-offset: 0px;
  --lesen-text: 700px;
  --lesen-bild: 1100px;
  --lesen-rand: 18px;
  --mag-text: 680px;
  --mag-bild: 1400px;
  --sheet-w: 700px;
  --rel-gap: 96px;
  --hero-fade: 40%;
  --rel-line: 1px solid rgba(255, 255, 255, .16);
  --title-size: 11px;
  --title-lines: none;
  --hub-size: 15px;
  --year-size: 34px;

  --bar-bg: rgba(20, 20, 20, .82);
  --btn-bg: transparent;
  --btn-on-bg: rgba(255, 255, 255, .14);
  --btn-color: #cfcfcf;
  --btn-on-color: #fff;
}

/* ========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); -webkit-tap-highlight-color: transparent; }
body.app { overscroll-behavior: none; }   /* in der App: kein Neuladen durch Herunterziehen, kein Zurück-Wischen am Trackpad */
body { background: var(--page-bg); color: var(--page-ink); transition: background-color var(--bg-fade) ease; }
body.app { background: var(--app-bg); overflow: hidden; }

/* ---- Startseite (Ruhezustand) ---- */
#page { max-width: var(--page-width); margin: 0 auto; padding: 18px 16px 90px; transition: opacity .7s ease; }
body.app #page { opacity: 0; pointer-events: none; }
html.direkt body { background: var(--app-bg); transition: none; }   /* direkt ins Netz: keine Startseite, kein heller Blitz */
html.direkt body:not(.app) #page, html.direkt #hint { visibility: hidden; }
#top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
#top img { height: var(--logo-h); display: block; }
#top nav { display: flex; flex-wrap: wrap; gap: 4px 28px; justify-content: flex-end; padding-top: 4px; }
#top nav a { color: #9a9a9a; font-weight: 700; font-size: 15px; text-decoration: underline; }
#slider { position: relative; aspect-ratio: var(--slider-ratio-desktop); overflow: hidden; background: #e9e9e9; }
#slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
#slider img.on { opacity: 1; }
#slider .cap { position: absolute; left: 16px; bottom: 12px; color: #fff; font-size: clamp(18px, 3.4vw, 30px); font-weight: 300; text-shadow: 0 0 12px rgba(0, 0, 0, .6); }
#intro { margin: 16px 0; font-size: 15px; color: #777; }
#grid { display: grid; grid-template-columns: repeat(var(--grid-cols-desktop), 1fr); gap: var(--grid-gap); }
@media (max-width: 700px) {
  #grid { grid-template-columns: repeat(var(--grid-cols-mobile), 1fr); }
  #slider { aspect-ratio: var(--slider-ratio-mobile); }
}
#grid a { display: block; aspect-ratio: 220 / 150; background: #eee; }
#grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
#hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; padding: 8px 16px; border-radius: 20px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 14px; white-space: nowrap; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
body.app #hint { display: none; }

/* ---- App-Modus ---- */
#app { position: fixed; inset: 0; z-index: 2; overflow: hidden; touch-action: none; visibility: hidden; color: var(--app-ink); }
#app, #modes, #postbar, .vb-track { -webkit-user-select: none; user-select: none; }   /* Ziehen mit der Maus markiert sonst die ganze Seite */
#app img, .vb-track img { -webkit-user-drag: none; }
body.app #app, body.leaving #app { visibility: visible; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
#edges .cat { fill: none; stroke: var(--edge); stroke-width: var(--edge-width); vector-effect: non-scaling-stroke;
  transition: opacity .4s ease-in-out, stroke var(--aufbau-fade, 2s) ease-in-out, stroke-width var(--aufbau-fade, 2s) ease-in-out; }
#stage.aufbau #edges .cat { stroke: var(--aufbau-color, var(--glow-color)); stroke-width: calc(var(--edge-width) * var(--glow-k)); }   /* Aufbau: alle Linien leuchten */
#edges .hl { fill: none; stroke: var(--edge-hl); stroke-width: var(--edge-width); vector-effect: non-scaling-stroke; }
#edges .hl2 path { fill: none; stroke: var(--edge-hl); stroke-width: var(--edge-width); vector-effect: non-scaling-stroke; }
#rueck path { fill: var(--edge-hl); stroke: none; }   /* Pfeilspitze der Rückwege */   /* Rückwege: Werke der angetippten Kategorie zu ihren anderen Kategorien – gleich hell wie die direkten Linien */
#edges .glow path { fill: none; stroke: var(--glow-color); stroke-width: calc(var(--edge-width) * var(--glow-k)); vector-effect: non-scaling-stroke; opacity: 0; }   /* Verlauf per JS (auf, halten, ab) */
#edges .glow path.flash { animation: flash 1400ms ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 3% { opacity: .75; } 7% { opacity: .1; } 12% { opacity: 1; } 18% { opacity: .25; } 26% { opacity: .6; } 100% { opacity: 0; } }   /* Wetterleuchten: zwei, drei Flacker, dann verglimmen */
#edges .arr { fill: none; stroke: var(--edge-hl); stroke-width: var(--edge-width); vector-effect: non-scaling-stroke; }   /* gezeichnete Verbindungen: wie die Rückwege */
#edges .arrows text { fill: var(--edge-hl); font-family: var(--font); paint-order: stroke; stroke: var(--app-bg); }   /* Größe und Kontur setzt zeichnePfeile() passend zum Zoom */
#stage.dim #edges .cat { opacity: .25; }
/* Aufleuchten mit Ausblenden: alles außer dem Werk und den beiden verbundenen Inseln wird langsam transparent */
#stage.glowdim .node:not(.lit) img, #stage.glowdim .node:not(.lit) b, #stage.glowdim #edges .cat { opacity: calc(1 - var(--dimk, 0) * (1 - var(--glow-dim))); transition: none; }   /* per JS gezählt, keine Animation je Bild */
.node { position: absolute; left: 0; top: 0; }
#stage.moving .node { will-change: transform; }   /* nur während Kacheln fliegen */
.work { width: var(--node-w); height: var(--node-h); cursor: pointer; }
.work img { width: 100%; height: 100%; object-fit: cover; display: block; background: #222; border-radius: var(--node-radius);
  box-shadow: 0 0 0 var(--node-border) rgba(255, 255, 255, .55); }
.work span { position: absolute; left: 0; top: calc(var(--node-h) + 4px); width: var(--node-w); font-size: var(--title-size);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--title-lines); line-clamp: var(--title-lines); overflow: hidden; line-height: 1.2; color: var(--app-ink);
  opacity: 0; transition: opacity .3s; pointer-events: none; }
#app.titles .work span { opacity: .85; }
.hub, .yr { white-space: nowrap; pointer-events: auto; cursor: pointer; }
.hub b { display: inline-block; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 14px;
  background: var(--app-bg); font-weight: 600; font-size: var(--hub-size); color: var(--app-ink); }
.hub.small { z-index: 0; }
#app.far .hub.small { visibility: hidden !important; }
#app.overview .hub, #app.overview .work span { visibility: hidden !important; }   /* Übersicht ohne Texte (kamera.uebersicht_ohne_text) */
#app.far #stage.dim .hub.hl, #app.overview #stage.dim .hub.hl { visibility: visible !important; }   /* angetippt: die hellen Kategorien (eigene, Rückwege, Pfeilziele) bleiben lesbar, auch klein und weit herausgezoomt */
.hub { z-index: 1; }
.hub i { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; }
.hub.tour b { border-color: var(--accent); }
.hub.bereich b { background: var(--app-ink); color: var(--app-bg); border-color: var(--app-ink); }   /* Bereich aus dem WordPress-Hauptmenü */
.hub.bereich i { color: var(--app-bg); opacity: .6; }   /* Rundgang: Kategorie, in die gerade gezoomt wird */
.yr { font-size: var(--year-size); font-weight: 200; color: var(--muted); }
#stage.dim .node { opacity: .18 !important; }
#stage.dim .node.hl { opacity: 1 !important; }
.work.hl img {   /* box-shadow statt outline: outline wird in Chrome unter 1 px auf 1 px gerundet */
  box-shadow: 0 0 0 var(--hl-offset) var(--app-bg), 0 0 0 calc(var(--hl-offset) + var(--hl-width)) var(--app-ink); }

/* versteckt: ganz unter den Rand (inkl. Home-Balken-Abstand am iPad/iPhone) und unsichtbar */
#modes { position: fixed; z-index: 5; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translate(-50%, calc(100% + 40px + env(safe-area-inset-bottom))); visibility: hidden;
  display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--bar-bg); backdrop-filter: blur(8px);
  transition: transform .6s cubic-bezier(.2, .9, .3, 1.2), visibility 0s .6s; }
#modes.show { transform: translate(-50%, 0); visibility: visible; transition: transform .6s cubic-bezier(.2, .9, .3, 1.2), visibility 0s; }
#modes button { border: 0; background: var(--btn-bg); color: var(--btn-color); font: 600 14px var(--font); padding: 10px 14px; border-radius: 10px; cursor: pointer; }
#modes button.on { background: var(--btn-on-bg); color: var(--btn-on-color); }
#modes button.grid { padding: 10px 11px; }
#modes svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2; }
@media (max-width: 400px) {   /* schmale Handys, Klapphandy zugeklappt: Leiste kompakter, mit Rand zum Bildschirm */
  #modes button { padding: 9px 10px; font-size: 13px; }
  #modes button.grid { padding: 9px 9px; }
}

#sheet { position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto;
  padding: 14px 16px; border-radius: 14px; background: rgba(20, 20, 20, .92); color: var(--app-ink);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .35s ease; }
#sheet.show { transform: none; opacity: 1; pointer-events: auto; }
#sheet h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
#sheet p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
/* Knopfleiste in der Infotafel – gleiche Optik wie die Leiste unten */
.acts { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 14px; background: var(--bar-bg); }
.acts button, .acts a { border: 0; background: var(--btn-bg); color: var(--btn-color); font: 600 14px var(--font);
  padding: 10px 14px; border-radius: 10px; text-decoration: none; cursor: pointer; }
.acts .on { background: var(--btn-on-bg); color: var(--btn-on-color); }
.acts button:hover, .acts a:hover { color: var(--btn-on-color); }
@media (prefers-reduced-motion: reduce) { #hint { animation: none; } }

/* ================= Beitragsansicht in der App (3 Varianten) ================= */
#post { position: fixed; inset: 0; z-index: 8; background: var(--app-bg); color: #dcdcdc; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; -webkit-overflow-scrolling: touch; }
#post.show { opacity: 1; visibility: visible; transition: opacity .45s ease; }
#post.v-b { overflow: hidden; background: var(--app-bg); }   /* App-Hintergrund statt Schwarz: wirkt klarer, wie ein Passepartout */
#postbar { position: fixed; z-index: 10; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0,0,0,.65), transparent); pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .3s; }
#post.show ~ #postbar { opacity: 1; visibility: visible; }
#postbar.nurlesen .var { display: none; }   /* Impressum & Co.: kein Umschalter Lesen/Bühne/Magazin */
#postbar > * { pointer-events: auto; }
#postbar .li { display: flex; gap: 8px; }
#postbar .teilen { width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; }
#postbar .teilen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#postbar .x { width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 40px; cursor: pointer; }
#postbar .var { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
#postbar .var button { border: 0; background: transparent; color: #bbb; font: 600 13px var(--font); padding: 8px 11px; border-radius: 9px; cursor: pointer; }
#postbar .var button.on { background: rgba(255,255,255,.16); color: #fff; }
#flyimg { position: fixed; z-index: 9; object-fit: cover; pointer-events: none; transition: all .55s cubic-bezier(.3,.8,.2,1); }

#post .txt { font-size: 17px; line-height: 1.65; }
#post .txt a { color: #fff; }
#post .txt p { margin: 0 0 1em; }
#post figure { margin: 0; }
#post figcaption { font-size: 13px; color: var(--muted); padding: 6px 0 0; }
#post img { display: block; max-width: 100%; }
#post .meta { color: var(--muted); font-size: 14px; letter-spacing: .02em; }
#post .vid { position: relative; background: #000 center / cover no-repeat; cursor: pointer; }
#post .vid::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 32px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 24px; line-height: 64px; text-align: center; }
#post .vid.on::after { display: none; }
#post .vid small { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: #ccc; text-shadow: 0 0 4px #000; }
#post .vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#post .rel { margin-top: var(--rel-gap); margin-bottom: 20px; padding-top: 22px; border-top: var(--rel-line); }   /* deutlich vom Inhalt getrennt */
#post .rel h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
#post .rel div { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
#post .rel a { flex: 0 0 auto; width: 132px; scroll-snap-align: start; color: #bbb; font-size: 12px; text-decoration: none; }
#post .rel img { width: 132px; height: 90px; object-fit: cover; margin-bottom: 4px; }
#post .orig { display: inline-block; margin: 10px 0 60px; color: var(--muted); font-size: 13px; }
#post .load { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); }

/* --- Variante A „Lesen“: Textspalte schmal (≈ 75 Zeichen), Titelbild und Bilder dürfen breiter sein --- */
.va { padding: 0 0 40px; }
#post .va > * { margin-left: auto; margin-right: auto; }
#post .va > header, #post .va > .blk.txt, #post .va > .rel, #post .va > .orig { max-width: calc(var(--lesen-text) + 36px); padding-left: 18px; padding-right: 18px; }
#post .va > .hero, #post .va > .blk.img, #post .va > .blk.vid { max-width: min(var(--lesen-bild), calc(100% - 2 * var(--lesen-rand))); }
#post .va > .orig { display: block; }
#post .va > .blk.gal { max-width: min(var(--lesen-bild), calc(100% - 2 * var(--lesen-rand))); }
#post .va .blk { margin-bottom: 22px; }
.va header { padding-top: 22px; padding-bottom: 6px; }
#post [id], #post [name] { scroll-margin-top: calc(76px + env(safe-area-inset-top)); }   /* Sprungmarke: Abschnitt unter der Leiste */
.va.ohne-bild > header { padding-top: calc(76px + env(safe-area-inset-top)); }   /* Seite ohne Titelbild (Impressum): Titel unter der Leiste */
.va h1 { margin: 0 0 6px; font-size: clamp(26px, 6vw, 40px); font-weight: 300; color: #fff; line-height: 1.15; }
.va .hero img, .va .blk.img img { width: 100%; height: auto; margin: 0 auto; }   /* höchstens Originalgröße: per JS */
.va .hero img { max-height: 80vh; object-fit: contain; }
.va .blk.img figcaption { max-width: calc(var(--lesen-text) + 36px); margin: 0 auto; padding: 6px 18px 0; }

/* --- Variante B „Bühne“: Bild für Bild im Vollbild wischen, Text im Blatt --- */
.vb-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.vb-track::-webkit-scrollbar { display: none; }
.vb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; background: var(--app-bg); position: relative; }
.vb-slide img { position: absolute; inset: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); margin: auto; width: calc(100% - 2 * var(--vb-rand)); height: calc(100% - 2 * var(--vb-rand)); object-fit: contain; }   /* rundum Rand (beitrag.buehne_rand_vmin) */   /* immer ganz sichtbar; höchstens buehne_max_vergroesserung × Original (per JS) */
.vb-slide .vid { width: min(100%, 160vh); }
.vb-pfeil { position: fixed; z-index: 9; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 24px;
  background: rgba(0, 0, 0, .45); color: #fff; font: 300 34px/44px var(--font); cursor: pointer; transition: background .2s, opacity .2s; }   /* Bühne am PC: blättern ohne seitliches Mausrad */
.vb-prev { left: 14px; } .vb-next { right: 14px; }
.vb-pfeil:hover { background: rgba(0, 0, 0, .7); }
.vb-pfeil[disabled] { opacity: .2; cursor: default; }
@media (hover: none) { .vb-pfeil { display: none; } }   /* Touch: Wischen reicht */
.vb-count { position: fixed; z-index: 9; right: 16px; top: calc(64px + env(safe-area-inset-top)); color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 4px 9px; border-radius: 10px; }
/* Titel/Datum links und Knopf „Text“ in der Mitte auf einer Höhe – ohne Hintergrund, über dem Bild */
.vb-bar { position: fixed; z-index: 9; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); pointer-events: none; }
.vb-cap { max-width: calc(50% - 44px); text-shadow: 0 0 14px rgba(0,0,0,.8), 0 0 3px rgba(0,0,0,.7); pointer-events: auto; }
.vb-cap h1 { margin: 0 0 4px; font-size: 24px; font-weight: 400; color: #fff; hyphens: auto; overflow-wrap: break-word; }   /* lange Wörter trennen statt unter den Knopf laufen */
@media (max-width: 700px) { .vb-cap h1 { font-size: 19px; } }
.vb-cap .meta { margin: 0; color: #e6e6e6; }
.vb-acts { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; }
.vb-text { position: fixed; z-index: 10; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), var(--sheet-w));
  max-height: 62vh; overflow-y: auto; padding: 18px 20px; border-radius: 14px; background: rgba(13,13,13,.96);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.vb-text.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.vb-text { max-height: min(62vh, calc(100svh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }   /* oben immer unter × und Optik-Knöpfen (iPhone: vh ist größer als der sichtbare Bereich) */
.vb-acts .toggle.x { width: 40px; height: 40px; padding: 0; border-radius: 20px; font-size: 24px; font-weight: 300; line-height: 40px; }
.vb-acts:has(.x) { border-radius: 24px; }
.vb-dots { position: fixed; z-index: 9; left: 0; right: 0; top: calc(66px + env(safe-area-inset-top)); display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.vb-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.35); transition: all .3s; }
.vb-dots i.on { width: 18px; background: #fff; }
.vb-track { touch-action: pan-x; }   /* wischen blättert; zwei Finger zoomen per JS */
.vb-track.zoomed { overflow-x: hidden; touch-action: none; cursor: grab; }
.vb-bar, .vb-dots, .vb-count { transition: opacity .25s ease, visibility .25s; }
/* nur das Bild: Handy quer, beim Zoomen oder nach Tippen */
#post.v-b.bare .vb-bar, #post.v-b.bare .vb-dots, #post.v-b.bare .vb-count, #post.v-b.bare .vb-text, #post.v-b.bare .vb-pfeil,
#post.v-b.bare ~ #postbar, #post.v-b.bare ~ #regler-btn { opacity: 0; visibility: hidden; }

/* --- Variante C „Magazin“: großes Titelbild, gemeinsames 12er-Raster für Text und Bilder --- */
.vc .hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #000; }
.vc .hero img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.vc .hero.fit::before { content: ""; position: absolute; inset: -40px; background: var(--hero-bg) center / cover no-repeat; filter: blur(28px) brightness(.45); }
.vc .hero.fit img { position: absolute; inset: 0; margin: auto; width: auto; height: auto; object-fit: contain; }   /* zu kleines Bild: nicht hochrechnen */
.vc .hero::after { content: ""; position: absolute; inset: 0;   /* läuft nahtlos in die App-Hintergrundfarbe aus */
  background: linear-gradient(transparent var(--hero-fade), color-mix(in srgb, var(--app-bg) 70%, transparent) calc((var(--hero-fade) + 100%) / 2), var(--app-bg) 100%); }
.vc .hero header { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 0 20px 34px; }
.vc .hero h1 { margin: 0 0 10px; font-size: clamp(40px, 11vw, 104px); font-weight: 200; line-height: .95; color: #fff; letter-spacing: -.01em; }
.vc .hero .meta { color: #ddd; }
.vc .flow { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px 16px; padding: 56px 16px 20px; max-width: calc(var(--mag-bild) + 32px); margin: 0 auto; }
.vc .blk.txt { grid-column: 1 / -1; width: 100%; max-width: var(--mag-text); margin: 0 auto; font-size: 19px; }
.vc .blk.vid, .vc .blk.img:nth-of-type(3n+1) { grid-column: 1 / -1; }
.vc .blk.img:nth-of-type(3n+2) { grid-column: 1 / 9; }
.vc .blk.img:nth-of-type(3n) { grid-column: 5 / -1; margin-top: -60px; }
.vc .blk.img img { width: 100%; height: auto; margin: 0 auto; }
.vc .blk.img:nth-of-type(3n+2) img { margin-left: 0; }
.vc .blk.img:nth-of-type(3n) img { margin-right: 0; }
.vc .blk.gal { grid-column: 1 / -1; }
.vc .rel, .vc .orig { max-width: calc(var(--mag-bild) + 32px); margin-left: auto; margin-right: auto; padding: 0 16px; display: block; }
@media (max-width: 700px) {
  .vc .blk.txt { font-size: 17px; padding: 0 2px; }
  .vc .blk.img:nth-of-type(3n+2), .vc .blk.img:nth-of-type(3n) { grid-column: 1 / -1; margin-top: 0; }
}

/* Galerien (WordPress und NextGEN): Reihen gleicher Höhe, nichts beschnitten; Klick öffnet die Bühne bei diesem Bild */
#post .gal { display: flex; flex-wrap: wrap; gap: 6px; }
#post .gal::after { content: ""; flex-grow: 10000; }
#post .gal a { display: block; flex: var(--ar) 1 calc(var(--gal-row) * var(--ar)); cursor: zoom-in; }
#post .gal img { width: 100%; height: auto; aspect-ratio: var(--ar); background: rgba(255, 255, 255, .04); }
@media (max-width: 700px) { #post .gal a { flex-basis: calc(var(--gal-row) * var(--ar) * .6); } }

/* Suche: Feld oben (am Handy nicht unter der Tastatur), Trefferliste darunter */
#suche { position: fixed; z-index: 12; left: 50%; top: calc(58px + env(safe-area-inset-top)); width: min(calc(100% - 24px), 520px);
  transform: translate(-50%, -12px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility 0s .25s; }
#suche.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .25s; }
#suche .feld { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px; border-radius: 14px; background: var(--bar-bg); backdrop-filter: blur(8px); }
#suche input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--app-ink); font: 16px var(--font); }   /* 16 px: iOS zoomt sonst hinein */
#suche input::-webkit-search-cancel-button { display: none; }
#suche .n { color: var(--muted); font-size: 13px; white-space: nowrap; }
#suche .kt { flex: none; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: var(--muted); font: 12px var(--font); padding: 4px 9px; border-radius: 11px; cursor: pointer; white-space: nowrap; }
#suche .kt[aria-pressed="true"] { background: var(--app-ink); color: var(--app-bg); border-color: var(--app-ink); }   /* an: Beschreibungen der Kategorien werden mitdurchsucht */
#suche .kt[hidden] { display: none; }
#suche .x { border: 0; background: transparent; color: var(--app-ink); font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 17px; cursor: pointer; }
#suche .res { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 42vh; overflow-y: auto; border-radius: 14px; background: var(--bar-bg); backdrop-filter: blur(8px); }
#suche .res:empty, #suche.zu .res { display: none; }
#suche .res li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
#suche .res li:hover { background: rgba(255, 255, 255, .1); }
#suche .res img, #suche .res i { width: 52px; height: 36px; object-fit: cover; border-radius: 4px; flex: none; background: #222; }
#suche .res i { display: grid; place-items: center; font-style: normal; font-weight: 700; color: var(--app-bg); background: var(--app-ink); border-radius: 18px; }   /* Kategorie ohne Bild */
#suche .res b { display: block; font-weight: 600; font-size: 14px; color: var(--app-ink); }
#suche .res small { color: var(--muted); font-size: 12px; }

/* Fußzeile der Startseite (Inhalt aus dem WordPress-Theme) und Rechtliches in der App */
#fuss { max-width: var(--page-width); margin: 0 auto; padding: 28px 16px 40px; font-size: 13px; line-height: 1.6; color: var(--page-ink); opacity: .75; text-align: center; }
#fuss p { margin: 0 0 4px; }
#fuss a { color: inherit; }
#recht { position: fixed; z-index: 5; left: 14px; top: calc(16px + env(safe-area-inset-top)); display: none; align-items: center; gap: 4px 14px; flex-wrap: wrap; max-width: calc(100vw - 28px); font-size: 13px; }   /* schmale Handys: lieber zweite Zeile als aus dem Bild */
@media (min-width: 900px) { #recht { left: 18px; top: calc(18px + env(safe-area-inset-top)); gap: 18px; font-size: 15px; } }   /* am PC gut lesbar */
body.app #recht { display: flex; }
#post.show ~ #recht { display: none; }
#recht a { color: var(--muted); text-decoration: none; }
#recht a:hover { color: var(--app-ink); }
#recht a.archiv { padding: 7px 14px; border-radius: 12px; background: var(--bar-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--btn-color); font-weight: 600; transition: background .2s, color .2s; }   /* Archiv: Knopf im Stil der Leiste unten */
#recht a.archiv:hover { color: var(--btn-on-color); }
#recht a.archiv.on { background: rgba(255, 255, 255, .22); color: var(--btn-on-color); }   /* Archiv-Ansicht offen */

/* kurze Rückmeldung, z. B. „Link kopiert“ */
#toast { position: fixed; z-index: 20; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translate(-50%, -8px); padding: 8px 14px; border-radius: 12px;
  background: rgba(0,0,0,.8); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Album-Überblick: Mappen als Karten (Bild nie beschnitten), Klick öffnet die Mappe */
#post .mappen { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; }
#post .va > .blk.mappen { max-width: min(var(--lesen-bild), calc(100% - 2 * var(--lesen-rand))); }
.vc .blk.mappen { grid-column: 1 / -1; }
#post .mappe { display: block; color: inherit; text-decoration: none; }
#post .mappe .bild { display: grid; place-items: center; aspect-ratio: 4 / 3; background: rgba(255, 255, 255, .04); border-radius: 6px; overflow: hidden; }
#post .mappe img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
#post .mappe:hover img { transform: scale(1.03); }
#post .mappe b { display: block; margin-top: 8px; font-weight: 600; color: #fff; }
#post .mappe small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
