/* myAlbum – ein Design, angelehnt an Story Black. Farben und Schriften kommen aus der site.yaml
   und werden je Seite als Variablen gesetzt; die Werte hier sind nur die Vorgabe. */

:root {
  --bg: #111;
  --bg-raised: #1c1c1c;
  --text: #e8e6e3;
  --text-quiet: #9a9792;
  --accent: #d9a441;
  --line: #2c2c2c;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --heading-font: var(--font);
  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --width: 1200px;
  font-family: var(--font);
  color-scheme: dark;
}

h1, h2, h3, h4, .site-title { font-family: var(--heading-font); }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

img { display: block; max-width: 100%; height: auto; }

/* Kopf */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }

.site-nav a {
  color: var(--text-quiet);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover, .site-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.2rem;
  padding: 2px 10px;
  cursor: pointer;
}

/* Die Lupe steht rechts neben dem Menü; auf dem Handy neben dem Menüknopf. */
.site-nav { order: 1; }
.search-toggle {
  order: 2;
  display: flex;
  background: none;
  border: 0;
  padding: 4px;
  color: var(--text-quiet);
  cursor: pointer;
}
.search-toggle:hover { color: var(--text); }
.search-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-toggle { order: 3; }

@media (max-width: 760px) {
  .site-nav { order: 4; }
  .search-toggle { margin-left: auto; }
  .site-header .nav-toggle { margin-left: 0; }
  .nav-toggle { display: block; }
  .site-header { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; flex-direction: column; margin-left: 0; }
  .site-header.open .site-nav { display: flex; }
}

/* Titelbild */

/* Das Titelbild füllt den Bildschirm unter dem Kopf und steht still; der Inhalt schiebt sich
   beim Scrollen darüber. clip-path begrenzt das feststehende Bild auf den Bereich des Abschnitts –
   background-attachment: fixed täte dasselbe, wird aber von Safari auf dem iPhone ignoriert. */
.hero {
  position: relative;
  min-height: calc(100vh - 58px);
  min-height: calc(100svh - 58px);
  display: flex;
  align-items: flex-end;

  /* 1px unten frei lassen: die Höhe ist krumm, und beim Runden blieb sonst eine Pixelzeile des
     Bildes unter der Abdunklung sichtbar – als helle Linie an der Unterkante. */
  clip-path: inset(0 0 1px 0);
}

.hero-image {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, var(--bg), rgba(0, 0, 0, 0.65) 40px, rgba(0, 0, 0, 0.1) 55%);
}

/* Im Titelbild steht die Schrift immer hell auf abgedunkeltem Bild – unabhängig vom Farbschema. */
.hero { color: #fff; --hero-quiet: rgba(255, 255, 255, 0.75); }

.hero-plain {
  min-height: 160px;
  background: var(--bg-raised);
  clip-path: none;
  color: var(--text);
  --hero-quiet: var(--text-quiet);
}

.hero-plain::before { display: none; }

.hero-text {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 24px var(--gutter) 56px;
}

.hero-plain .hero-text { padding-bottom: 24px; }

.hero-half { min-height: 55vh; min-height: 55svh; }

.hero h1 {
  margin: 0;
  font-size: var(--hero-size, clamp(1.8rem, 5vw, 3.2rem));
  font-weight: var(--hero-weight, 300);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* Auf dem Bild hilft ein weicher Schatten, wo es hell ist; im schlichten Kopf ohne Bild nicht nötig. */
.hero:not(.hero-plain) h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.hero:not(.hero-plain) .description, .hero:not(.hero-plain) .subtitle { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }

/* Kopfleiste über dem Titelbild: liegt durchsichtig auf dem Bild und wird beim Scrollen dunkel
   (Klasse „solid“ aus dem Skript). Nur mit Skript – ohne bliebe sie auch über dem Inhalt durchsichtig. */
.js .has-hero .site-header {
  position: fixed;
  left: 0;
  right: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.js .has-hero .site-header:not(.solid):not(.open) {
  /* border-box: sonst wiederholt sich der Verlauf im durchsichtigen Rahmen – als dunkle Linie. */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)) border-box;
  border-bottom-color: transparent;
  backdrop-filter: none;
}
.js .has-hero .site-header:not(.solid):not(.open) :is(.site-title, .site-nav a, .search-toggle, .nav-toggle) {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.js .has-hero .site-header:not(.solid):not(.open) .nav-toggle { border-color: rgba(255, 255, 255, 0.5); }
.js .has-hero .hero-full { min-height: 100vh; min-height: 100svh; }
.js .has-hero .hero-half { min-height: calc(55vh + 58px); min-height: calc(55svh + 58px); }
main { scroll-margin-top: 58px; }

/* Pfeil zum Weiterscrollen: zeigt, dass unter dem Titelbild noch etwas kommt. */
.hero-full .hero-text { padding-bottom: 80px; }
.hero-scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  opacity: 0.8;
}
.hero-scroll:hover { opacity: 1; background: rgba(255, 255, 255, 0.14); }
.hero-scroll svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Bewegung nur, wer sie nicht im System abgeschaltet hat: wippender Pfeil, weiches Scrollen,
   Abschnitte, die beim Scrollen sanft hereingleiten (Klassen aus dem Skript). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-scroll svg { animation: hero-bob 2.4s ease-in-out infinite; }
  /* Titelbild zoomt über 20 Sekunden ganz langsam heran und bleibt dann stehen. */
  .hero-image { animation: hero-zoom 20s ease-out both; }
  /* Karten: das Bild rückt beim Überfahren leicht heran. */
  .fx-card-zoom .card-media img { transition: transform 0.5s ease; }
  .fx-card-zoom .card:hover .card-media img { transform: scale(1.05); }
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.visible { opacity: 1; transform: none; }
}

@keyframes hero-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

@keyframes hero-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.subtitle { margin: 6px 0 0; color: var(--hero-quiet); }
.description { max-width: 760px; margin-top: 10px; font-size: 1.05rem; }
.description p { margin: 0 0 6px; }

.breadcrumbs { font-size: 0.85rem; margin-bottom: 6px; }
.breadcrumbs a { color: var(--hero-quiet); text-decoration: none; }
.breadcrumbs a:hover { color: inherit; }
.breadcrumbs span { margin: 0 8px; color: var(--hero-quiet); }
.description a { color: inherit; }

/* Inhalt */

main {
  flex: 1;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
}

.block + .block { margin-top: 40px; }

.block-text { max-width: 760px; font-size: 1.05rem; scroll-margin-top: 80px; }
.block-text > h1:first-child { margin-top: 0; }
.block-text h1, .block-text h2, .block-text h3 { font-weight: 400; line-height: 1.25; }
.block-text h1 { font-size: 2rem; }
.block-text table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.block-text th, .block-text td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }

/* Tabelle ohne Rahmen und ohne Kopfzeile, etwa für Ansprechpartner: im Markdown die Zeile
   {.ohne-rahmen} direkt über die Tabelle, die Kopfzeile darf leer bleiben („| | |“). */
.block-text table.ohne-rahmen, .split-text table.ohne-rahmen { width: auto; }
table.ohne-rahmen thead { display: none; }
table.ohne-rahmen td { border: 0; padding: 2px 24px 2px 0; }
.block-text img { border-radius: var(--radius); }

/* Karten für Unteralben und Seiten */

.block-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.card:hover { transform: translateY(-3px); }

/* Kalenderblatt auf Karten datierter Alben, wie bei den Terminen – nur mit Schalter (fx-card-date). */
.card-date { display: none; }
.fx-card-date .card-date {
  display: block;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  min-width: 44px;
  padding: 4px 6px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-date b { display: block; font-size: 1.25rem; font-family: var(--heading-font); letter-spacing: 0; }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.card-media img, .card-noimage { width: 100%; height: 100%; object-fit: cover; }
.card-noimage { display: block; background: linear-gradient(135deg, var(--line), var(--bg-raised)); }
.card-text { display: flex; flex-direction: column; padding: 12px 14px 14px; }
.card-text strong { font-weight: 500; }
.card-text small { color: var(--text-quiet); }

/* Mosaik: Titelbild links groß, rechts zwei kleine übereinander, „+N“ auf dem letzten. */
.card-mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.card-mosaic .card-main { grid-row: 1 / span 2; }
.card-mosaic-1 .card-extra { grid-row: 1 / span 2; }
.card-more {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc((100% - 2px) / 3);
  height: calc((100% - 2px) / 2);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Overlay: Titel auf dem Bild. Der Stil hängt an der einzelnen Karte, nicht am Abschnitt. */
.card-style-overlay { position: relative; }
.card-style-overlay .card-text {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
}
/* Nur das Bild: der Text bleibt für Screenreader, ist aber nicht zu sehen. */
.card-style-image .card-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.card-style-overlay .card-text small { color: rgba(255, 255, 255, 0.8); }

/* Platzhalter: bis die Kachel geladen ist, steht die winzige Vorschau verschwommen dahinter.
   Nur mit Skript ausgeblendet – ohne Skript wäre das Bild sonst nie sichtbar. */
.tile { background-size: cover; background-repeat: no-repeat; }
.js .tile img { opacity: 0; transition: opacity 0.45s ease, filter 0.15s ease; }
.js .tile img.loaded { opacity: 1; }

/* Galerie */

.block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.tile {
  position: relative;
  display: block;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-raised);
}

.tile img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transition: filter 0.15s ease; }
/* Abdunkeln statt durchsichtig machen: sonst scheint der grob hochskalierte Platzhalter durch. */
.tile:hover img { filter: brightness(0.85); }

/* Ganze Bilder im Blocksatz: jede Kachel wächst im Verhältnis ihres Seitenverhältnisses, so werden
   alle Bilder einer Zeile gleich hoch und füllen sie aus. Das unsichtbare ::after nimmt in der
   letzten Zeile den Rest auf, damit die nicht auf Riesenbilder gestreckt wird. */
.gallery-full {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  --row: 220px;
}

.gallery-full::after { content: ""; flex-grow: 999; }

.gallery-full .tile { flex: var(--ratio) 1 calc(var(--ratio) * var(--row)); }

.gallery-full .tile img { aspect-ratio: var(--ratio); width: 100%; height: auto; object-fit: cover; }

@media (max-width: 600px) {
  .gallery-full { --row: 140px; }
}

.tile-video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.tile .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}

.tile .caption p { margin: 0; }

.block-single { margin-left: 0; margin-right: 0; }
.block-single img, .block-single video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  /* Links bündig, in einer Flucht mit Karten, Galerien und Text – nicht mittig mit Rand davor. */
  margin: 0;
  border-radius: var(--radius);
}
.block-single figcaption { color: var(--text-quiet); font-size: 0.9rem; margin-top: 8px; }
.block-single figcaption p { margin: 0; }

/* Feste Höhe: das Bild behält sein Seitenverhältnis, auf kleinen Bildschirmen höchstens 80 % hoch. */
.block-single.has-height img, .block-single.has-height video {
  height: min(var(--single-height), 80vh);
  width: auto;
  max-height: none;
  object-fit: contain;
}

/* Zweiteilung: Bild links oder rechts, Text daneben; auf schmalen Bildschirmen untereinander. */
.block-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.block-split.has-height.split-left { grid-template-columns: auto minmax(0, 1fr); }
.block-split.has-height.split-right { grid-template-columns: minmax(0, 1fr) auto; }
.block-split .block-single { margin: 0; }
.block-split .block-single img, .block-split .block-single video { width: 100%; margin: 0; }
.block-split .block-single.has-height img, .block-split .block-single.has-height video { width: auto; max-width: 60vw; }
.split-right .block-single { order: 2; }
/* 50/50: die Hälften bleiben auch auf dem Handy nebeneinander, das Bild wird mit seiner Spalte
   kleiner. Eine Höhe ist dann eine Obergrenze; das Seitenverhältnis bleibt. Die Selektoren sind
   bewusst spezifischer als die Regeln für schmale Bildschirme weiter unten. */
.block-split.split-half,
.block-split.split-half.has-height.split-left,
.block-split.split-half.has-height.split-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split-half .block-single img, .split-half .block-single video,
.split-half .block-single.has-height img, .split-half .block-single.has-height video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--single-height, 80vh);
  /* Ist das Bild schmaler als seine Hälfte, sitzt es an der Außenkante – bündig mit dem Rest der Seite. */
  margin: 0;
}
.split-half.split-right .block-single img, .split-half.split-right .block-single video { margin-left: auto; }
.split-half.split-right .block-single { order: 2; }
.block-split.align-top { align-items: start; }
.block-split.align-bottom { align-items: end; }

/* Einbettung (iframe): volle Breite bis 960 px, Höhe aus dem Seitenverhältnis. */
.block-embed { max-width: 960px; margin-left: 0; margin-right: 0; scroll-margin-top: 80px; }
.embed-frame { position: relative; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-embed figcaption { color: var(--text-quiet); font-size: 0.9rem; margin-top: 8px; }
.block-embed figcaption p { margin: 0; }
.split-text > :first-child { margin-top: 0; }
.split-text > :last-child { margin-bottom: 0; }

@media (max-width: 700px) {
  .block-split, .block-split.has-height.split-left, .block-split.has-height.split-right { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .split-right .block-single { order: 0; }
  .block-split .block-single.has-height img, .block-split .block-single.has-height video { max-width: 100%; }
}

/* Termine */

.block-events { display: flex; flex-direction: column; gap: 10px; max-width: 760px; scroll-margin-top: 80px; }

.event {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-raised);
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}

.event-next { border-left-color: var(--accent); }

.event-date {
  flex: none;
  width: 56px;
  text-align: center;
  line-height: 1.1;
}

.event-day { display: block; font-size: 1.6rem; font-weight: 600; font-family: var(--heading-font); }
.event-month { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-quiet); }
.event-body { display: flex; flex-direction: column; min-width: 0; }
.event-body strong { font-weight: 500; }
.event-body small { color: var(--text-quiet); }
.event-badge { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }

/* Termine als Tabelle; auf schmalen Bildschirmen wird sie seitlich verschiebbar. */
.block-events-table { overflow-x: auto; scroll-margin-top: 80px; }

/* Gruppe: Text und Bilder gehören zusammen – Abstand wie zwischen Überschrift und Text. */
.block-group { scroll-margin-top: 80px; }
.group-intro > :last-child { margin-bottom: 0.8em; }
/* Der Text über den Terminen gehört zum Abschnitt: Abstand wie zwischen Überschrift und Text. */
.events-intro > :last-child { margin-bottom: 0.67em; }
.block-events .events-intro > :last-child { margin-bottom: 0.3em; }
table.events { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
table.events th { text-align: left; font-weight: 500; color: var(--text-quiet); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.events th, table.events td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
table.events .events-when { white-space: nowrap; }
table.events .events-when small { display: block; color: var(--text-quiet); }
table.events tr.event-next td { color: var(--accent); }
table.events tr.event-next td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.events tr.event-past td { color: var(--text-quiet); opacity: 0.6; }
.event-past { opacity: 0.5; }
.events-more { margin: 4px 0 0; }
.events-more a { color: var(--accent); text-decoration: none; }
.events-more a:hover { text-decoration: underline; }
.events-none { color: var(--text-quiet); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; }

/* Fußzeile: Name mit Kurztext, eigener Text (Kontakt), alle Menüpunkte; darunter „©“. */
.site-footer {
  margin-top: 48px;
  padding: 36px var(--gutter) 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text-quiet);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px 40px;
  align-items: start;
}
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand img { width: 40px; height: 40px; border-radius: 8px; flex: none; }
.footer-brand strong { display: block; color: var(--text); font-family: var(--heading-font); font-size: 1rem; }
.footer-brand span { display: block; }
.footer-text p { margin: 0 0 6px; }
.footer-text a, .footer-nav a { color: var(--text-quiet); }
.footer-text a:hover, .footer-nav a:hover { color: var(--accent); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-nav a { text-decoration: none; }
.footer-copy { max-width: var(--width); margin: 28px auto 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8rem; text-align: center; }

/* Nach oben: erscheint auf langen Seiten unten rechts (Skript schaltet hidden). */
.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-raised) 90%, transparent);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.to-top[hidden] { display: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Akzentlinie unter der ersten Überschrift eines Abschnitts – gliedert lange Seiten. Sonst überall,
   wo im Markdown {.linie} steht, etwa „## Kontakt {.linie}“. */
.block-text > :is(h1, h2):first-child::after,
.split-text > :is(h1, h2):first-child::after,
.linie::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 0.4em;
  border-radius: 2px;
  background: var(--accent);
}

/* Bildbetrachter */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(0, 0, 0, 0.96);
  touch-action: pan-y;
}

/* Hinter dem Bild seine eigene, stark weichgezeichnete und abgedunkelte Fassung statt Schwarz. */
.viewer-backdrop { display: none; }
.fx-viewer-blur .viewer-backdrop {
  display: block;
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.35) saturate(1.2);
  transition: background-image 0.3s ease;
}

.viewer.open { display: block; }

/* Flex statt Grid: in einer Grid-Zelle bezieht sich max-height: 100% auf die Zeilenhöhe, und die
   richtet sich nach dem Bild – Hochformate ragten dann unten aus dem Bildschirm. Im Flex-Container
   gilt die feste Höhe der Bühne. */
.viewer-stage {
  position: absolute;
  inset: 48px 56px 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-stage img, .viewer-stage video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 600px) {
  .viewer-stage { inset: 48px 0 56px; }
}

.viewer button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  padding: 12px 16px;
  cursor: pointer;
  opacity: 0.7;
}

.viewer button:hover { opacity: 1; }
.viewer-close { top: 0; right: 0; }
.viewer-prev { left: 0; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 0; top: 50%; transform: translateY(-50%); }

.viewer-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 56px;
  padding: 10px 64px;
  color: #ddd;
  font-size: 0.9rem;
  text-align: center;
}

.viewer-bar p { margin: 0; }
.viewer-count { color: #888; margin-right: 10px; }

/* Suche: ein Feld oben, Treffer darunter; dahinter abgedunkelt. */
.search {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  padding: 64px 16px 16px;
}
.search[hidden] { display: none; }
.search-panel {
  max-width: 640px;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.search-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}
/* Der Browser bringt in Suchfeldern ein eigenes × mit; eines genügt. */
.search-row input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-close { background: none; border: 0; color: var(--text-quiet); font-size: 1.6rem; padding: 6px 14px; cursor: pointer; }
.search-results { overflow-y: auto; }
.search-hit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
}
.search-hit:hover, .search-hit:focus { background: var(--line); outline: none; }
.search-hit img, .search-icon { flex: none; width: 56px; height: 42px; object-fit: cover; border-radius: 3px; background: var(--line); }
.search-icon { display: grid; place-items: center; color: var(--text-quiet); font-size: 1.2rem; }
.search-icon-event::before { content: "📅"; }
.search-icon-page::before { content: "📄"; }
.search-icon-album::before { content: "🖼"; }
.search-text { display: flex; flex-direction: column; min-width: 0; }
.search-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-text small { color: var(--text-quiet); }
.search-empty { padding: 14px 16px; margin: 0; color: var(--text-quiet); }

/* Zoom: das Bild nimmt Zeiger selbst entgegen (Ziehen, zwei Finger), der Browser zoomt nicht mit. */
.viewer { overflow: hidden; }
.viewer-stage img { touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.viewer.zoomed .viewer-stage img { cursor: grab; }
.viewer.zoomed .viewer-prev, .viewer.zoomed .viewer-next { display: none; }

/* Werkzeuge oben rechts, links neben dem Schließen-Knopf. */
.viewer [hidden] { display: none !important; }
.viewer-tools { position: absolute; top: 0; right: 56px; display: flex; }
.viewer-tools button, .viewer-tools a {
  position: static;
  display: flex;
  align-items: center;
  padding: 14px 10px;
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
}
.viewer-tools a:hover { opacity: 1; }
.viewer-tools svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viewer-tools svg .fill { fill: currentColor; stroke: none; }
.viewer.playing .viewer-play { opacity: 1; color: var(--accent); }

.viewer-toast {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 0.9rem;
}
