/* 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;
  --card-radius: 20px;
  --gutter: clamp(16px, 4vw, 40px);
  --width: 1200px;
  font-family: var(--font);
  color-scheme: dark;
}

h1, h2, h3, h4 { font-family: var(--heading-font); }
/* Seitentitel und Name im Kopf dürfen eine eigene Schrift und Farbe haben, etwa eine Handschrift. */
.hero h1, .site-title, .footer-brand strong { font-family: var(--title-font, var(--heading-font)); }

/* Bewusst kein Überblenden beim Seitenwechsel (@view-transition): solange es läuft, nimmt der
   Browser keine Klicks an – ein schneller Klick ins Menü ging dann verloren. */

* { 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 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--title-color, var(--text));
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
}
.site-logo { height: 40px; width: auto; flex: none; }
/* Die helle Logo-Fassung nur, solange die Kopfleiste durchsichtig über dem Titelbild liegt. */
.site-logo-on-image { display: none; }
.js .has-hero .site-header:not(.solid):not(.open) .site-logo-on-image { display: block; }
.js .has-hero .site-header:not(.solid):not(.open) .site-logo:has(+ .site-logo-on-image) { display: none; }
/* Für Screenreader und Suchmaschinen da, auf dem Bildschirm unsichtbar – etwa der Name neben einem Logo, das ihn schon zeigt. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Mittlere Breiten: mit Logo genügt das Logo – so passt das Menü noch in eine Zeile. Auf dem Handy
   (Menü hinter ☰) ist wieder Platz für den Namen. */
@media (min-width: 761px) and (max-width: 1100px) {
  .site-logo + span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

.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); }

/* Untermenü: klappt unter seinem Menüpunkt auf, mit der Maus oder per Tastatur (focus-within). */
.nav-group { position: relative; display: flex; }
.nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 11;
  flex-direction: column;
  min-width: 190px;
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: flex; }
.nav-sub a { white-space: nowrap; }
/* Über dem Titelbild steht das Menü in Weiß – im Untermenü mit eigenem Grund nicht. */
.js .has-hero .site-header:not(.solid):not(.open) .nav-sub a { color: var(--text-quiet); text-shadow: none; }

.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; }
  /* Im aufgeklappten Handymenü stehen die Unterpunkte eingerückt darunter, immer sichtbar. */
  .nav-group { flex-direction: column; }
  .nav-sub, .nav-group:hover .nav-sub { display: flex; position: static; min-width: 0; padding: 0 0 0 16px; border: 0; box-shadow: none; background: none; }
}

/* 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 h1 { color: var(--title-color, var(--text)); }

/* Titelbild seitlich (hero: side): das Bild links in voller Höhe des Titelbereichs, Titel daneben. */
.hero-side { display: flex; align-items: stretch; }
.hero-side-image { width: clamp(120px, 28vw, 440px); flex: none; object-fit: cover; }
.hero-side .hero-text { margin: 0; align-self: center; }

.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; }

  /* Effekt „Titel fliegt herein“, nur auf der Startseite: federnd von links, die Unterzeile von rechts. */
  .fx-hero-intro.page-start .hero h1 { animation: fx-bounce-left 1s ease-out both; }
  .fx-hero-intro.page-start .hero .subtitle { animation: fx-bounce-right 1s ease-out both; }

  /* {.bildreihe .drehen}: die Bilder drehen sich beim Laden herein und beim Überfahren einmal halb
     herum. rotate statt transform, damit sich beides nicht in die Quere kommt. */
  .drehen img { animation: fx-rotate-in 1s ease-out both; transition: rotate 0.5s ease; }
  .drehen img:hover { rotate: 180deg; }

  .fx-split-cards .block-split > * { transition: rotate 0.35s ease; }
  .fx-split-cards .split-left .block-single:hover,
  .fx-split-cards .split-right .split-text:hover { rotate: -5deg; }
  .fx-split-cards .split-left .split-text:hover,
  .fx-split-cards .split-right .block-single:hover { rotate: 5deg; }
}

@keyframes fx-bounce-left {
  0% { opacity: 0; transform: translateX(-60vw); }
  60% { opacity: 1; transform: translateX(25px); }
  75% { transform: translateX(-10px); }
  90% { transform: translateX(5px); }
  100% { transform: none; }
}

@keyframes fx-bounce-right {
  0% { opacity: 0; transform: translateX(60vw); }
  60% { opacity: 1; transform: translateX(-25px); }
  75% { transform: translateX(10px); }
  90% { transform: translateX(-5px); }
  100% { transform: none; }
}

@keyframes fx-rotate-in {
  from { opacity: 0; transform: rotate(-200deg); }
  to { opacity: 1; transform: none; }
}

/* Effekt „Fläche“: Bild randlos in seiner Hälfte, Text daneben auf abgesetztem Grund, ohne Abstand –
   wie bei dorfbaerenkunst.de. Das Bild zeigt sich in seinem eigenen Format und gibt die Höhe vor;
   nur wo der Text höher ist (schmale Bildschirme), füllt es die Fläche und wird dafür beschnitten. */
.fx-split-panel .block-split { gap: 0; align-items: stretch; }
.fx-split-panel .block-split > .block-single { margin: 0; }
.fx-split-panel .block-split > .block-single img,
.fx-split-panel .split-half .block-single img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: cover; border-radius: 0; }
.fx-split-panel .block-split > .split-text { display: flex; flex-direction: column; justify-content: center; padding: clamp(20px, 4vw, 48px); background: var(--bg-raised); }
.fx-split-panel .split-text p:has(> .knopf) { margin-top: 0.4em; }

/* Effekt „Kacheln“: Bild und Text als zwei Karten auf abgesetztem Grund, wie bei launometer.de. */
/* Auf schmalen Bildschirmen ist die Textkarte oft höher als das Bild: dann füllt das Bild seine Karte. */
@media (max-width: 700px) {
  .fx-split-cards .block-split > .block-single { position: relative; min-height: 180px; }
  .fx-split-cards .block-split > .block-single img,
  .fx-split-cards .split-half .block-single img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; }
}
.fx-split-cards .block-split { gap: 16px; align-items: stretch; }
.fx-split-cards .block-split > .block-single { display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; border-radius: var(--card-radius, 20px); background: var(--bg-raised); }
.fx-split-cards .block-split > .block-single img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.fx-split-cards .block-split > .split-text { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; border-radius: var(--card-radius, 20px); background: var(--bg-raised); }
.fx-split-cards .split-text > :is(h1, h2):first-child::after { margin-left: auto; margin-right: auto; }

@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; }

/* Startseite mit Logo und ohne Titelbild: ein Briefkopf – Logo groß links, daneben Name,
   Unterzeile und Beschreibung in der Titelfarbe. */
/* Effekt „mittig“: Titel, Unterzeile und Beschreibung zentriert, der Weg zurück auch. */
.fx-hero-center .hero-text { text-align: center; }
.fx-hero-center .hero-text .description { margin-left: auto; margin-right: auto; }

.hero-brand { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
/* Auf dem Seitengrund statt dem abgesetzten: Logos haben oft einen weißen Rand, der sonst als Kante sichtbar wäre. */
.hero-plain:has(.hero-brand) { background: var(--bg); }
.hero-logo { width: clamp(76px, 13vw, 150px); height: auto; flex: none; }
.hero-brand h1 { text-shadow: 0 0 10px rgba(0, 0, 0, 0.18); }
.hero-brand .subtitle {
  margin: -0.15em 0 0 clamp(1.5rem, 9vw, 5.5rem);
  color: var(--title-color, var(--text));
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.7rem);
}
.hero-brand .description { margin-top: 8px; color: var(--title-color, var(--text)); font-size: clamp(0.95rem, 1.9vw, 1.3rem); }

.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); }
/* Effekt „Titel beim Überfahren“: Karten nur mit Bild zeigen dann ihren Titel auf hellem Schleier. */
.fx-card-hover-title .card-style-image .card-text {
  inset: 0;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--title-color, var(--text));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.fx-card-hover-title .card-style-image .card-text small { display: none; }
.fx-card-hover-title .card-style-image:is(:hover, :focus-visible) .card-text { opacity: 1; }

/* 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; }

/* Kontaktformular über die volle Breite: Beschriftung über dem Feld, Name und Vorname nebeneinander,
   auf dem Handy untereinander. */
.block-contact { scroll-margin-top: 80px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--text-quiet); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-raised);
  /* Kräftiger als --line: Feldränder brauchen 3:1 gegen den Feldgrund, sonst sieht man das Feld nicht. */
  border: 1px solid var(--field-line, var(--line));
  border-radius: var(--radius);
  padding: 9px 11px;
}
.contact-form textarea { resize: vertical; min-height: 8em; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-required { color: var(--accent); }
.contact-form .contact-consent { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); }
.contact-consent input { margin-top: 0.25em; accent-color: var(--accent); }
.contact-consent a { color: var(--accent); }
/* Die Falle für Spam-Programme: aus dem Bild geschoben statt display:none, das manche erkennen. */
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }
.contact-actions button {
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 10px 26px;
  cursor: pointer;
}
.contact-actions button:disabled { opacity: 0.6; cursor: wait; }
.contact-status { color: var(--text-quiet); }
.contact-status.error { color: #d9534f; }

@media (max-width: 700px) {
  .contact-row { grid-template-columns: minmax(0, 1fr); }
}
.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; }
.albums-intro { margin-bottom: 0; }
.albums-more { margin-top: 0; text-align: right; }
.albums-more a { color: var(--accent); text-decoration: none; font-weight: 600; }
.albums-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; }
/* Ein breites Logo darf schmaler werden, statt den Text in die Nachbarspalte zu schieben. */
.footer-brand { min-width: 0; }
.footer-brand img.footer-logo { width: auto; height: auto; max-height: 56px; max-width: 100%; flex: 0 1 auto; min-width: 0; border-radius: 0; }
.footer-brand strong { display: block; color: var(--title-color, var(--text)); 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;
}

/* Aus Markdown: [Text](Adresse){.knopf} wird ein Knopf in der Akzentfarbe. */
a.knopf {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: filter 0.15s ease;
}
a.knopf:hover { filter: brightness(1.1); }

/* Aus Markdown: {.bildreihe} über einem Absatz mit Bildern stellt sie nebeneinander, etwa Symbole
   oder Logos – über die volle Breite, nicht nur die Lesebreite des Texts. */
.block-text:has(> .bildreihe) { max-width: none; }
.bildreihe { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 1.6vw, 20px); }
.bildreihe img { display: inline-block; height: clamp(40px, 8vw, 96px); width: auto; margin: 0; border-radius: 0; }

/* Aus Markdown: {.mittig} an Überschrift oder Absatz setzt ihn mittig; der Abschnitt nutzt dann die
   volle Breite, sonst stünde die Mitte links. */
.block-text:has(> .mittig) { max-width: none; }
.mittig { text-align: center; }
.mittig::after { margin-left: auto; margin-right: auto; }

/* Filterleiste über Karten mit Schlagwörtern; ohne Skript ginge sie nicht, dann bleibt sie weg. */
.card-filter { display: none; }
.js .card-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; max-width: var(--width); margin: 24px auto 0; padding: 0 var(--gutter); }
.card-filter button {
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--title-color, var(--text));
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 4px 2px;
  cursor: pointer;
  opacity: 0.75;
}
.card-filter button:hover { opacity: 1; }
.card-filter button[aria-pressed="true"] { opacity: 1; border-bottom-color: var(--accent); }
.card[hidden] { display: none; }
