/* stependium.de – stil.css
   Version 1.6 – Stand 2026-11-19
   1.1: Monogramm-Kacheln, Brotkrumen, Abschnitte und Listen für Unterseiten
   1.2: Reise-Blöcke und Slideshow
   1.3: Bilder ganz zeigen (contain), Videos, Großansicht, Fotonachweis
   1.4: Textseiten aus Org-Mode (Impressum, Datenschutz, IT & Freiheit)
   1.5: Briefliste (Schauerberichte)
   1.6: Briefliste: Links sichtbar (Signalfarbe, PDF-Hinweis)
   Gemeinsames Stylesheet für alle Seiten. Keine fremden Server, nur Systemschriften.
   Layout: Kopf – Inhalt – Fuß untereinander (Flexbox, Spalte),
           Kacheln nebeneinander mit Umbruch (Flexbox, Zeile + wrap). */

/* ---------- Farben und Schriften (hell) ---------- */
:root {
  --see:      #1d3349;   /* Marineblau: Kopf, Fuß, Überschriften */
  --see-hell: #2f5274;   /* Kachel-Bildfeld */
  --sand:     #f1ebe0;   /* Seitenhintergrund */
  --papier:   #fbf8f3;   /* Kacheln */
  --text:     #23272b;
  --leise:    #5d6670;   /* Nebentext */
  --signal:   #c4561f;   /* Signalorange: Links, Hervorhebung */
  --linie:    #ddd3c3;

  --schrift:  system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --titel:    "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --mono:     ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;

  --breite:   70rem;     /* maximale Inhaltsbreite */
}

/* ---------- Dunkel (folgt dem Gerät) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --see: #0f1c29; --see-hell: #22405e; --sand: #141b22; --papier: #1b242d;
    --text: #e6e1d8; --leise: #9aa5b0; --signal: #e8834f; --linie: #2c3844;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --see: #0f1c29; --see-hell: #22405e; --sand: #141b22; --papier: #1b242d;
  --text: #e6e1d8; --leise: #9aa5b0; --signal: #e8834f; --linie: #2c3844;
  color-scheme: dark;
}

/* ---------- Grundgerüst ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;               /* Kopf, Inhalt, Fuß untereinander … */
  flex-direction: column;
  background: var(--sand);
  color: var(--text);
  font: 1rem/1.6 var(--schrift);
}
main { flex: 1; }              /* … und der Inhalt füllt, damit der Fuß unten bleibt */

/* Innenbreite mit Seitenrand, auch neben Systemleisten am Handy */
.innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding-left:  max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: var(--signal); }
a:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* ---------- Kopf ---------- */
.kopf { background: var(--see); color: #f4efe6; }
.kopf .innen {
  display: flex;               /* Name links, Menü rechts … */
  flex-wrap: wrap;             /* … und am Handy untereinander */
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-block: 1.1rem;
}
.marke {
  font: 600 1.6rem/1 var(--titel);
  letter-spacing: .01em;
  color: inherit;
  text-decoration: none;
}
.marke span { color: var(--signal); }
.menue { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.menue a {
  color: #d9d2c6;
  text-decoration: none;
  font-size: .95rem;
}
.menue a:hover, .menue a[aria-current] { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Einleitung ---------- */
.einleitung { padding-block: 2.5rem 1.5rem; }
.einleitung h1 {
  margin: 0 0 .6rem;
  font: 500 clamp(1.7rem, 4vw, 2.4rem)/1.2 var(--titel);
  color: var(--see);
  text-wrap: balance;
}
.einleitung p { margin: 0; max-width: 60ch; color: var(--leise); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .einleitung h1 { color: var(--text); } }
:root[data-theme="dark"] .einleitung h1 { color: var(--text); }

/* ---------- Kacheln ---------- */
.kacheln {
  display: flex;
  flex-wrap: wrap;             /* DIE Zeile für Laptop/Tablet/Handy:      */
  gap: 1rem;                   /* passt keine weitere Kachel daneben,     */
  padding-block: 0 3rem;       /* rutscht sie in die nächste Zeile        */
}
.kachel {
  flex: 1 1 15rem;             /* Mindestbreite 15rem, sonst gleich breit */
  display: flex;
  flex-direction: column;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 6px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.kachel:hover { transform: translateY(-2px); border-color: var(--signal); }
.kachel:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.bild {                         /* später durch Foto ersetzbar */
  aspect-ratio: 16 / 9;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--see-hell);
  color: #f4efe6;
}
.bild svg { width: 3.2rem; height: 3.2rem; }

.kachel .text { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.kachel h2 { margin: 0; font: 600 1.2rem/1.3 var(--titel); }
.kachel p { margin: 0; color: var(--leise); font-size: .95rem; }
.kachel .weiter { margin-top: auto; padding-top: .5rem; color: var(--signal); font-size: .9rem; }
.schloss { font-size: .8rem; color: var(--leise); }

/* ---------- Fuß ---------- */
.fuss { background: var(--see); color: #c9c2b6; font-size: .85rem; }
.fuss .innen {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: 1.2rem;
}
.fuss a { color: #e9e2d6; }
.fuss .position { font-family: var(--mono); letter-spacing: .03em; }

@media (prefers-reduced-motion: reduce) { .kachel { transition: none; } .kachel:hover { transform: none; } }

/* ---------- 1.1: Unterseiten ---------- */
.pfad { padding-block: 1.2rem 0; font-size: .85rem; color: var(--leise); }
.pfad a { color: var(--leise); }

.monogramm {                    /* Großbuchstabe statt Symbol, z. B. Familien */
  font: 500 3.4rem/1 var(--titel);
  letter-spacing: .02em;
}

.abschnitte {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 0 3rem;
}
.abschnitt {
  flex: 1 1 18rem;
  min-width: 0;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 1.1rem 1.2rem 1.3rem;
}
.abschnitt h2 { margin: 0 0 .5rem; font: 600 1.2rem/1.3 var(--titel); }
.abschnitt p { margin: 0 0 .6rem; color: var(--leise); font-size: .95rem; }
.abschnitt ul { margin: 0; padding-left: 1.1rem; }
.abschnitt li { margin: .2rem 0; }
.hinweis { font-size: .85rem; color: var(--leise); }

/* ---------- 1.2: Reisen ---------- */
.reisen { display: flex; flex-direction: column; gap: 2.5rem; padding-block: 0 3rem; }

.reise {
  display: flex;               /* Slideshow links, Text rechts …        */
  flex-wrap: wrap;             /* … am Handy untereinander               */
  gap: 1.25rem 2rem;
  align-items: flex-start;
}
.reise .schau-rahmen { flex: 3 1 22rem; min-width: 0; }
.reise .beschreibung { flex: 2 1 16rem; min-width: 0; }
.reise h2 { margin: 0 0 .2rem; font: 600 1.6rem/1.2 var(--titel); color: var(--text); }
.reise .eckdaten {
  margin: 0 0 .8rem;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--leise);
}
.reise p { margin: 0 0 .9rem; max-width: 60ch; }
.folgt { color: var(--leise); font-size: .9rem; }

/* Slideshow: ohne Script ein wischbarer Streifen, mit Script Knöpfe und Zähler */
.schau-rahmen { position: relative; }
.schau {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 6px;
  background: var(--see-hell);
  scrollbar-width: none;
}
.schau::-webkit-scrollbar { display: none; }
.schau:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.schau figure {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 100%;
}
/* contain: das ganze Foto bleibt sichtbar, auch Hochformat */
.schau img, .schau video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0d1620; }
.schau a.gross { display: block; height: 100%; cursor: zoom-in; }
.schau figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem .9rem .6rem;
  background: linear-gradient(transparent, rgba(10, 20, 30, .7));
  color: #f4efe6;
  font-size: .9rem;
}
.schau .platzhalter {             /* bis das Foto da ist */
  display: flex; align-items: center; justify-content: center;
  color: #c9d3dd; font: 500 1.1rem/1.3 var(--titel);
}
.schau-knopf {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 2.4rem; height: 2.4rem;
  border: 0; border-radius: 50%;
  background: rgba(244, 239, 230, .85);
  color: #1d3349;
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
}
.schau-knopf:hover { background: #fff; }
.schau-knopf:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.schau-knopf.zurueck { left: .6rem; }
.schau-knopf.vor { right: .6rem; }
.schau-zaehler {
  position: absolute; top: .6rem; right: .6rem;
  padding: .15rem .5rem; border-radius: 3px;
  background: rgba(10, 20, 30, .6); color: #f4efe6;
  font: .78rem/1.4 var(--mono);
}
@media (prefers-reduced-motion: reduce) { .schau { scroll-behavior: auto; } }
.schau .platzhalter figcaption { position: static; background: none; padding: 1rem; text-align: center; font: inherit; }

/* ---------- 1.3 ---------- */
.schau figure:has(video) figcaption {        /* bei Videos oben, damit die Bedienleiste frei bleibt */
  top: 0; bottom: auto;
  padding: .6rem .9rem 1.5rem;
  background: linear-gradient(rgba(10, 20, 30, .7), transparent);
}
.foto-nachweis { margin: .4rem 0 0; font-size: .8rem; color: var(--leise); }

/* ---------- 1.4: Org-Mode-Seiten (org-publish) ----------
   Org liefert: #preamble (unser Kopf), #content (Text), #postamble (unser Fuß) */
#preamble, #postamble { margin: 0; padding: 0; }
#content {
  flex: 1;
  width: 100%;
  max-width: 48rem;              /* Lesebreite für Fließtext */
  margin: 0 auto;
  padding-left:  max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 2.5rem 3rem;
}
#content .title {
  margin: 0 0 1.5rem;
  font: 500 clamp(1.7rem, 4vw, 2.4rem)/1.2 var(--titel);
  text-wrap: balance;
}
#content h2 { margin: 2.2rem 0 .6rem; font: 600 1.4rem/1.3 var(--titel); }
#content h3 { margin: 1.6rem 0 .4rem; font: 600 1.15rem/1.3 var(--titel); }
#content h4 { margin: 1.2rem 0 .3rem; font-size: 1rem; }
#content p { margin: 0 0 .9rem; }
#content ul, #content ol { padding-left: 1.3rem; }

/* Org-Tabellen: am Handy waagerecht scrollbar statt die Seite zu sprengen */
#content table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .92rem;
}
#content th, #content td { padding: .35rem .7rem; vertical-align: top; text-align: left; }
#content thead th { border-bottom: 2px solid var(--see); color: var(--leise); font-weight: 600; }
#content tbody { border-top: 1px solid var(--linie); }      /* Org: |---| trennt Gruppen */
#content td.org-center, #content th.org-center { text-align: center; white-space: nowrap; }
#content td:first-child { font-weight: 600; color: var(--leise); }

/* ---------- 1.5: Briefliste ---------- */
.briefe { list-style: none; margin: 0; padding: 0; }
.briefe li { margin: 0; border-top: 1px solid var(--linie); }
.briefe li:first-child { border-top: 0; }
.briefe a { display: flex; gap: .8rem; padding: .45rem 0; text-decoration: none; color: var(--text); }
.briefe a:hover { color: var(--signal); }
.briefe .datum { flex: 0 0 7.5rem; font-variant-numeric: tabular-nums; color: var(--leise); }

/* ---------- 1.6: Briefliste, Links als Links erkennbar ---------- */
.briefe .art { color: var(--signal); }
.briefe a:hover .art, .briefe a:focus-visible .art { text-decoration: underline; text-underline-offset: 3px; }
.briefe .pdf {
  margin-left: auto;              /* rechtsbündig */
  align-self: center;
  padding: 0 .35rem;
  border: 1px solid var(--linie);
  border-radius: 3px;
  font: .7rem/1.5 var(--mono);
  color: var(--leise);
}
.einleitung p + p { margin-top: .6rem; }
