/* ==========================================================================
   Abiturjahrgang 1980/81 – Schuldorf Bergstraße
   Design-Tokens, Layout, Komponenten
   ========================================================================== */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1d2a24;
  --muted: #5d6a63;
  --line: #ddd8cc;
  --brand: #2f5d46;        /* Schuldorf-Grün */
  --brand-strong: #1f4231;
  --brand-soft: #e3ece6;
  --on-brand: #ffffff;
  --accent: #c8932f;       /* Abi-Gold */
  --accent-soft: #f6ead2;
  --danger: #a3432f;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 8px 24px rgba(20, 30, 25, .07);
  --radius: 14px;
  --radius-sm: 8px;
  --max: none;            /* volle Fensterbreite; z. B. 1180px für eine feste Breite */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121815;
    --surface: #1a221e;
    --surface-2: #222c27;
    --text: #e8ece9;
    --muted: #a2afa8;
    --line: #2f3a34;
    --brand: #7fbf9a;
    --brand-strong: #a6d8ba;
    --brand-soft: #22332a;
    --on-brand: #10201a;
    --accent: #e0b25a;
    --accent-soft: #3a2f1a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121815;
  --surface: #1a221e;
  --surface-2: #222c27;
  --text: #e8ece9;
  --muted: #a2afa8;
  --line: #2f3a34;
  --brand: #7fbf9a;
  --brand-strong: #a6d8ba;
  --brand-soft: #22332a;
  --on-brand: #10201a;
  --accent: #e0b25a;
  --accent-soft: #3a2f1a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.2; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }
@media (min-width: 1400px) { .container { padding: 0 48px; } }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-bar { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text); font-weight: 700; white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand); color: var(--on-brand);
  font-family: var(--font-serif); font-size: 1rem; letter-spacing: -.03em;
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; line-height: 1.1; }
.brand span { line-height: 1.15; }

.main-nav { margin-left: auto; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a, .nav-group > button {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: .94rem; font-weight: 500;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.main-nav a:hover, .nav-group > button:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.nav-group { position: relative; }
.nav-group > button::after { content: " ▾"; font-size: .75em; color: var(--muted); }
.nav-group ul {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: none;
}
.nav-group.open ul { display: block; }

.nav-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-toggle { display: none; }

@media (max-width: 960px) {
  .menu-toggle { display: grid; }
  .main-nav {
    position: fixed; inset: 64px 0 auto 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 16px 20px; display: none; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; }
  .nav-group ul { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 12px; background: none; }
  .nav-group > button { width: 100%; text-align: left; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; pointer-events: none; }
  .nav-group > button::after { content: ""; }
  .nav-actions { margin-left: auto; }
}

/* ---------- Hinweisleiste ---------- */
.notice-bar { background: #2f5d46; color: #fff; font-size: .88rem; }
.notice-bar .container { padding-top: 7px; padding-bottom: 7px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-bar a { color: #fff; font-weight: 600; }
.notice-bar .pill { background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 999px; font-size: .78rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 400px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, var(--brand-soft), transparent 60%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px; position: relative;
}
.hero-card .year {
  font-family: var(--font-serif); font-size: clamp(4rem, 12vw, 6.5rem); line-height: 1;
  color: var(--brand); letter-spacing: -.04em;
}
.hero-card .year span { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Sektionen ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); background: linear-gradient(var(--brand-soft), transparent); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.page-head p { color: var(--muted); max-width: 65ch; margin: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Karten & Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); min-width: 0;
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-3px); border-color: var(--brand); color: inherit; }
.card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; margin-bottom: 14px;
}
.card .meta { font-size: .82rem; color: var(--muted); }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--brand-soft); color: var(--brand);
}
.badge-gold { background: var(--accent-soft); color: var(--accent); }
.badge-lock::before { content: "🔒 "; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; }
.tag-list li { font-size: .82rem; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--brand);
}
.timeline time { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.stat { text-align: center; padding: 18px 10px; }
.stat strong { display: block; font-family: var(--font-serif); font-size: 2.2rem; color: var(--brand); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Toolbar / Filter ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 20px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px;
}
.search input { border: 0; background: none; color: var(--text); font: inherit; padding: 11px 0; width: 100%; outline: none; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.result-count { font-size: .85rem; color: var(--muted); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- Personen ---------- */
.person { display: flex; gap: 14px; align-items: flex-start; }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  background: var(--accent-soft); color: var(--accent);
}
.person h3 { font-family: var(--font-sans); font-size: 1.02rem; font-weight: 650; margin: 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: .88rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ---------- Geburtstage ---------- */
.month h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.month.is-current h2::after { content: "aktueller Monat"; font-family: var(--font-sans); font-size: .72rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; }
.bday-list { list-style: none; margin: 0; padding: 0; }
.bday-list li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bday-list li:last-child { border-bottom: 0; }
.bday-day { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .9rem; }
.bday-list li.today .bday-day { background: var(--accent); color: #fff; }

/* ---------- Bilder ---------- */
.album { overflow: hidden; padding: 0; }
.album-cover {
  aspect-ratio: 4/3; display: grid; place-items: center; position: relative;
  font-size: 2.6rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}
.album-cover .count { position: absolute; right: 10px; bottom: 10px; font-size: .78rem; background: rgba(0,0,0,.35); padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.album-body { padding: 16px 18px 18px; }
.album-body h3 { font-size: 1.02rem; font-family: var(--font-sans); font-weight: 650; }

/* ---------- Formular ---------- */
.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Prosa ---------- */
.prose { max-width: 72ch; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; font-size: .9rem; }
.footer-grid { display: grid; gap: 28px; padding: 40px 0 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0; color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Animation ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card-link { transition: none; }
}

@media print {
  .site-header, .notice-bar, .site-footer, .toolbar { display: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
}

@media (max-width: 520px) { .hide-sm { display: none; } }

/* ---------- Kleine Bildschirme: kompakter Header ---------- */
.brand { min-width: 0; }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .nav-bar { gap: 8px; }
  .brand { font-size: .9rem; }
  .brand small { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .nav-actions .btn { padding: 9px 12px !important; }
  .icon-btn { width: 38px; height: 38px; }
  .notice-bar .container { flex-wrap: nowrap; }
  .notice-bar .container > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .notice-bar .container > a { display: none; }
}

.search select { border: 0; background: none; color: var(--text); font: inherit; padding: 11px 0; width: 100%; outline: none; cursor: pointer; }
.search select option { background: var(--surface); color: var(--text); }

/* ---------- Fotos ---------- */
img.avatar { object-fit: cover; background: var(--surface-2); }
.photo-strip { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.photo-strip figure { margin: 0; text-align: center; flex: none; }
.photo-strip img { width: 52px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.photo-strip figcaption { font-size: .72rem; color: var(--muted); }

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { padding: 10px 14px 12px; font-size: .88rem; }
.gallery figcaption small { display: block; color: var(--muted); margin-top: 4px; font-size: .76rem; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(10, 15, 12, .88); }
.lightbox img { max-width: 94vw; max-height: 80vh; display: block; margin: 0 auto; border-radius: 8px; }
.lightbox p { color: #fff; text-align: center; margin: 12px 0 0; font-size: .95rem; }
.lightbox p small { display: block; opacity: .75; }
.lightbox-nav { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.lightbox-nav button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; cursor: pointer; }
.lightbox-nav button:hover { background: rgba(255,255,255,.28); }
