/* Familienalbum – warmes, ruhiges Album. Große Schrift, große Flächen, klare Kontraste. */
:root {
  --bg: #fbf7f0;
  --papier: #ffffff;
  --sand: #f3ebdf;
  --linie: #e2d5c2;
  --text: #2b2420;
  --leise: #66584c;
  --akzent: #a94c25;
  --akzent-dunkel: #7f3517;
  --akzent-hell: #f8e6dc;
  --buch: #2b6448;
  --buch-hell: #e1efe7;
  --gold: #f2c14e;
  --gold-hell: #fdf3d6;
  --gold-text: #4a3500;
  --fehler: #a32019;
  --fehler-hell: #fbe6e4;
  --fokus: #1a5fb4;
  --radius: 16px;
  --schatten: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
a { color: var(--akzent-dunkel); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.springen { position: absolute; left: -9999px; top: 0; background: var(--papier); padding: 12px 18px; z-index: 50; }
.springen:focus { left: 12px; top: 12px; }

.laedt { padding: 48px 16px; text-align: center; color: var(--leise); }

/* ---------- Kopfzeile ---------- */
.kopf { position: sticky; top: 0; z-index: 20; background: rgba(251, 247, 240, .96); border-bottom: 1px solid var(--linie);
  padding: max(8px, env(safe-area-inset-top)) 16px 8px; backdrop-filter: blur(6px); }
.kopf-innen { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.marke { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.marke svg { width: 30px; height: 30px; flex: none; }
.marke small { font-family: var(--sans); font-weight: 600; font-size: .95rem; color: var(--akzent-dunkel); }
.nav { display: none; margin-left: auto; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text); white-space: nowrap; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 1rem; }
.nav a:hover { background: var(--sand); }
.nav a[aria-current="page"] { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.kopf-start { margin-left: auto; }
@media (min-width: 1100px) {
  .nav { display: flex; flex-wrap: nowrap; }
  .knopf.kopf-start { display: none; }
}

.seite { max-width: 1180px; margin: 0 auto; padding: 20px 16px 120px; }
.schmal { max-width: 760px; }

/* ---------- Schaltflächen ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px; border-radius: 14px;
  font: inherit; font-size: 1.05rem; font-weight: 650; line-height: 1.2; text-align: center; text-decoration: none;
  border: 2px solid var(--akzent); background: var(--papier); color: var(--akzent-dunkel); cursor: pointer;
  transition: background .15s, transform .05s;
}
.knopf:hover { background: var(--akzent-hell); }
.knopf:active { transform: translateY(1px); }
.knopf.haupt { background: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
.knopf.riesig { min-height: 76px; font-size: 1.35rem; border-radius: 20px; padding: 16px 28px; width: 100%; }
.knopf.breit { width: 100%; }
.knopf.leise { border-color: var(--linie); color: var(--text); background: var(--papier); }
.knopf.leise:hover { background: var(--sand); }
.knopf.gefahr { border-color: var(--fehler); color: var(--fehler); }
.knopf.gefahr:hover { background: var(--fehler-hell); }
.knopf.gefahr.haupt { background: var(--fehler); color: #fff; }
.knopf.klein { min-height: 44px; padding: 8px 14px; font-size: .95rem; border-radius: 12px; }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.knopf svg { width: 24px; height: 24px; flex: none; }
.textlink { background: none; border: 0; padding: 10px 4px; font: inherit; color: var(--akzent-dunkel); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Markierungen: „Mein Highlight“ (gold, Stern) und „Ins Fotobuch“ (grün, Buch) – bewusst verschieden */
.knopf.highlight { border-color: #c99a1c; color: var(--gold-text); }
.knopf.highlight:hover { background: var(--gold-hell); }
.knopf.highlight[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }
.knopf.buch { border-color: var(--buch); color: var(--buch); }
.knopf.buch:hover { background: var(--buch-hell); }
.knopf.buch[aria-pressed="true"] { background: var(--buch); color: #fff; }

.marke-hl, .marke-buch { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.2; }
.marke-hl { background: var(--gold); color: var(--gold-text); }
.marke-buch { background: var(--buch); color: #fff; }
.marke-hl svg, .marke-buch svg { width: 14px; height: 14px; }

.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.knopfreihe.mitte { justify-content: center; }

/* ---------- Karten & Abschnitte ---------- */
.karte { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; box-shadow: var(--schatten); margin-bottom: 18px; }
.karte.sand { background: var(--sand); box-shadow: none; }
.karte.gruen { background: var(--buch-hell); border-color: #b9d6c6; box-shadow: none; }
.karte.warnung { background: var(--gold-hell); border-color: #ecd18b; box-shadow: none; }
.karte.fehler { background: var(--fehler-hell); border-color: #efb8b3; box-shadow: none; }
.abschnitt { margin: 34px 0 14px; }
.leise { color: var(--leise); }
.klein { font-size: .9rem; }
.mittig { text-align: center; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; text-decoration: none; font-weight: 600; min-height: 44px; }

.raster-start { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .raster-start { grid-template-columns: 1fr 1fr; } }
.kachel-link { display: block; text-decoration: none; color: var(--text); background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--schatten); min-height: 110px; }
.kachel-link:hover { border-color: var(--akzent); }
.kachel-link strong { display: block; font-family: var(--serif); font-size: 1.35rem; margin-bottom: 4px; color: var(--akzent-dunkel); }
.kachel-link span { color: var(--leise); }

.begruessung { padding: 10px 0 18px; }
.begruessung h1 { font-size: 2.3rem; margin-bottom: 4px; }

/* ---------- Fotoraster ---------- */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .fotos { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; } }
.fotos.klein-raster { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.foto { position: relative; display: flex; flex-direction: column; gap: 6px; }
.foto-bild { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sand); border: 0; padding: 0; cursor: pointer; }
.foto-bild img { width: 100%; height: 100%; object-fit: cover; }
.foto-bild .marken { position: absolute; left: 6px; top: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.foto-bild .wer { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; color: #fff; font-size: .85rem; font-weight: 600; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.ohne-vorschau { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 10px; font-size: .85rem; color: var(--leise); }
.foto .knopf { width: 100%; }

/* ---------- Monate & Ereignisse ---------- */
.monat { margin: 36px 0 10px; }
.monat > h2 { border-bottom: 2px solid var(--linie); padding-bottom: 6px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.monat > h2 small { font-family: var(--sans); font-size: .95rem; font-weight: 500; color: var(--leise); }
.monat.leer { margin: 14px 0; color: var(--leise); display: flex; align-items: baseline; gap: 12px; border-bottom: 1px dashed var(--linie); padding-bottom: 8px; }
.monat.leer h2 { font-size: 1.15rem; color: var(--leise); margin: 0; border: 0; padding: 0; }
.monat.leer p { margin: 0; font-size: .95rem; }
.gruppe { margin: 18px 0 26px; }
.gruppe-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.gruppe-kopf h3 { margin: 0; font-size: 1.3rem; }
.gruppe-kopf h3 a { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--akzent-hell); }
.gruppe-kopf h3 a:hover { border-color: var(--akzent); }

.texte { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 900px) { .texte { grid-template-columns: 1fr 1fr; } }
.text-karte { background: var(--papier); border: 1px solid var(--linie); border-left: 5px solid var(--akzent); border-radius: 12px; padding: 14px 16px; }
.text-karte.im-buch { border-left-color: var(--buch); }
.text-karte .inhalt { font-family: var(--serif); font-size: 1.08rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-karte .fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: .9rem; color: var(--leise); }
.text-karte .fuss .knopf { margin-left: auto; }

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { font: inherit; font-size: .95rem; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--linie); background: var(--papier); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }

.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--papier); border-top: 1px solid var(--linie);
  box-shadow: 0 -4px 16px rgba(60, 40, 20, .08); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.leiste-innen { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Formulare ---------- */
label.feld { display: block; font-weight: 650; margin: 14px 0 6px; }
input[type="text"], input[type="date"], select, textarea {
  font: inherit; font-size: 1.05rem; width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--linie); background: var(--papier); color: var(--text); min-height: 52px;
}
textarea { min-height: 150px; resize: vertical; font-family: var(--serif); line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--fokus); outline: none; box-shadow: 0 0 0 3px rgba(26, 95, 180, .25); }
.speicherstatus { min-height: 1.6em; font-size: .95rem; color: var(--leise); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.speicherstatus.ok { color: var(--buch); }
.speicherstatus.fehler { color: var(--fehler); font-weight: 600; }

.auswahl-liste { display: grid; gap: 10px; }
@media (min-width: 700px) { .auswahl-liste { grid-template-columns: 1fr 1fr; } }
.option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; border: 2px solid var(--linie); border-radius: 14px; background: var(--papier); cursor: pointer; }
.option:hover { border-color: var(--akzent); }
.option input { width: 24px; height: 24px; accent-color: var(--akzent); flex: none; margin: 0; }
.option:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.option .titel { font-weight: 650; display: block; }
.option .zusatz { font-size: .9rem; color: var(--leise); display: block; }

.monatswahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .monatswahl { grid-template-columns: repeat(4, 1fr); } }
.monatswahl .knopf { min-height: 52px; min-width: 0; padding: 8px 4px; font-size: .98rem; }
.monatswahl .knopf[aria-pressed="true"] { background: var(--akzent); color: #fff; }

/* ---------- Hochladen ---------- */
.schritte { display: flex; gap: 6px; margin: 4px 0 20px; list-style: none; padding: 0; font-size: .95rem; }
.schritte li { flex: 1; padding: 10px 8px; border-radius: 12px; background: var(--sand); color: var(--leise); text-align: center; font-weight: 600; }
.schritte li[aria-current="step"] { background: var(--akzent); color: #fff; }
.schritte li.erledigt { background: var(--buch-hell); color: var(--buch); }
.waehlen-flaeche { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 40px 20px;
  border: 3px dashed var(--linie); border-radius: 24px; background: var(--papier); }
.waehlen-flaeche svg { width: 64px; height: 64px; color: var(--akzent); }
.datei-eingabe { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
label.knopf:focus-within { outline: 3px solid var(--fokus); outline-offset: 3px; }

.fortschritt { height: 14px; background: var(--sand); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.fortschritt > div { height: 100%; background: var(--buch); border-radius: 999px; transition: width .3s; }
.hoch-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.hoch { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sand); }
.hoch img { width: 100%; height: 100%; object-fit: cover; }
.hoch .zustand { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: .75rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); }
.hoch.fertig .zustand { background: var(--buch); }
.hoch.fehler { outline: 3px solid var(--fehler); }
.hoch.fehler .zustand { background: var(--fehler); }
.hoch.doppelt .zustand, .hoch.abgelehnt .zustand { background: #6b5d52; }
.hoch.doppelt img, .hoch.abgelehnt img { opacity: .45; }
.hoch .name { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; text-align: center; font-size: .75rem; color: var(--leise); overflow-wrap: anywhere; }
.hoch .balken { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); }
.erfolg-zeichen { width: 84px; height: 84px; border-radius: 50%; background: var(--buch); color: #fff; display: grid; place-items: center; margin: 10px auto 16px; }
.erfolg-zeichen svg { width: 48px; height: 48px; }

/* ---------- Fotoansicht ---------- */
.detail { display: grid; gap: 22px; }
@media (min-width: 980px) { .detail { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; } }
.detail-bild { background: #2b2420; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; min-height: 240px; }
.detail-bild img { max-height: 62vh; width: auto; max-width: 100%; object-fit: contain; }
.detail-bild .ohne-vorschau { color: #e8dccb; padding: 50px 20px; }
.blaettern { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.info-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.info-zeile dt { font-weight: 650; min-width: 120px; }
.info-zeile dd { margin: 0; flex: 1; min-width: 160px; }
.info-zeile .textlink { padding: 4px; min-height: 40px; }
dl { margin: 0 0 16px; }
.fehlt { color: var(--fehler); font-weight: 650; }

/* ---------- Dialog & Hinweis ---------- */
.dialog { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--text); background: var(--papier); }
.dialog::backdrop { background: rgba(43, 36, 32, .5); }
.dialog-innen { padding: 22px; }
.dialog h2 { font-size: 1.45rem; }
.dialog .knopfreihe { margin-top: 20px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; background: var(--text); color: #fff;
  border-radius: 16px; padding: 12px 14px 12px 20px; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast .knopf { min-height: 44px; padding: 8px 14px; border-color: #fff; background: transparent; color: #fff; font-size: .95rem; }
.toast .knopf:hover { background: rgba(255, 255, 255, .15); }
body:has(.leiste) .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }

.leer-zustand { text-align: center; padding: 34px 20px; }
.leer-zustand p { color: var(--leise); max-width: 460px; margin: 0 auto 18px; }
.fertig-liste { list-style: none; padding: 0; margin: 0; }
.fertig-liste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.fertig-liste li:last-child { border-bottom: 0; }
.status-fertig { color: var(--buch); font-weight: 700; }
.status-sammelt { color: var(--leise); font-weight: 600; }
.link-box { background: var(--sand); border-radius: 12px; padding: 12px; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; margin: 10px 0; }
.mitglied { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.beispiel-hinweis { background: #fff3c4; border-bottom: 1px solid #ecd18b; text-align: center; padding: 6px 12px; font-size: .9rem; font-weight: 600; }

@media (min-width: 980px) { .detail-bild img { max-height: 78vh; } }

/* ---------- Seitenplan ---------- */
.planer-kopf { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin: 28px 0 14px; }
.seitenkarte { padding: 18px; }
.seiten-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.seiten-kopf h2 { margin: 0; }
.seiten-kopf h2 small { font-family: var(--sans); font-size: .95rem; font-weight: 500; color: var(--leise); }
.seiten-kopf .knopfreihe { margin-left: auto; gap: 8px; }
.seiten-inhalt { display: grid; gap: 18px; }
@media (min-width: 980px) { .seiten-inhalt { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; } }
.seiten-fotos { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)) !important; gap: 12px !important; }
.plan-foto .knopf { font-size: .85rem; padding: 6px 8px; min-height: 40px; }
.plan-schieben { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.plan-schieben .knopf { white-space: nowrap; font-size: .8rem; padding: 6px 4px; }
.plan-foto .textlink { min-height: 32px; padding: 2px; justify-self: start; }
.plan-foto.ist-haupt .foto-bild { outline: 4px solid var(--gold); outline-offset: 2px; }
.stoff { background: var(--sand); border-radius: 12px; padding: 14px 16px; }
.stoff h3 { margin: 0 0 8px; }
.stoff .text-karte { margin-bottom: 10px; }
.unterschriften { margin: 0; padding-left: 18px; }
.redaktionsschluss h2 { font-size: 1.3rem; margin-bottom: 6px; }
@media (max-width: 600px) {
  .seiten-fotos { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .seitenkarte { padding: 14px; }
  .plan-foto .knopf { font-size: .78rem; padding: 6px 4px; }
  .plan-schieben .knopf { font-size: .74rem; padding: 6px 2px; }
}
