/* ------------------------------------------------------------------
   noemi-galerie
   Ruhige, fotozentrierte Gedenkseite.

   Haltung: Die Fotos tragen die Seite, die Typografie tritt zurueck.
   Bewusst KEINE ueberdimensionierte Display-Typografie - bei einer
   Gedenkseite waere das unpassend laut.
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Playfair Display';
  src: url('fonts/playfair-display.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/source-serif-4.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  font-style: normal;
}

:root {
  --grund: #fafafa;
  --flaeche: #ffffff;
  --schrift: #09090b;
  --schrift-leise: #52525b;
  --rahmen: #e4e4e7;
  --akzent: #18181b;

  /* Grosszuegige Abstaende - Dichte bewusst niedrig */
  --raum-1: 0.5rem;
  --raum-2: 1rem;
  --raum-3: 1.5rem;
  --raum-4: 2.5rem;
  --raum-5: 4rem;
  --raum-6: 6rem;

  --serif-anzeige: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --serif-text: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --breite: 76rem;
  --rund: 2px;
  /* Eckenradius fuer alle Bildkacheln */
  --rund-bild: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0c0c0e;
    --flaeche: #141417;
    --schrift: #f4f4f5;
    --schrift-leise: #a1a1aa;
    --rahmen: #27272a;
    --akzent: #f4f4f5;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font-family: var(--serif-text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--raum-2);
  top: var(--raum-2);
  z-index: 100;
  background: var(--flaeche);
  color: var(--schrift);
  padding: var(--raum-2) var(--raum-3);
  border: 1px solid var(--rahmen);
}

/* ---------- Sprachumschalter ---------- */

.sprachen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: var(--raum-3) var(--raum-3) 0;
  display: flex;
  justify-content: flex-end;
  gap: var(--raum-1);
}

.sprache-knopf {
  /* Trefferflaeche mindestens 44px hoch */
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--schrift-leise);
  border-radius: var(--rund-bild);
  border: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.sprache-knopf:hover {
  color: var(--schrift);
  border-color: var(--rahmen);
}

.sprache-knopf.sprache-an {
  color: var(--schrift);
  border-color: var(--rahmen);
  background: var(--flaeche);
}

.sprache-knopf:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

@media (max-width: 30rem) {
  .sprachen { justify-content: center; }
}

/* Sprachwahl ohne JavaScript (Wurzelseite) */
.sprachwahl {
  list-style: none;
  padding: 0;
  margin: 0 auto var(--raum-6);
  max-width: 20rem;
  text-align: center;
}
.sprachwahl li { margin: var(--raum-2) 0; }
.sprachwahl a {
  display: block;
  padding: var(--raum-2);
  border: 1px solid var(--rahmen);
  border-radius: var(--rund-bild);
  text-decoration: none;
  font-family: var(--serif-anzeige);
}

/* ---------- Kopf ---------- */

.titel {
  max-width: var(--breite);
  margin: 0 auto;
  padding: var(--raum-6) var(--raum-3) var(--raum-5);
  text-align: center;
}

.titel h1 {
  font-family: var(--serif-anzeige);
  /* Ruhig dimensioniert - kein Display-Gigantismus */
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

.beiname {
  font-family: var(--serif-anzeige);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--schrift-leise);
  margin: var(--raum-1) 0 0;
}

/* Lebensstationen unter dem Namen. Bricht auf schmalen Schirmen um,
   die Trennpunkte bleiben dabei an den Staedten haengen. */
.staedte {
  margin: var(--raum-3) auto 0;
  max-width: 38rem;
  color: var(--schrift-leise);
  font-family: var(--serif-anzeige);
  font-size: clamp(0.82rem, 1.6vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.9;
  text-wrap: balance;
}

/* Staedtenamen nie mitten im Wort umbrechen ("Los Angeles") */
.stadt { white-space: nowrap; }

/* Trennpunkt: U+00B7 sitzt auf halber x-Hoehe. Weil die Zeile in Versalien
   gesetzt ist, wirkt er dort zu tief - deshalb auf die Mitte der
   Versalhoehe angehoben. */
.staedte-punkt {
  display: inline-block;
  margin: 0 0.5em;
  opacity: 0.55;
  transform: translateY(-0.16em);
  /* Die Sperrung der Zeile soll den Punkt nicht vom Wort wegschieben */
  letter-spacing: 0;
}

.daten {
  color: var(--schrift-leise);
  /* Bewusst KEINE Versalien: die Lebensdaten sollen sich ruhig lesen,
     nicht als Auszeichnungszeile wirken. */
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  margin: var(--raum-3) 0 0;
}

/* Genealogische Zeichen: etwas kleiner und leiser als die Datumsangabe,
   damit sie kennzeichnen statt zu dominieren. */
.lebenszeichen {
  margin-right: 0.4em;
  /* Etwas groesser als die Kapitaelchen daneben: die Zeichen sollen
     kennzeichnen, nicht dezent verschwinden. */
  font-size: 1.15em;
  line-height: 1;
  /* Nicht sperren wie der restliche Text */
  letter-spacing: 0;
}

/* Nur fuer Vorleseprogramme: "geboren" / "gestorben" ausgeschrieben */
.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.intro {
  max-width: 34rem;
  margin: var(--raum-4) auto 0;
  color: var(--schrift-leise);
  font-size: 1.05rem;
  text-wrap: pretty;
}

.titel--album { padding-bottom: var(--raum-4); }

.rueck {
  margin: 0 0 var(--raum-4);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.rueck a {
  color: var(--schrift-leise);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.rueck a:hover { color: var(--schrift); border-bottom-color: var(--rahmen); }

.hinweis {
  max-width: 34rem;
  margin: var(--raum-3) auto 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--schrift-leise);
}

/* ---------- Albumuebersicht ---------- */

.abschnitt {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 var(--raum-3) var(--raum-6);
}

.abschnitt-titel {
  font-family: var(--serif-anzeige);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--schrift-leise);
  padding-bottom: var(--raum-2);
  border-bottom: 1px solid var(--rahmen);
  margin: 0 0 var(--raum-4);
}

.karten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--raum-4) var(--raum-3);
}

.karte {
  text-decoration: none;
  display: block;
}

.karte-bild {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--rund-bild);
}

.karte-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 220ms ease;
}

.karte:hover .karte-bild img,
.karte:focus-visible .karte-bild img { opacity: 0.82; }

.karte:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 4px;
}

.karte-text { display: block; padding-top: var(--raum-2); }

.karte-titel {
  display: block;
  font-family: var(--serif-anzeige);
  font-size: 1.1rem;
  line-height: 1.3;
}

.karte-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--schrift-leise);
}

/* ---------- Bildraster ---------- */

.raster {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 var(--raum-3);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--raum-2);
}

@media (min-width: 60rem) {
  .raster { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
}

.bild {
  padding: 0;
  border: 1px solid var(--rahmen);
  border-radius: var(--rund-bild);
  background: var(--flaeche);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  /* Mindestens 44px Trefferflaeche ist durch die Rastergroesse gesichert */
}

/* Safari rundet das Kindbild nicht immer mit - deshalb zusaetzlich am img */
.bild img,
.karte-bild img { border-radius: inherit; }

.bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 200ms ease;
}

.bild:hover img { opacity: 0.85; }

.bild:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 3px;
}

/* ---------- Videokacheln ---------- */

.bild--video { position: relative; }

.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
  /* Sanfte Abdunklung, damit das Symbol auf hellen Bildern lesbar bleibt */
  background: radial-gradient(circle at center, rgba(9, 9, 11, 0.45) 0 4.5rem, transparent 4.5rem);
  transition: opacity 200ms ease;
}

.video-play svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.bild--video:hover .video-play { opacity: 0.85; }

/* ---------- Blaettern ---------- */

.blaetter {
  max-width: var(--breite);
  margin: var(--raum-6) auto 0;
  padding: var(--raum-4) var(--raum-3) 0;
  border-top: 1px solid var(--rahmen);
  display: flex;
  justify-content: space-between;
  gap: var(--raum-3);
  font-size: 0.95rem;
}

.blatt-nav {
  color: var(--schrift-leise);
  text-decoration: none;
  transition: color 180ms ease;
  max-width: 45%;
}
.blatt-nav:hover { color: var(--schrift); }
.blatt-nav--rechts { margin-left: auto; text-align: right; }

/* ---------- Lightbox ---------- */

.lupe {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--raum-4) var(--raum-2);
}

.lupe[hidden] { display: none; }

.lupe-inhalt {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--raum-2);
}

.lupe-inhalt img,
.lupe-inhalt video {
  max-width: min(96vw, 1600px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lupe-inhalt video { background: #000; border-radius: var(--rund-bild); }
.lupe-inhalt video[hidden] { display: none; }

.lupe-inhalt figcaption {
  color: #d4d4d8;
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.2em;
}

.lupe button {
  position: absolute;
  background: none;
  border: 1px solid rgba(244, 244, 245, 0.25);
  color: #f4f4f5;
  cursor: pointer;
  border-radius: var(--rund);
  /* Trefferflaeche deutlich ueber 44px */
  width: 3rem;
  height: 3rem;
  font-size: 1.4rem;
  line-height: 1;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.lupe button:hover { background: rgba(244, 244, 245, 0.12); }
.lupe button:focus-visible { outline: 2px solid #f4f4f5; outline-offset: 2px; }

.lupe-zu { top: var(--raum-2); right: var(--raum-2); }
.lupe-vor { left: var(--raum-2); top: 50%; transform: translateY(-50%); }
.lupe-nach { right: var(--raum-2); top: 50%; transform: translateY(-50%); }

/* ---------- Fuss ---------- */

.fuss {
  max-width: var(--breite);
  margin: 0 auto;
  padding: var(--raum-5) var(--raum-3) var(--raum-5);
  border-top: 1px solid var(--rahmen);
  text-align: center;
  color: var(--schrift-leise);
  font-size: 0.85rem;
}
.fuss p { margin: 0; }

/* ---------- Bewegung zurueckfahren ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
