/* ══════════════════════════════════════════════════════════════
   THEME VARIABLES — JS writes these on :root at runtime.
   Default values here act as the initial fallback (Blau-Weiß).
   ══════════════════════════════════════════════════════════════ */
:root {
  --primary:          #4DA3D4;
  --primary-dark:     #1E6FA0;
  --primary-pale:     #D8EEFF;
  --accent:           #FFCC00;
  --accent-text:      #1c1c1c;
  --accent-green:     #1a5c38;

  /* Rautenmuster — JS reads these to build the SVG diamond tile */
  --rauten-a:         #5FB3E8;
  --rauten-b:         #ffffff;
  --rauten-size:      28;        /* unitless px — JS uses parseInt() */

  /* Nav link frosted overlays — theme-dependent */
  --nav-link-bg:      rgba(255,255,255,.82);
  --nav-link-bg-h:    rgba(255,255,255,.96);
  --nav-link-bg-sub:  rgba(255,255,255,.68);

  /* Nav solid background (behind the transparent Rautenmuster SVG) */
  --nav-bg:           #4DA3D4;

  /* Surfaces */
  --bg:               #f0f7ff;
  --bg-content:       #ffffff;
  --text:             #1c1c1c;
  --text-nav:         #0f3460;
  --text-nav-muted:   #2a5a8a;
  --border:           #b8d5ee;

  /* Layout & misc */
  --nav-w:            260px;
  --gap:              1.5rem;
  --radius:           4px;
  --shadow-nav:       2px 0 16px rgba(0,0,0,.18);
}

/* ── RESET ── */

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

/* ── PAGE ── */

/* html covers the notch/safe-area on iOS — always white so notch is never coloured */
html {
  background: #ffffff;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
  transition: color .3s;
}

/* Accent bar — desktop only (hidden on mobile in media query) */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 60%, var(--accent) 100%);
  z-index: 300;
  transition: background .3s;
}

/* ── NAV — Rautenmuster painted by JS via SVG data-URI ── */

#nav {
  width: var(--nav-w);
  flex-shrink: 0;
  background-color: #ffffff;
  background-attachment: local;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  padding-top: 4px;                    /* clear the body::before stripe */
  border-right: 1px solid var(--border);
  transition: border-color .3s;
}
#nav::-webkit-scrollbar { display: none; }

/* Site-title block: solid colour anchors the nav above the pattern */
.nav-header { flex-shrink: 0; }

.nav-title {
  background: var(--primary);
  color: #ffffff;
  padding: .9rem 1rem .8rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.35;
  border-bottom: 2px solid var(--accent);
  transition: background .3s, border-color .3s;
}

/* ── THEME SWITCHER ── */

.theme-switcher {
  display: none;
}

.theme-switcher-label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-nav);
  opacity: .55;
  margin-bottom: .35rem;
}

.theme-swatches {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.theme-swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

.theme-swatch:hover { transform: scale(1.2); }

.theme-swatch.active {
  box-shadow: 0 0 0 2px var(--bg-content), 0 0 0 4px var(--accent);
  transform: scale(1.12);
}

/* ── NAV LINKS — frosted overlay over the diamond pattern ── */

#nav ul { list-style: none; padding: 0 .6rem; }
#nav ul ul { padding-left: .85rem; }
#nav > ul > li { margin-bottom: 2px; }

#nav a {
  display: block;
  padding: .38rem .65rem;
  border-radius: var(--radius);
  color: var(--text-nav);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  background: var(--nav-link-bg);
  transition: background .15s, color .15s;
}

#nav a:hover  { background: var(--nav-link-bg-h); }
#nav a.active { background: var(--accent); color: var(--accent-text); font-weight: 700; }

#nav ul ul a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-nav-muted);
  padding: .28rem .65rem;
  background: var(--nav-link-bg-sub);
}

#nav ul ul a:hover  { background: var(--nav-link-bg-h); color: var(--text-nav); }
#nav ul ul a.active { color: var(--accent-text); }

#nav a.nav-muted { color: var(--text-nav-muted); opacity: .6; font-size: .8rem; }

#nav ul ul ul a {
  font-size: .78rem;
  padding: .22rem .65rem .22rem 1.1rem;
}

/* ── NAV ACCORDION ── */

.nav-group-header {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.nav-group-header a {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius);
}

.nav-toggle-btn {
  flex-shrink: 0;
  align-self: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 1.9rem;
  height: 1.9rem;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .22s;
}

.nav-toggle-btn:hover { background: var(--primary-dark); }
.nav-toggle-btn.open  { transform: rotate(90deg); background: #f5c800; color: #3a2a00; }
.nav-toggle-btn.open:hover { background: #ffd700; }

.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s ease;
}

.nav-sub.open { max-height: 1200px; }

/* ── SOCIAL LINKS ── */

.nav-social {
  margin-top: auto;
  padding: .75rem .6rem;
  display: flex;
  gap: .5rem;
  border-top: 1px solid var(--border);
  transition: border-color .3s;
}

.nav-social-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .45rem .5rem;
  border-radius: var(--radius);
  background: var(--nav-link-bg);
  color: var(--text-nav);
  text-decoration: none;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1;
  transition: background .2s, color .2s;
}

.nav-social-link:hover { background: var(--nav-link-bg-h); }

.nav-social-link svg {
  width: 1.3rem;
  height: 1.3rem;
  flex-shrink: 0;
  display: block;
}

.nav-social-link span {
  display: block;
  line-height: 1;
}

/* ── CONTENT ── */

main {
  flex: 1;
  padding: calc(var(--gap) + 4px) 1.5rem var(--gap);
  max-width: 1100px;
  border-left: 1px solid var(--border);
  min-height: 100vh;
  transition: color .3s, border-color .3s;
}


/* ── HOME LAYOUT ── */

.home-header {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--accent);
}

.home-header-text {
  flex: 1;
}

.home-header-text h1 {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.home-baum {
  width: 90px;
  height: auto;
  display: block;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
  align-self: flex-end;
}

/* Sections */
.home-section {
  margin-bottom: 2rem;
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.home-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  border-left: 3px solid var(--accent);
  padding-left: .6rem;
  margin: 0;
  border-bottom: none;
}

.home-section-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.home-section-link:hover { text-decoration: underline; }

/* Event cards */
.home-events-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.home-no-events {
  font-size: .88rem;
  color: var(--text-nav-muted);
  margin: 0;
}

.home-event-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .7rem .9rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  background: var(--primary-pale);
  position: relative;
  transition: box-shadow .15s;
}

.home-event-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.home-event-near {
  border-left-color: var(--accent);
  background: #fffde8;
}

.home-event-today {
  border-left-color: #2e7d32;
  background: #f1f8e9;
}

.home-event-date-block {
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: .3rem .55rem;
  width: 58px;
  flex-shrink: 0;
  line-height: 1;
}

.home-event-near .home-event-date-block {
  background: #b8860b;
}

.home-event-today .home-event-date-block {
  background: #2e7d32;
}

.home-event-badge--today {
  background: #2e7d32;
  color: #fff;
}

.home-event-day {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.home-event-month {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .88;
}

.multiday-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.multiday-block .home-event-date-block {
  width: 58px;
}

.multiday-line {
  width: 2px;
  height: 8px;
  background: var(--border);
  flex-shrink: 0;
  border-radius: 1px;
}

.home-event-info {
  flex: 1;
  min-width: 0;
}

.home-event-title {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-event-meta {
  display: block;
  font-size: .78rem;
  color: var(--text-nav-muted);
  margin-top: .1rem;
}

.home-event-text {
  display: block;
  font-size: .78rem;
  margin-top: .2rem;
}

.home-event-text a { color: var(--primary-dark); }

@media (max-width: 768px) {
  .home-event-title, .home-event-meta { white-space: normal; }
}

.home-event-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  color: var(--accent-text);
  padding: .15rem .4rem;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Aktuelles */
.home-aktuelles {
  font-size: .95rem;
  line-height: 1.7;
}

.home-aktuelles h2 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

.home-aktuelles img {
  max-height: 300px;
  object-fit: cover;
  width: 100%;
}

@media (max-width: 768px) {
  .home-baum { width: 70px; }
}

/* ── PAGE TITLE (all pages, scrolls away) ── */

.page-title {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
  background: transparent;
  margin-bottom: 1rem;
  opacity: .75;
}

/* ── NAV LOGO ── */

.nav-logo {
  display: block;
  height: 3.5rem;
  width: auto;
  padding: .5rem .75rem .4rem;
  border-bottom: 2px solid var(--accent);
}

main h1 {
  font-size: 1.85rem;
  color: var(--primary-dark);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 1.25rem;
}

main h2 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
  padding-left: .6rem;
  margin: 1.75rem 0 .5rem;
}

main h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin: 1.25rem 0 .35rem;
}

main p  { margin-bottom: .9rem; }

.lead {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--primary-dark);
  line-height: 1.65;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .75rem 1rem;
  margin-bottom: 1.2rem;
}
main ul, main ol { margin: .5rem 0 .9rem 1.5rem; }
main li { margin-bottom: .25rem; }

main a       { color: var(--accent-green); text-underline-offset: 3px; }
main a:hover { color: var(--accent); }

main strong { font-weight: 600; }

main hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 1.5rem 0;
}
main em     { font-style: italic; }

main img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: .5rem auto;
  display: block;
  border: 1px solid var(--border);
}


/* ── TERMINE ── */

.termine-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.termine-export-all,
.termine-pdf-btn {
  display: inline-block;
  padding: .5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.termine-export-all:hover,
.termine-pdf-btn:hover { background: var(--primary-dark); }

/* Future event card */
.termin-card {
  padding: .8rem 1rem;
  margin-bottom: .6rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  background: var(--primary-pale);
}
.termin-card.home-event-near  { border-left-color: var(--accent); background: #fffde8; }
.termin-card.home-event-today { border-left-color: #2e7d32;       background: #f1f8e9; }
.termin-card.home-event-near  .home-event-date-block { background: #b8860b; }
.termin-card.home-event-today .home-event-date-block { background: #2e7d32; }

.termin-card-inner {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}

.termin-body { flex: 1; min-width: 0; }

.termin-title-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.termin-card .home-event-date-block {
  background: var(--primary);
  flex-shrink: 0;
}

.termin-date {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--primary-dark);
  display: block;
}

.termin-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin: .15rem 0;
}

.termin-location {
  font-size: .8rem;
  color: var(--text-nav-muted);
  display: block;
  margin-bottom: .2rem;
}
.termin-location::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='%234DA3D4' d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
  display: inline-block;
  vertical-align: middle;
  margin-right: .25rem;
}
.termin-time {
  font-size: .8rem;
  color: var(--text-nav-muted);
  display: block;
  margin-bottom: .2rem;
}
.termin-time::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='%234DA3D4' d='M12 2a10 10 0 1 0 0 20A10 10 0 0 0 12 2zm.5 5v5.25l4.5 2.67-.75 1.23L11 13V7h1.5z'/%3E%3C/svg%3E");
  display: inline-block;
  vertical-align: middle;
  margin-right: .25rem;
}

.termin-desc {
  font-size: .82rem;
  color: var(--text-nav-muted);
  display: block;
  margin-bottom: .55rem;
}

.termin-text {
  font-size: .82rem;
  margin-bottom: .55rem;
}

.termin-text a { color: var(--primary-dark); }

.termin-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.termin-export-btn, .termin-flyer-btn {
  padding: .32rem .65rem;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.termin-export-btn:hover, .termin-flyer-btn:hover { background: var(--primary); color: #fff; }

/* Past event card — compact, no button */
.termin-card.termin-past {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  border-left-color: var(--border);
  background: transparent;
  opacity: .65;
  padding: .4rem .8rem;
}
.termin-card.termin-past .termin-date { font-size: .72rem; white-space: nowrap; }
.termin-card.termin-past .termin-title { font-size: .88rem; margin: 0; }

/* ── CONTENT SOCIAL BUTTONS ── */

.social-btns {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .75rem 0;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .9rem;
  border-radius: var(--radius);
  background: var(--nav-link-bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .2s, border-color .2s;
  min-width: 0;
}

.social-btn:hover { background: var(--primary-pale); border-color: var(--primary); }

.social-btn svg {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  display: block;
  color: var(--primary-dark);
}

.social-btn span {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
}

.social-btn small {
  display: block;
  font-size: .75rem;
  color: var(--text-nav-muted);
  line-height: 1.2;
}

/* ── MAIBAUM TIMELINE CARDS ── */

.maibaum-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem .75rem .65rem .5rem;
  margin-bottom: .6rem;
  border-radius: var(--radius);
  background: var(--nav-link-bg);
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}

.maibaum-card::before {
  content: '';
  position: absolute;
  left: -2.05rem;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: .8rem;
  height: .8rem;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  border-radius: 1px;
  z-index: 1;
}

.maibaum-card:hover { background: var(--primary-pale); }

.maibaum-card-img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.maibaum-card-body { flex: 1; min-width: 0; }

.maibaum-card-desc {
  font-size: .82rem;
  color: var(--text-nav-muted);
  margin: .25rem 0 0;
  line-height: 1.45;
}

/* ── VERSIONEN ── */

.versionen-ts {
  font-size: .82rem;
  color: var(--text-nav-muted);
  margin-bottom: 1rem;
}

.versionen-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}

.versionen-table th,
.versionen-table td {
  text-align: left;
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--border);
}

.versionen-table thead th {
  font-weight: 700;
  color: var(--text-nav);
  background: var(--primary-pale);
}

.versionen-table tbody tr:hover { background: var(--primary-pale); }

.versionen-v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}

.versionen-date {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  font-size: .85rem;
}

/* ── CHRONIK ── */

.chronik-intro {
  font-size: .88rem;
  color: var(--text-nav-muted);
  margin-bottom: 1.5rem;
}

.chronik-timeline {
  position: relative;
  padding-left: 2rem;
}

/* Maibaum trunk */
.chronik-timeline::before {
  content: '';
  position: absolute;
  left: .85rem;
  top: .5rem;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  border-radius: 2px;
}

.chronik-year {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #ffffff;
  background: var(--primary);
  margin: 2rem 0 .5rem -1.15rem;
  padding: .15rem .9rem .15rem .6rem;
  border-radius: 0 999px 999px 0;
}

.chronik-year:first-child { margin-top: 0; }

.chronik-event {
  position: relative;
  margin-bottom: .5rem;
}

/* <summary> reset + layout */
.chronik-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  list-style: none;
  padding: .45rem .5rem;
  border-radius: var(--radius);
  transition: background .15s;
}
.chronik-summary::-webkit-details-marker { display: none; }
.chronik-summary::marker { display: none; }

/* Diamond marker — centered vertically with the summary row */
.chronik-summary::before {
  content: '';
  position: absolute;
  left: -2.05rem;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: .8rem;
  height: .8rem;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  border-radius: 1px;
  z-index: 1;
}
.chronik-summary:hover { background: var(--primary-pale); }
.chronik-event[open] > .chronik-summary { background: var(--primary-pale); }

.chronik-summary-text {
  flex: 1;
  min-width: 0;
}

.chronik-date {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .02em;
}

.chronik-title {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .1rem;
}

/* Standardised thumbnail */
.chronik-thumb {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
}

/* Expanded body */
.chronik-body {
  padding: .6rem .5rem .6rem 1rem;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text);
  border-left: 2px solid var(--primary-pale);
  margin-left: .25rem;
}
.chronik-body p { margin-bottom: .6rem; }
.chronik-body ul { margin: .4rem 0 .6rem 1.2rem; }
.chronik-body li { margin-bottom: .15rem; }
.chronik-empty { color: var(--text-nav-muted); font-style: italic; }

/* Standardised image grid in body */
.chronik-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .5rem;
  margin: .75rem 0;
}
.chronik-images img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  display: block;
}

/* ── BURGER ── */

#burger {
  display: none;
  position: fixed;
  top: .75rem;
  right: .75rem;
  z-index: 200;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .3s;
}

/* ── MOBILE ── */

@media (max-width: 768px) {
  body::before { display: none; }

  #burger {
    display: flex;
    top: calc(.75rem + env(safe-area-inset-top, 0px));
    right: calc(.75rem + env(safe-area-inset-right, 0px));
  }

  #nav {
    position: fixed;
    top: 0; right: 0;
    left: auto;
    height: 100%;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(100%);
    transition: transform .22s ease;
    z-index: 100;
    box-shadow: -2px 0 16px rgba(0,0,0,.18);
  }

  #nav.open { transform: translateX(0); }

  /* Logo row — top padding clears the notch */
  .nav-header {
    display: flex;
    align-items: center;
    padding-top: env(safe-area-inset-top, 0px);
    min-height: calc(3.9rem + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border);
    padding-left: .75rem;
  }

  .nav-logo {
    height: 2.4rem;
    width: auto;
    padding: 0;
    border-bottom: none;
  }

  main {
    padding-top: calc(var(--gap) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom, 0px));
    padding-left: calc(1.25rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.25rem + env(safe-area-inset-right, 0px));
    border-left: none;
    min-width: 0;
    /* gradients handled by JS (applyRautenmuster checks window.innerWidth) */
  }


}

/* ── BILDERGALERIE ─────────────────────────────────────────────────────────── */

.gallery-section {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-summary {
  cursor: pointer;
  padding: .7rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  background: var(--primary-pale);
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}

.gallery-summary::-webkit-details-marker { display: none; }

.gallery-summary::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform .2s;
}

details.gallery-section[open] .gallery-summary::before {
  transform: rotate(45deg) scale(1.2);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--bg);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity .15s;
}

.gallery-thumb:hover { opacity: .85; }

/* ── LIGHTBOX ──────────────────────────────────────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#lightbox.open { display: flex; }

#lb-img {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 100px);
  object-fit: contain;
  border-radius: 2px;
}

#lb-caption {
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  margin-top: .6rem;
  text-align: center;
  padding: 0 1rem;
}

.lb-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top, 1rem));
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: .25rem .5rem;
  opacity: .8;
}
.lb-close:hover { opacity: 1; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: .25rem .6rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: background .15s;
}
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }

/* ── DER VEREIN ────────────────────────────────────────────────────────────── */

.verein-box {
  background: var(--primary-pale);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.verein-box-title {
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary-dark);
  margin-bottom: .6rem;
}

.verein-box p {
  margin: .4rem 0;
  font-size: .9rem;
  color: var(--text);
}

.verein-box-notice {
  background: #fff8e1;
  border-left: 3px solid #f0a500;
  border-radius: var(--radius);
  padding: .45rem .7rem !important;
  font-size: .82rem !important;
  color: #7a5500 !important;
  margin-bottom: .75rem !important;
}

/* Vorstand card grid */

.vorstand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.vorstand-card {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: box-shadow .15s;
}

.vorstand-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.vorstand-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.vorstand-role {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary-dark);
  padding: .5rem .5rem .1rem;
}

.vorstand-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 .5rem .2rem;
}

.vorstand-info {
  font-size: .75rem;
  color: var(--text-nav-muted);
  padding: 0 .5rem .55rem;
}

/* Name lists — 2-column grid */

.verein-name-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .25rem .75rem;
  margin: .4rem 0 1.25rem;
  padding: 0;
}

.verein-name-list li {
  padding: .2rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  color: var(--text);
}

/* Fahne section */

.verein-fahne-section {
  margin: 1rem 0 1.25rem;
}

.verein-fahne-text {
  margin-bottom: 1rem;
}

.verein-fahne-photos {
  display: flex;
  gap: 1rem;
}

.verein-fahne-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.verein-fahne-photo img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.verein-fahne-photo-name {
  font-size: .75rem;
  color: var(--text-nav-muted);
  text-align: center;
}

.verein-fahne-item {
  display: flex;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  align-items: baseline;
}

/* ── PRINT ───────────────────────────────────────────────────────────────── */

@media print {
  #nav, #burger, #lightbox, #flyer-lb { display: none !important; }
  body { background: #fff; }
  #content {
    padding: .25rem .75rem;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    background-image: none !important;
    background-color: #fff !important;
  }
  h1 { font-size: 1rem; margin: .15rem 0 .4rem; }
  h2 { display: none; }
  .page-title { display: none; }
  .termine-actions-bar, .termin-actions, .termine-past-section { display: none !important; }
  .termin-card {
    break-inside: avoid;
    background: none !important;
    box-shadow: none; border: none; border-radius: 0;
    padding: .15rem 0 0; margin: 0;
  }
  .termin-card::after { content: ''; display: block; border-bottom: 1px solid #ddd; margin: .15rem 0 0; }
  .termin-card-inner { display: block; }
  /* Datum: eigene Zeile, schlicht */
  .multiday-block, .home-event-date-block {
    display: block;
    background: none !important; border: none; border-radius: 0;
    width: auto; padding: 0;
    font-size: .65rem; font-weight: 400; color: #555;
    line-height: 1.3; text-align: left;
  }
  .multiday-block .home-event-date-block { display: inline; }
  .multiday-block .home-event-date-block:first-child::after { content: ' – '; }
  .multiday-line { display: none; }
  .home-event-day { display: inline; font-size: .65rem; }
  .home-event-day::after { content: '. '; }
  .home-event-month { display: inline; font-size: .65rem; }
  /* Titel + Ort: eigene Zeile */
  .termin-body { display: block; }
  .termin-title { display: inline; font-size: .72rem; font-weight: 700; margin: 0; color: #000; }
  .termin-location { display: inline; font-size: .7rem; color: #444; margin: 0; }
  .termin-location::before { content: ' · '; }
  .termin-desc, .termin-text { display: none; }
  a { color: inherit; text-decoration: none; }
}

.verein-fahne-role {
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary-dark);
  min-width: 115px;
  flex-shrink: 0;
}

.verein-fahne-name {
  color: var(--text);
}

/* Nikolaus photo grid */

.nikolaus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: .75rem 0 1.5rem;
}

.nikolaus-grid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── FLYER LIGHTBOX ────────────────────────────────────────────────────────── */

#flyer-lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
}

#flyer-lb.open { display: flex; }

#flyer-frame {
  width: min(92vw, 860px);
  height: min(92vh, 1100px);
  border: none;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.flyer-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.flyer-btn:hover { background: var(--primary-dark); }

.gallery-link {
  display: inline-block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: .35rem .8rem;
  transition: background .15s, color .15s;
}
.gallery-link:hover { background: var(--primary); color: #fff; }

/* ── SPONSOREN ─────────────────────────────────────────────────────────────── */

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 1.5rem;
}

.sponsor-card {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
}

.sponsor-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }

.sponsor-card-img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center;
  padding: .75rem;
  background: var(--bg);
  display: block;
  box-sizing: border-box;
}

.sponsor-info {
  padding: .75rem 1rem 1rem;
}

.sponsor-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}

.sponsor-contact {
  font-size: .82rem;
  color: var(--text-nav-muted);
  line-height: 1.5;
}

.sponsor-contact a {
  color: var(--primary-dark);
  text-decoration: none;
}

.sponsor-contact a:hover { text-decoration: underline; }

.sponsor-text {
  font-size: .85rem;
  color: var(--text);
  margin-top: .5rem;
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding-top: .5rem;
}

/* ── STECKBRIEF ──────────────────────────────────────────────────────────── */

dl.steckbrief {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem 1rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--primary-pale);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem;
}

dl.steckbrief dt {
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

dl.steckbrief dd {
  margin: 0;
  color: var(--text);
}
