:root {
    --cream: #EFE8D8;
    --cream-2: #E4DAC4;
    --parchment: #F1E7CE;
    --ink: #2B2420;
    --navy: #1F3A5A;
    --navy-2: #16283f;
    --gold: #B8862B;
    --oxblood: #7A2E27;
    --card-bg: #FFFDF8;
    --border: #d8cba9;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --cream: #1c1712; --cream-2: #241d16; --parchment: #2a2116;
      --ink: #ECE3D3; --navy: #6f93bd; --navy-2: #8fb0d6;
      --gold: #d9a94a; --oxblood: #c96a5f; --card-bg: #262019; --border: #3a3126;
    }
  }
  :root[data-theme="dark"] {
    --cream: #1c1712; --cream-2: #241d16; --parchment: #2a2116;
    --ink: #ECE3D3; --navy: #6f93bd; --navy-2: #8fb0d6;
    --gold: #d9a94a; --oxblood: #c96a5f; --card-bg: #262019; --border: #3a3126;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'Karla', system-ui, sans-serif;
    line-height: 1.6;
  }
  h1, h2, h3, .display {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    color: var(--ink);
  }
  a { color: var(--navy); }
  img, svg { max-width: 100%; }
  button { font-family: inherit; }
  .wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

  /* ---------- Identity banner ---------- */
  .id-banner {
    background: var(--parchment);
    border-bottom: 3px solid var(--navy);
    position: relative;
    overflow: hidden;
  }
  .id-banner-inner { position: relative; max-width: 1560px; margin: 0 auto; }
  .id-illustration {
    position: absolute; top: 0; right: 300px; bottom: 0; width: 280px;
    background-image: url("images/kopf-illustration.jpg");
    background-size: cover; background-position: center;
    opacity: 0.75;
    mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  }
  @media (max-width: 900px) { .id-illustration { display: none; } }
  .id-inner {
    padding: 8px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
  }
  .id-logo img { width: 52px; height: 52px; object-fit: contain; }
  .id-title h1 { font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--navy-2); line-height:1.05; }
  .id-title .sub {
    margin-top: 1px; font-size: 0.58rem; letter-spacing: 0.12em; font-weight: 700;
    color: var(--oxblood);
  }
  .id-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.78rem;
    color: var(--navy-2);
    text-align: right;
    max-width: 24ch;
    border-right: 2px solid var(--gold);
    padding-right: 16px;
  }
  .id-wappen img { width: 44px; }

  /* ---------- Nav ---------- */
  nav.main-nav { background: var(--navy); position: sticky; top: 0; z-index: 50; }
  .nav-inner {
    max-width: 1560px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px;
  }
  .nav-toggle {
    display: none;
    background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
    padding: 8px; margin-left: auto;
  }
  ul.nav-list { list-style: none; display: flex; margin: 0; padding: 6px 0; row-gap: 6px; column-gap: 0; flex-wrap: wrap; }
  ul.nav-list > li { flex-shrink: 0; }
  .nav-link, .nav-btn { white-space: nowrap; }
  ul.nav-list > li { position: relative; }
  .has-dd { display: flex; align-items: center; }
  .dd-toggle {
    display: flex; align-items: center; height: 100%;
    background: none; border: none; color: #f1e9d8; cursor: pointer;
    padding: 9px 10px 9px 2px; font-size: 0.65rem;
  }
  .dd-toggle:hover { color: #fff; }
  li.open > .dd-toggle .chev { transform: rotate(180deg); }
  .nav-link, .nav-btn {
    display: flex; align-items: center; gap: 5px;
    color: #f1e9d8; text-decoration: none; font-size: 0.8rem; font-weight: 500;
    padding: 9px 7px; background: none; border: none; cursor: pointer;
  }
  .nav-link:hover, .nav-btn:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.06); }
  .nav-link.active { box-shadow: inset 0 -3px 0 var(--gold); }
  .chev { font-size: 0.6rem; transition: transform .15s ease; }
  li.open > .nav-btn .chev { transform: rotate(180deg); }
  .dropdown {
    display: none;
    position: absolute; top: 100%; left: 0; min-width: 220px;
    background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid var(--gold);
    box-shadow: 0 12px 24px rgba(0,0,0,0.18); padding: 6px 0; z-index: 60;
  }
  li.open .dropdown { display: block; }
  .dropdown a {
    display: block; padding: 10px 18px; color: var(--ink); text-decoration: none; font-size: 0.9rem;
  }
  .dropdown a:hover { background: var(--cream-2); }
  .nav-icon-btn { background: none; border: none; color: #f1e9d8; padding: 14px 10px; cursor: pointer; font-size: 1.05rem; }
  .nav-search { display: none; align-items: center; background: #fff; border-radius: 3px; overflow: hidden; margin: 8px 0; }
  .nav-search.open { display: flex; }
  .nav-search input { border: none; padding: 8px 10px; font-size: 0.9rem; flex: 1; min-width: 140px; }

  @media (max-width: 900px) {
    .nav-toggle { display: block; }
    ul.nav-list {
      display: none; flex-direction: column; width: 100%;
      position: absolute; top: 100%; left: 0; background: var(--navy-2);
      padding: 8px 0 16px;
    }
    ul.nav-list.open { display: flex; }
    ul.nav-list > li { width: 100%; }
    .nav-link, .nav-btn { width: 100%; padding: 13px 24px; }
    .dropdown { position: static; border: none; background: rgba(0,0,0,0.15); box-shadow: none; }
    .id-inner { grid-template-columns: auto 1fr auto; }
    .id-quote { display: none; }
  }
  @media (max-width: 620px) {
    .id-wappen { display: none; }
  }
  @media (max-width: 900px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 560px) {
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
  }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    overflow: hidden;
  }
  .hero-content { padding: 60px 24px 46px; max-width: 1180px; margin: 0 auto; width: 100%; }
  .hero h2 {
    color: #fff; font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 16ch;
  }
  .hero .tagline {
    margin-top: 14px; color: var(--gold); font-weight: 700; letter-spacing: 0.08em; font-size: 0.85rem;
  }
  .hero-rule { width: 70px; height: 3px; background: var(--gold); margin-top: 18px; }

  /* ---------- Intro row ---------- */
  section.intro { padding: 6px 24px; }
  .intro-grid {
    display: grid; grid-template-columns: 1.1fr 0.85fr 0.8fr; gap: 16px; align-items: start;
  }
  .intro-grid h2 { font-size: clamp(0.95rem, 1.6vw, 1.1rem); margin-bottom: 3px; }
  .intro-grid p { font-size: 0.76rem; line-height: 1.32; margin: 0 0 4px; }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 4px; padding: 7px 16px; border-radius: 3px; font-size: 0.82rem;
    background: var(--navy); color: #fff; text-decoration: none; font-weight: 700; font-size: 0.9rem;
    border: none; cursor: pointer;
  }
  .btn:hover { background: var(--navy-2); }

  .quote-card {
    background:
      radial-gradient(circle at 20% 20%, rgba(184,134,43,0.12), transparent 60%),
      linear-gradient(160deg, #f6ecd2, #ecdcb2);
    border: 1px solid #d8c48c;
    box-shadow: 0 10px 22px rgba(90,70,20,0.15);
    padding: 10px 16px;
    text-align: center;
    align-self: center;
  }
  .quote-card p {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.35rem;
    color: #4a3a1c;
    margin: 0;
  }
  .quote-card .ornament { margin-top: 6px; color: var(--gold); font-size: 0.95rem; }

  .weather-card {
    background: var(--card-bg); border: 1px solid var(--border); padding: 10px 14px;
  }
  .weather-card h3 { font-size: 0.88rem; margin-bottom: 6px; }
  .weather-now { display: flex; align-items: center; gap: 14px; }
  .weather-now .icon { font-size: 1.6rem; }
  .weather-now .temp { font-size: 1.3rem; font-weight: 700; }
  .weather-now .desc { font-size: 0.82rem; opacity: 0.75; }
  .weather-days { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
  .weather-days div { text-align: center; font-size: 0.78rem; }
  .weather-days .d-icon { font-size: 1.2rem; }
  .weather-note { display:none; }
  .fb-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.72rem; }
  .fb-dot { width: 22px; height: 22px; border-radius: 50%; background: #1877f2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

  @media (max-width: 900px) {
    .intro-grid { grid-template-columns: 1fr; }
  }

  /* ---------- Card grid (bottom of home) ---------- */
  section.link-grid { padding: 0 24px 10px; }
  .grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .tile {
    position: relative; aspect-ratio: 16/6.5; overflow: hidden; text-decoration: none;
    display: block; border: 1px solid var(--border); background: none; padding: 0; cursor: pointer; width: 100%;
  }
  .tile .ph {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(135deg, var(--border), var(--border) 2px, var(--card-bg) 2px, var(--card-bg) 16px);
  }
  .tile .veil { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,32,48,0.82), rgba(20,32,48,0.05) 55%); }
  .tile .label { position: absolute; left: 14px; bottom: 12px; right: 14px; color: #fff; }
  .tile .label strong { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; display: block; }
  .tile .label span { font-size: 0.78rem; color: #d8cfae; }

  /* ---------- Gallery + lightbox ---------- */
  section.gallery { background: var(--cream-2); padding: 60px 24px; }
  .section-head { max-width: 62ch; margin-bottom: 30px; }
  .section-head .eyebrow { color: var(--oxblood); font-weight: 700; font-size: 0.8rem; margin-bottom: 6px; }
  .section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
  .gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
  .gthumb {
    aspect-ratio: 1/1; border: 1px solid var(--border); cursor: pointer; padding: 0;
    background: repeating-linear-gradient(45deg, var(--border), var(--border) 2px, var(--card-bg) 2px, var(--card-bg) 14px);
    position: relative;
  }
  .gthumb span {
    position: absolute; inset: auto 6px 6px 6px; font-size: 0.72rem; color: var(--ink); opacity: 0.7; text-align: left;
  }

  .lightbox {
    display: none;
    position: fixed; inset: 0; background: rgba(10,14,20,0.92);
    z-index: 200; align-items: center; justify-content: center; padding: 24px;
    touch-action: none;
  }
  .lightbox.open { display: flex; }
  .lightbox-box {
    position: relative; max-width: 720px; width: 100%;
    background: var(--card-bg); border: 1px solid #444;
  }
  .lightbox-img {
    aspect-ratio: 4/3;
    background: repeating-linear-gradient(135deg, #3a3126, #3a3126 2px, #262019 2px, #262019 16px);
    display: flex; align-items: center; justify-content: center; color: #cfc7ac; font-size: 0.9rem; text-align: center; padding: 20px;
  }
  .lightbox-cap { padding: 14px 18px; color: var(--ink); font-size: 0.9rem; }
  .lightbox-close {
    position: absolute; top: -18px; right: -18px; width: 40px; height: 40px; border-radius: 50%;
    background: var(--gold); color: var(--navy-2); border: none; font-size: 1.3rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  }
  .lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.12); border: none; color: #fff; font-size: 1.4rem; width: 42px; height: 42px; cursor: pointer; }
  .lightbox-prev { left: -52px; }
  .lightbox-next { right: -52px; }
  @media (max-width: 800px) {
    .lightbox-close { top: 10px; right: 10px; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
  }

  /* ---------- Footer ---------- */
  footer.site {
    background: var(--navy-2); color: #cfc7ac; padding: 14px 24px; font-size: 0.8rem;
  }
  .foot-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 1180px; margin: 0 auto; }
  .foot-links a { color: #e9e2cf; text-decoration: none; margin-right: 18px; }
  .foot-links a:hover { text-decoration: underline; }
  .foot-tag { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--gold); text-align: right; }

/* ---- page-specific (Über uns / Vorstand / etc.) ---- */
  .page-header { background: transparent; color: var(--ink); padding: 26px 24px 6px; }
  .page-header .crumb { font-size: 0.78rem; color: var(--ink); opacity: 0.65; margin-bottom: 6px; }
  .page-header .crumb a { color: var(--navy-2); }
  .page-header h1 { color: var(--ink); font-size: clamp(1.4rem, 3vw, 2rem); }

  .wrap.narrow { max-width: 780px; }
  section.page-section { padding: 34px 24px; }
  section.page-section.alt { background: var(--cream-2); }
  section.page-section h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin-bottom: 12px;
    border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 4px;
  }
  section.page-section h3 { font-size: 1.02rem; margin: 44px 0 10px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--navy-2); }
  section.page-section h3:first-of-type { margin-top: 20px; padding-top: 0; border-top: none; }
  section.page-section p { font-size: 0.92rem; margin: 0 0 10px; }
  section.page-section ul.plain { margin: 0 0 10px; padding-left: 20px; font-size: 0.92rem; }
  section.page-section ul.plain li { margin-bottom: 6px; }

  .fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin: 16px 0; }
  .fact { background: var(--card-bg); border: 1px solid var(--border); padding: 14px; text-align: center; }
  .fact strong { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; color: var(--navy-2); }
  .fact span { font-size: 0.78rem; opacity: 0.8; }

  .board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px 28px; margin: 16px 0 4px; }
  .board-grid div { border-bottom: 1px dotted var(--border); padding-bottom: 10px; font-size: 0.9rem; }
  .board-grid strong { display: block; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.7rem; margin-bottom: 4px; }
  .board-grid span { display: block; color: var(--ink); }
  .board-grid a.mail { display: block; font-size: 0.78rem; margin-top: 2px; }
  .board-grid .mail-missing { font-style: italic; opacity: 0.55; }

  table.history-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.85rem; }
  table.history-table th, table.history-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
  table.history-table th { color: #fff; background: var(--navy); font-weight: 600; }
  table.history-table tr:nth-child(even) td { background: rgba(184,134,43,0.06); }

  ul.fee-list { list-style: none; margin: 12px 0; padding: 0; }
  ul.fee-list li {
    display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dotted var(--border); font-size: 0.92rem;
  }
  ul.fee-list strong { color: var(--navy-2); }

  .photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; margin-top: 14px; }
  .photo-card {
    aspect-ratio: 4/3; border: 1px solid var(--border); background: none; padding: 0; cursor: pointer;
    background-image: repeating-linear-gradient(135deg, var(--border), var(--border) 2px, var(--card-bg) 2px, var(--card-bg) 16px);
    display: flex; align-items: flex-end; justify-content: flex-start;
  }
  .photo-card span { background: rgba(20,32,48,0.75); color: #fff; font-size: 0.72rem; padding: 4px 8px; margin: 8px; }

  .tf-item { margin-bottom: 30px; }
  .tf-item h3 { font-size: 1.15rem; color: var(--navy-2); margin-bottom: 6px; }
  .tf-item .since { color: var(--gold); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; margin-bottom: 6px; }

/* Firmen */
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; margin-top: 16px; }
  .sponsor-card { background: var(--card-bg); border: 1px solid var(--border); padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
  .sponsor-card img { max-width: 100%; max-height: 110px; object-fit: contain; }
  .sponsor-card span { font-size: 0.88rem; color: var(--ink); }
  .sponsor-card a.visit { font-size: 0.78rem; }

/* Termine */
table.termine-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.92rem; }
  table.termine-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
  table.termine-table td:first-child { font-weight: 700; color: var(--navy-2); white-space: nowrap; width: 30%; }
  table.termine-table tr:nth-child(even) td { background: rgba(184,134,43,0.06); }

/* In memoriam */
.memoriam-lead { font-family:'Cormorant Garamond',serif; font-style:italic; font-size:1.15rem; color: var(--navy-2); text-align:center; margin-bottom:30px; }
  .memoriam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 20px; }
  .memoriam-card { background: var(--card-bg); border: 1px solid var(--border); padding: 16px; text-align: center; }
  .memoriam-card img { width: 100%; max-width: 260px; margin: 0 auto 10px; display:block; border: 1px solid var(--border); }
  .memoriam-card .imgs-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
  .memoriam-card .imgs-row img { max-width: 47%; }
  .memoriam-card h3 { font-size: 1.05rem; margin: 4px 0; color: var(--navy-2); }

/* Galerie */
.gallery-jump { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.gallery-jump a { font-size: 0.85rem; font-weight: 700; color: var(--navy-2); text-decoration: none; }
.gallery-jump a:hover { text-decoration: underline; }
.gallery-section { margin-bottom: 40px; scroll-margin-top: 70px; }
.gallery-section h2 { font-size: 1.15rem; margin-bottom: 12px; border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 3px; }
.gallery-section .count { font-size: 0.75rem; font-weight: 400; opacity: 0.6; border: none; }
.gallery-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 0 0 18px; }
.gallery-video { width: 100%; display: block; background: #000; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 6px; }
.gthumb { padding: 0; border: 1px solid var(--border); background: var(--card-bg); cursor: pointer; aspect-ratio: 1/1; overflow: hidden; }
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb:hover img { opacity: 0.85; }
