/* Bürgernetz Dillingen e.V. – Stylesheet
   Modernes Layout mit den Grafiken des bisherigen Templates:
   Kopfbild (header.jpg), Globus-Logo (logo.png), Hexagon-Hintergrund (hintergrund.jpg). */

:root {
  --navy-900: #0f1e38;
  --navy-800: #1b2f50;
  --navy-700: #223d67;
  --navy-600: #264473;
  --navy-100: #e6ecf5;
  --sand-50:  #f9f8f5;
  --sand-100: #f2f0eb;
  --sand-200: #e2e0da;
  --sand-300: #d0cdc3;
  --ink:      #24241e;
  --ink-soft: #55554a;
  --accent:   #f0c419;
  --link:     #1f4f8f;
  --link-hover: #0f3366;
  --radius: 10px;
  --wrap: 72rem;
  --font: "Century Gothic", "CenturyGothic", "URW Gothic", "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: #f7f6f3 url("/img/hintergrund.jpg") center top repeat-x;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 1.5rem; } }

a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--ink); padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Kopfbereich mit Original-Kopfbild ---------- */
.site-header {
  color: #fff;
  background:
    url("/img/header.jpg") center top no-repeat,
    linear-gradient(180deg, #071226 0%, #15284a 55%, #3a5f97 100%);
  background-size: auto 100%, auto;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 96px;
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-width: 0; align-self: stretch; }
.brand:hover { color: #fff; }
.brand-logo { width: 124px; height: auto; flex: none; align-self: flex-start; margin-left: -.5rem; }
.brand-text { display: flex; flex-direction: column; min-width: 0; padding: .9rem 0; }
.brand-name { font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.brand-sub { font-size: .82rem; color: #c9d6ea; line-height: 1.3; margin-top: .2rem; }
@media (min-width: 48rem) {
  .header-inner { min-height: 150px; }
  .brand-logo { width: 207px; margin-left: -1.5rem; }
  .brand { gap: .25rem; }
  .brand-name { font-size: 2.4rem; }
  .brand-sub { font-size: 1rem; }
}

/* Mobile-Menü-Knopf */
.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  background: rgba(15,30,56,.35); color: #fff; border: 1px solid rgba(255,255,255,.45);
  border-radius: 8px; padding: .5rem .75rem; font: inherit; font-size: .95rem; cursor: pointer;
}
.bars, .bars::before, .bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative;
}
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }

/* Hauptmenü */
.main-nav { background: var(--navy-900); border-bottom: 4px solid var(--accent); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { color: #fff; text-decoration: none; display: block; }

/* mobil: aufklappbar */
.main-nav .menu { display: none; }
.main-nav.open .menu { display: block; }
.menu > li { border-top: 1px solid rgba(255,255,255,.1); position: relative; }
.menu > li > a { padding: .8rem .25rem; font-weight: 600; }
.menu > li > a.active { color: var(--accent); }
.sub-toggle {
  position: absolute; right: 0; top: .35rem; width: 2.5rem; height: 2.3rem;
  background: transparent; border: 0; color: #fff; cursor: pointer; border-radius: 6px;
}
.sub-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sub { list-style: none; margin: 0; padding: 0 0 .5rem .75rem; display: none; }
.has-sub.open > .sub { display: block; }
.sub a { padding: .45rem .25rem; color: #d7e1f0; }
.sub a.active { color: var(--accent); }

/* Desktop: horizontale Leiste mit Dropdowns */
@media (min-width: 56rem) {
  .nav-toggle { display: none; }
  .main-nav .menu { display: flex; gap: .25rem; }
  .menu > li { border-top: 0; }
  .menu > li > a { padding: .75rem 1rem; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -4px; }
  .menu > li > a:hover, .menu > li:focus-within > a { background: rgba(255,255,255,.08); color: #fff; }
  .menu > li > a.active { color: #fff; border-bottom-color: #fff; }
  .has-sub > a { padding-right: 1.9rem !important; }
  .sub-toggle { top: 50%; transform: translateY(-50%); right: .2rem; width: 1.6rem; height: 1.6rem; pointer-events: none; }
  .sub {
    display: block; position: absolute; left: 0; top: 100%; min-width: 15rem; z-index: 20;
    background: #fff; padding: .4rem 0; border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 28px rgba(15,30,56,.22);
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .12s, transform .12s, visibility .12s;
  }
  .has-sub:hover > .sub, .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
  .sub a { color: var(--ink); padding: .5rem 1.1rem; }
  .sub a:hover { background: var(--sand-100); color: var(--navy-700); }
  .sub a.active { color: var(--navy-700); font-weight: 700; background: var(--navy-100); }
}

/* Externe Links (öffnen in neuem Tab) im Menü dezent markieren */
.menu a[target="_blank"]::after, .card strong.ext::after { content: " ↗"; font-size: .85em; opacity: .7; }

/* ---------- Inhalt ---------- */
.content { flex: 1; padding-top: 1.25rem; padding-bottom: 2.5rem; }
.crumbs { font-size: .875rem; color: var(--ink-soft); margin: 0 0 .75rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs .sep { margin: 0 .4rem; color: var(--sand-300); }

.page {
  background: rgba(255,255,255,.93); border: 1px solid var(--sand-200); border-radius: var(--radius);
  padding: 1.25rem 1rem 1.75rem;
  box-shadow: 0 2px 10px rgba(36,36,30,.06);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
@media (min-width: 48rem) { .page { padding: 2rem 2.5rem 2.5rem; } }
.page > :first-child { margin-top: 0; }
.page > :last-child { margin-bottom: 0; }

.page h1 { font-size: 1.75rem; line-height: 1.25; color: var(--navy-800); margin: 0 0 1rem; }
.page h2 { font-size: 1.3rem; line-height: 1.3; color: var(--navy-800); margin: 2rem 0 .6rem; }
.page h3 { font-size: 1.08rem; line-height: 1.35; color: var(--navy-800); margin: 1.6rem 0 .4rem; }
.page p, .page ul, .page ol { margin: 0 0 1rem; }
.page li { margin-bottom: .3rem; }
.page .lead { font-size: 1.15rem; color: var(--ink-soft); }
.page .meta { font-size: .9rem; color: var(--ink-soft); }
.page hr { border: 0; border-top: 1px solid var(--sand-200); margin: 2rem 0; }

.prose { max-width: 46rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--sand-200); vertical-align: top; }
thead th { background: var(--sand-100); color: var(--navy-800); font-weight: 700; border-bottom: 2px solid var(--sand-300); }
td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.docs td { padding-top: .45rem; padding-bottom: .45rem; }
@media (max-width: 40rem) { table.docs .num { display: none; } }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.kv th { width: 40%; font-weight: 600; color: var(--ink-soft); background: transparent; border-bottom: 1px solid var(--sand-200); }
@media (min-width: 48rem) { table.kv th { width: 16rem; } }

/* Inhaltsverzeichnis */
.toc {
  background: var(--sand-50); border: 1px solid var(--sand-200); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 0 0 1.75rem;
}
.toc h2 { margin: 0 0 .5rem; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 1.4rem; columns: 1; }
@media (min-width: 48rem) { .toc ol { columns: 2; column-gap: 2.5rem; } }
.toc li { break-inside: avoid; }

/* Satzung: Absätze mit (1), (2) … */
ol.paras { list-style: none; padding: 0; counter-reset: para; }
ol.paras > li { counter-increment: para; position: relative; padding-left: 2.6rem; margin-bottom: .6rem; }
ol.paras > li::before { content: "(" counter(para) ")"; position: absolute; left: 0; color: var(--ink-soft); }
ol.paras ol { margin-top: .4rem; }
.para-head { scroll-margin-top: 1rem; }
.para-head .num { display: block; font-size: .85rem; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600; }

/* Kacheln */
.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.25rem 0 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards li { margin: 0; }
.card {
  display: block; height: 100%; text-decoration: none; color: var(--ink);
  border: 1px solid var(--sand-200); border-radius: var(--radius); padding: 1rem 1.15rem;
  background: var(--sand-50); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.card:hover { color: var(--ink); border-color: var(--navy-600); box-shadow: 0 6px 18px rgba(15,30,56,.1); transform: translateY(-1px); }
.card strong { display: block; color: var(--navy-800); font-size: 1.05rem; margin-bottom: .25rem; }
.card span { font-size: .93rem; color: var(--ink-soft); line-height: 1.5; display: block; }

/* Hervorgehobene Box */
.callout {
  border-left: 4px solid var(--accent); background: var(--sand-50);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }

/* Schaltflächen */
.btn {
  display: inline-block; background: var(--navy-700); color: #fff; text-decoration: none;
  padding: .6rem 1.1rem; border-radius: 8px; font-weight: 600; margin: .25rem .5rem .25rem 0;
}
.btn:hover { background: var(--navy-900); color: #fff; }
.btn.secondary { background: #fff; color: var(--navy-700); border: 1px solid var(--navy-700); }
.btn.secondary:hover { background: var(--navy-100); color: var(--navy-800); }
.btn[target="_blank"]::after { content: " ↗"; }

.file::after { content: " (PDF)"; color: var(--ink-soft); font-size: .9em; }

/* Startseite */
.hero { border-bottom: 1px solid var(--sand-200); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.hero h1 { margin-bottom: .4rem; }

/* ---------- Fußzeile ---------- */
.site-footer { background: var(--navy-800); color: #c9d6ea; font-size: .92rem; border-top: 4px solid var(--accent); }
.footer-inner { padding-top: 1.5rem; padding-bottom: 1.5rem; display: grid; gap: .6rem; }
@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; }
}
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
.members { display: flex; align-items: baseline; gap: .6rem; }
.members-label { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.members-count { font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

@media print {
  .site-header, .site-footer, .crumbs, .skip { display: none; }
  body { background: #fff; }
  .page { border: 0; box-shadow: none; padding: 0; background: none; }
  a { color: inherit; }
}
