/* =====================================================================
   Leg4Future – gemeinsame Styles für alle Seiten
   (Startseite, FAQ, Impressum, Datenschutz)
   ===================================================================== */

/* ---------- Design-Tokens ---------- */
:root {
  --brand:        #8CBF3F;   /* Marken-Grün – dekorativ + Flächen */
  --brand-border: #6E8B2C;
  --accent:       #E86E1A;   /* Marken-Orange – dekorativ (Icons, Kanten, Hover) */
  --accent-text:  #E86E1A;   /* Original-Orange als Textfarbe (Eyebrow, Links) */
  --ink:          #0e0e0e;
  --muted:        #5f6772;
  --bg:           #ffffff;
  --card:         #f7f8f9;
  --line:         rgba(14, 14, 14, 0.12);
  --focus:        #0e0e0e;
  --radius:       16px;
  --shadow:       0 12px 28px rgba(0, 0, 0, 0.08);
  --maxw:         1200px;
  --header-h:     6.5rem;     /* ungefähre Headerhöhe – für Anker-Offset */
  --font-head:    "Space Grotesk", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body:    Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Dark Mode (nur ab Tablet aufwärts) */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:         #f5f7ff;
    --muted:       #b3bdd1;
    --bg:          #0b0e14;
    --card:        #121826;
    --line:        rgba(255, 255, 255, 0.14);
    --focus:       #f5f7ff;
    --shadow:      0 12px 28px rgba(0, 0, 0, 0.45);
  }
}

/* Auf Smartphones trotz System-Dark-Mode hellen Hintergrund erzwingen
   (bewusste Design-Entscheidung des Projekts) */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  :root {
    --ink:         #0e0e0e;
    --muted:       #5f6772;
    --bg:          #ffffff;
    --card:        #f7f8f9;
    --line:        rgba(14, 14, 14, 0.12);
    --focus:       #0e0e0e;
    --shadow:      0 12px 28px rgba(0, 0, 0, 0.08);
  }
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);   /* Ankersprünge nicht unter den Sticky-Header */
  -webkit-text-size-adjust: 100%;
}

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

img {
  max-width: 100%;
  height: auto;          /* Seitenverhältnis aus width/height-Attributen bleibt erhalten -> kein Layout-Shift */
  display: block;
}

a { color: inherit; text-decoration: none; overflow-wrap: break-word; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[id] { scroll-margin-top: var(--header-h); }

/* ---------- Layout-Helfer ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }
.stack { display: flex; flex-direction: column; gap: clamp(1rem, 2.5vw, 1.5rem); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: top 160ms ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.button:hover { transform: translateY(-1px); filter: saturate(110%); }
.button svg { width: 20px; height: 20px; }

/* ---------- Header / Navigation ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  will-change: transform;
}
/* beim Runterscrollen ausblenden, beim Hochscrollen wieder einblenden */
header.site-header.is-hidden { transform: translateY(-100%); }
header.site-header.has-shadow { box-shadow: 0 6px 20px rgba(14, 14, 14, 0.10); }
@media (prefers-color-scheme: dark) {
  header.site-header { background: rgba(11, 14, 20, 0.85); }
}
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  header.site-header { background: rgba(255, 255, 255, 0.85); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 0.9rem;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand img { width: auto; max-width: 220px; height: 70px; }

.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { font-weight: 600; opacity: 0.9; }
.nav-links a:hover,
.nav-links a:focus-visible { opacity: 1; text-decoration: underline; }

.burger {
  display: none;
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.burger svg { width: 36px; height: 26px; display: block; }
.burger svg rect { fill: var(--ink); }

@media (max-width: 768px) {
  .burger { display: flex; }
  .nav-links { display: none; }
  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 100%;                 /* an tatsächlicher Headerhöhe verankert statt top:64px */
    right: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.85rem 1.1rem;
    min-width: 190px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    z-index: 60;
  }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 8vw, 7rem) 0 2.5rem; }
.eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--accent-text);
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.95rem, 5vw, 3.4rem);
  line-height: 1.08;
  margin: 0.4rem 0 0.6rem;
  max-width: 26ch;
  text-wrap: balance;
}
.hero p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 62ch; margin: 0 0 1.2rem; }

/* ---------- Sektionen / Fließtext ---------- */
section { padding: clamp(2rem, 5vw, 3.2rem) 0; }
h2.section-title,
.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0 0 1rem;
}
.prose { color: var(--ink); max-width: 80ch; }
.prose p { margin: 0.6rem 0; }
.prose ul { margin: 0.6rem 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }
.lead { font-size: 1.05rem; color: var(--muted); }

.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.info-card picture,
.info-card > img {
  display: block;
  width: 100%;
  max-width: 330px;
  margin-bottom: 1.5rem;
}
.info-card picture img { width: 100%; height: auto; }
@media (prefers-color-scheme: dark) {
  .info-card { background: rgba(247, 248, 249, 0.72); color: #0e0e0e; }
}
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .info-card { background: var(--card); color: var(--ink); }
}

/* ---------- Link-Karten (Partner) ---------- */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.link-card {
  position: relative;
  isolation: isolate;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 2.25rem;
  box-shadow: var(--shadow);
  min-height: 200px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.link-card:hover { transform: translateY(-4px); border-color: var(--brand-border); }
.link-card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.link-card small { color: var(--muted); }
.link-card .go {
  position: absolute;
  right: 12px; bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--accent-text);
}
.link-card .go svg { width: 16px; height: 16px; }

.faq-link {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.faq-link:hover { filter: brightness(115%); }

/* ---------- Social ---------- */
.social {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.social a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.social a:hover { transform: translateY(-2px); }
.social svg { width: 34px; height: 34px; flex: 0 0 auto; }

/* ---------- Förderung ---------- */
.funding { display: flex; flex-direction: column; gap: 1rem; }
.funding img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- FAQ / Akkordeon ---------- */
.faq-inner { max-width: 1000px; }
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-q-heading { margin: 0; font: inherit; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.05rem 1.1rem;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: left;
  border: 0;
}
.faq-question svg { margin-left: auto; flex: 0 0 auto; transition: transform 0.22s ease; }
.faq-question[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-answer { display: none; padding: 1rem 1.1rem; color: var(--ink); line-height: 1.6; }
.faq-answer.is-open { display: block; }
.faq-answer p { margin: 0 0 0.7rem; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul { margin: 0.2rem 0 0.7rem; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.35rem; }

/* ---------- Rechtsseiten (Impressum / Datenschutz) ---------- */
.legal { max-width: 820px; }
.legal .breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 0; }
.legal .breadcrumb a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal h1 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin: 0.2rem 0 0;
}
.legal .updated { color: var(--muted); margin: 0; }
.legal section { display: flex; flex-direction: column; gap: 0.7em; padding: 0; }
.legal h2 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  margin: 1.4rem 0 0;
}
.legal h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); margin: 0.6rem 0 0; }
.legal p, .legal li { font-size: 1.05rem; line-height: 1.65; max-width: 75ch; overflow-wrap: break-word; }
.legal ul { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 6px; }
.legal address { font-style: normal; line-height: 1.65; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal a[href^="http"], .legal a[href^="mailto"] { color: var(--accent-text); }

/* ---------- Footer ---------- */
footer,
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}
footer .container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem; }
footer a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .brand img { max-width: 160px; height: 60px; }
  .nav-links { gap: 0.9rem; }
  .social { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .brand img { max-width: 140px; }
  .container { padding-left: 1rem; padding-right: 1rem; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Druck ---------- */
@media print {
  header.site-header, footer, .skip-link, .burger { display: none !important; }
  body { background: #fff; color: #000; }
  section { padding: 0 0 1.2rem; }
  .info-card { box-shadow: none; border-color: #999; }
  a { color: #000; }
  .faq-answer { display: block !important; }
  .faq-question { background: none; color: #000; border-bottom: 1px solid #999; }
  .legal a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  h1, h2, h3 { page-break-after: avoid; }
  p, li, address { page-break-inside: avoid; }
}
