/* ============================================================================
   VSV Rössing e.V. — Design System "Sportplatz-Klar"
   Quelle der Entscheidung: weitere_daten_webseiten/vsv/design/DESIGN.md
   Schriften lokal gehostet (kein Google-Fonts-Request, DSGVO-konform).
   ============================================================================ */

/* ── Schriften ────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1E00-1E9F, U+20AC;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/ibmplexsans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1E00-1E9F, U+20AC;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/ibmplexsans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122;
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light; /* bewusst Hell-only (DESIGN.md), verhindert erzwungenes Dark-Reading in unterstützten Browsern */

  /* Farbe (Color-Lock — genau diese Palette, kein Ausbrechen) */
  --color-primary:      #33495E;
  --color-primary-dark: #223343;
  --color-accent:       #4C8C5C;
  --color-accent-dark:  #396945;
  --color-bg:           #F3F5F6;
  --color-surface:      #FFFFFF;
  --color-text:         #22303B;
  --color-muted:        #586B78;
  --color-border:       #DDE4E7;

  /* Typografie */
  --font-heading: 'Archivo', 'Segoe UI', sans-serif;
  --font-body:    'IBM Plex Sans', 'Segoe UI', sans-serif;
  --measure: 65ch;

  /* Form (Shape-Lock) */
  --radius:    4px;
  --radius-sm: 2px;
  --shadow-card: 0 2px 10px rgba(34, 48, 59, 0.10);
  --shadow-card-hover: 0 6px 20px rgba(34, 48, 59, 0.14);

  /* Bewegung (ruhig → 150–200ms, eigenes Easing statt "ease") */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur: 180ms;

  --container: 1180px;
}

/* ── Reset & Basis ────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
a, button, .btn, .nav-toggle {
  touch-action: manipulation;       /* kein 300ms-Doppeltipp-Zoom-Delay am Handy */
  -webkit-tap-highlight-color: transparent; /* eigenes :active/:hover statt grauem Systemflash */
}
html {
  scroll-behavior: smooth;
  /* Sprungziele (Skip-Link #main, Anker wie #vorstand auf verein.php) landen
     sonst unter der position:sticky-Kopfzeile — scroll-padding-top schiebt
     jeden Anker-Sprung um die Kopfzeilenhöhe nach unten (Audit-Fund, Phase 8). */
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body { overflow-x: hidden; } /* Sicherheitsnetz gegen jeden Restüberlauf, 09-haeufige-fallen.md */

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--color-primary);
  text-wrap: balance; /* verhindert einzelne, hässlich isolierte Wörter am Zeilenende */
}
h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--color-primary); }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

section { padding-block: clamp(48px, 6vw, 88px); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 12px;
}

/* Basis-Icon-Größe (Inline-SVG-Set, includes/icons.php) — kontextuelle Regeln
   wie .sport-card .icon überschreiben das gezielt. Ohne diese Basisregel
   rendert ein <svg> ohne width/height-Attribut in manchen Kontexten mit der
   SVG-Default-Größe 300×150px. */
.icon { width: 24px; height: 24px; flex: none; }

/* Fokus-Stile — überall sichtbar, nie entfernen (06 §4) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff;
  padding: 10px 18px; z-index: 200; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem;
  padding: 12px 22px; border-radius: var(--radius);
  border: 1.5px solid transparent; cursor: pointer;
  text-decoration: none; line-height: 1;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-quiet {
  background: transparent; color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-quiet:hover { border-color: var(--color-primary); background: rgba(51,73,94,0.05); }
.btn:active { transform: translateY(1px); }

/* ── Kopfzeile / Navigation ───────────────────────────────────────────────── */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-block: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 44px; width: auto; }
.brand-text { font-family: var(--font-heading); font-weight: 800; color: var(--color-primary); font-size: 1.05rem; line-height: 1.2; }
.brand-text small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.72rem; color: var(--color-muted); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav a {
  display: block; padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--color-text); font-weight: 600; font-size: 0.94rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.main-nav a:hover { background: var(--color-bg); color: var(--color-primary); }
.main-nav a.active {
  color: var(--color-primary);
  box-shadow: inset 0 -2px 0 var(--color-accent); /* Unterstrich, ohne die Zeilenhöhe zu verschieben */
}
.dropdown a.active { background: var(--color-bg); color: var(--color-primary); font-weight: 700; }

.has-dropdown > .dropdown {
  /* margin:0 (statt vorher 6px) — sonst entsteht zwischen Trigger-Link und
     Dropdown eine "tote Zone": die Maus verlässt beim Runterfahren kurz den
     hoverbaren Bereich, :hover fällt weg, das Menü klappt vorzeitig zu, bevor
     man einen Link treffen kann. padding-top gleicht den optischen Abstand
     aus, ohne eine Lücke in der Hitbox zu erzeugen. */
  display: none; position: absolute; top: 100%; left: 0; margin: 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  list-style: none; padding: 14px 6px 6px; min-width: 200px;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown { display: block; }
.dropdown a { white-space: nowrap; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    flex-direction: column; align-items: stretch; padding: 8px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; width: 100%; }
  .main-nav .container, .main-nav ul { padding-inline: 0; }
  .has-dropdown > .dropdown { position: static; box-shadow: none; border: none; margin: 0 0 0 16px; display: none; }
  .has-dropdown.open > .dropdown { display: block; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); background: none; cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .site-header { position: relative; }
}

/* ── Hero: ruhiger Text-Block, Foto direkt darunter — im Container, nicht
   vollflächig über die ganze Fensterbreite (das wirkte zu dominant) ──────── */

.hero {
  padding-block: clamp(40px, 6vw, 64px) clamp(24px, 4vw, 32px);
}
.hero h1 { max-width: 16ch; }
.hero .lead { color: var(--color-muted); font-size: 1.08rem; max-width: 52ch; }
.hero .hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.hero-figure-full {
  width: 100%;
  aspect-ratio: 21 / 8;
  max-height: 40vh;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.hero-figure-full img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 700px) {
  .hero-figure-full { aspect-ratio: 4 / 3; max-height: 320px; }
}

/* Siegel-Ausschnitt-Motiv (Signatur-Element, DESIGN.md Abschnitt 2/5) */
.seal {
  clip-path: polygon(50% 0%, 93% 14%, 100% 50%, 93% 86%, 50% 100%, 7% 86%, 0% 50%, 7% 14%);
}

/* ── Sportangebot: Karten-Raster (bewusst asymmetrisch, 1 Featured-Karte) ──── */

.sport-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(6, 1fr);
}
.sport-card {
  grid-column: span 2;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--color-text);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sport-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); border-color: var(--color-primary); }
.sport-card.featured { grid-column: span 3; background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.sport-card.featured h3, .sport-card.featured .icon { color: #fff; }
.sport-card.featured p { color: rgba(255,255,255,0.82); }
.sport-card .icon { width: 34px; height: 34px; color: var(--color-accent-dark); margin-bottom: 14px; }
.sport-card.featured .icon { color: #fff; }
.sport-card h3 {
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sport-card p {
  font-size: 0.94rem; color: var(--color-muted); margin-bottom: 0;
  /* Admin-gepflegter Kurztext kann länger ausfallen als geplant — Karte soll
     dabei nicht aufreißen (Audit-Fund, Phase 8: "sehr lange Eingaben"). */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sport-card.featured p { color: rgba(255,255,255,0.85); }

@media (max-width: 960px) {
  .sport-grid { grid-template-columns: repeat(2, 1fr); }
  .sport-card, .sport-card.featured { grid-column: span 1; }
}
@media (max-width: 560px) {
  .sport-grid { grid-template-columns: 1fr; }
}

/* ── Termine (Liste mit Siegel-Datumsbadge) ───────────────────────────────── */

.termine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.termin-item {
  display: flex; align-items: center; gap: 20px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 16px 20px;
}
.termin-datum {
  /* accent-dark statt accent: die Monats-Zeile ist zu klein/nicht fett genug
     für die "großer Text"-Ausnahme (WCAG) — bei Weiß auf accent (#4C8C5C)
     kommen nur 4.03:1 zustande (< 4.5:1 Pflicht für normalen Text). Mit
     accent-dark sind es 6.4:1 (Audit-Fund, Phase 8). */
  flex: none; width: 64px; height: 64px; background: var(--color-accent-dark); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-heading);
}
.termin-datum .tag { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.termin-datum .monat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.termin-info h3 { font-size: 1.05rem; margin-bottom: 2px; }
.termin-info .meta { font-size: 0.88rem; color: var(--color-muted); }
.empty-state {
  border: 1.5px dashed var(--color-border); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--color-muted);
}

/* ── Aktuelles: News-Karten ───────────────────────────────────────────────── */

.news-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.news-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; display: block;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.news-card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--color-primary); }
.news-card .news-body { padding: 20px; }
.news-card time { font-size: 0.82rem; color: var(--color-muted); }
.news-card h3 {
  margin: 6px 0 8px; font-size: 1.05rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card p {
  font-size: 0.92rem; color: var(--color-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }

/* ── Ruhige CTA-Leiste (Mitglied werden) ──────────────────────────────────── */

.cta-band {
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.cta-band .container {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-block: 32px;
}
.cta-band h2 { font-size: 1.3rem; margin: 0; }
.cta-band p { margin: 4px 0 0; color: var(--color-muted); }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer { background: var(--color-primary-dark); color: rgba(255,255,255,0.85); padding-block: 40px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(3, 1fr); }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── Formulare (Kontakt, Login, Admin) ────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 1rem;
  background: var(--color-surface); color: var(--color-text);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--color-primary); }
.field-hint { font-size: 0.82rem; color: var(--color-muted); margin-top: 4px; }
.form-message { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.94rem; }
.form-message.ok { background: rgba(76,140,92,0.12); border: 1px solid var(--color-accent); color: var(--color-accent-dark); }
.form-message.error { background: rgba(178,52,52,0.10); border: 1px solid #B23434; color: #8A2828; }

/* Honeypot-Feld: unsichtbar für Menschen, aber im DOM (Bots füllen es aus) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Admin-Bereich ────────────────────────────────────────────────────────── */

.admin-topbar {
  background: var(--color-primary-dark); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
.admin-topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.admin-topbar .brand { font-family: var(--font-heading); font-weight: 800; }

.admin-shell { display: flex; min-height: calc(100vh - 49px); }
.admin-sidebar {
  flex: none; width: 220px; background: var(--color-surface);
  border-right: 1px solid var(--color-border); padding: 16px 0;
}
.admin-sidebar a {
  display: block; padding: 10px 20px; text-decoration: none; color: var(--color-text);
  font-size: 0.92rem; font-weight: 600; border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: var(--color-bg); }
.admin-sidebar a.active { border-left-color: var(--color-accent); color: var(--color-primary); background: var(--color-bg); }
.admin-main { flex: 1; min-width: 0; padding: 28px clamp(20px, 3vw, 40px); max-width: 980px; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
table.admin-table th { background: var(--color-bg); font-family: var(--font-heading); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table td.actions { white-space: nowrap; text-align: right; }
table.admin-table td.actions a, table.admin-table td.actions button { font-size: 0.85rem; margin-left: 10px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge.on  { background: rgba(76,140,92,0.15); color: var(--color-accent-dark); }
.badge.off { background: rgba(88,107,118,0.15); color: var(--color-muted); }

.link-btn { background: none; border: none; padding: 0; color: #B23434; cursor: pointer; font: inherit; text-decoration: underline; }

.admin-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }

@media (max-width: 780px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 8px; border-right: none; border-bottom: 1px solid var(--color-border); }
  .admin-sidebar a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-sidebar a.active { border-left-color: transparent; border-bottom-color: var(--color-accent); }
}

/* ── Innenseiten (Sparten, Rechtstexte, …) ────────────────────────────────── */

.page-header { padding-block: clamp(32px, 5vw, 56px) 8px; }
.page-header .eyebrow { margin-bottom: 8px; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
