/* ==========================================================================
   Lobetal fragt nach — Projektwebseite (M1)
   Basis: CSS-Referenz „Wohnen an der Schmiede" (Style 1, zugänglich)
   Erweiterungen: Kategoriefarben (Style 2), Memory-Pastelle, Sprechblase
   ========================================================================== */

:root {
  /* Farben (übernommen aus Style 1 der Schmiede-Referenz) */
  --bg: #f5f7f4;
  --surface: #ffffff;
  --primary: #2c5f2d;
  --primary-light: #4a9d4f;
  --accent: #1565c0;
  --text: #1f2933;
  --text-muted: #6b7280;
  --border: #d1d5db;

  /* Kategoriefarben (übernommen aus Style 2) */
  --cat-youth: #ffb300;
  --cat-culture: #ff6f00;
  --cat-faith: #2196f3;
  --cat-nature: #4caf50;
  --cat-inclusion: #9c27b0;
  --cat-mobility: #00acc1;
  --cat-amt: #3949ab;

  /* Memory-Pastelle (Rückseiten-Konzept v3.3) */
  --pastel-gruen: #dce9d4;
  --pastel-creme: #f5ecda;

  /* Typografie (barrierearm, wie Referenz) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-base: 1.0625rem;      /* leicht über 16px für Lesbarkeit */
  --lh-base: 1.65;
  --radius: 0.75rem;
  --shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
  --max-width: 72rem;
}

/* Schriftgrößen-Schalter (sessionStorage, kein Cookie) */
html.fs-mid { font-size: 112.5%; }
html.fs-big { font-size: 125%; }

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: radial-gradient(circle at top, #e8f5e9 0, var(--bg) 45%);
}

/* Skip-Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

/* Kopfzeile und Navigation */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  font-size: 1.15rem;
}
.brand img { width: 44px; height: 44px; }

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  cursor: pointer;
}
.main-nav ul {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  min-height: 44px;
}
.main-nav a[aria-current="page"] {
  background: var(--pastel-gruen);
  color: var(--primary);
  font-weight: 700;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: #e0f2fe;
}

@media (max-width: 52rem) {
  .nav-toggle { display: block; }
  .main-nav ul { display: none; flex-direction: column; width: 100%; }
  .main-nav ul.open { display: flex; }
}

/* Werkzeugleiste (Schriftgröße) */
.toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
}
.toolbar button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  min-width: 44px;
  min-height: 44px;
  font-size: 1rem;
  cursor: pointer;
}
.toolbar button[aria-pressed="true"] {
  background: var(--pastel-gruen);
  border-color: var(--primary);
}

/* Hero mit Sprechblase */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0;
}
@media (max-width: 52rem) { .hero { grid-template-columns: 1fr; } }

.bubble {
  position: relative;
  background: var(--surface);
  border: 3px solid var(--primary);
  border-radius: 1.5rem;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  margin: 0;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 3rem;
  bottom: -1.35rem;
  border: 0.9rem solid transparent;
  border-top-color: var(--primary);
  border-left-color: var(--primary);
}
.hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1, h2, h3 { line-height: 1.3; margin: 0 0 0.75rem; }
h1 { font-size: clamp(1.9rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin-top: 2.25rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }
p { margin: 0 0 0.9rem; }
a { color: var(--accent); }

section { margin-top: 2.5rem; }
.section-tag { color: var(--text-muted); margin-top: -0.4rem; }

/* Karten-Raster */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--cat-nature);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card--nature { border-top-color: var(--cat-nature); }
.card--mobility { border-top-color: var(--cat-mobility); }
.card--culture { border-top-color: var(--cat-culture); }
.card--inclusion { border-top-color: var(--cat-inclusion); }
.card--youth { border-top-color: var(--cat-youth); }
.card--faith { border-top-color: var(--cat-faith); }
.card--amt { border-top-color: var(--cat-amt); }

/* Schritte (1-2-3) */
.steps { counter-reset: schritt; }
.steps .card { position: relative; padding-top: 2.6rem; }
.steps .card::before {
  counter-increment: schritt;
  content: counter(schritt);
  position: absolute;
  top: 0.9rem;
  left: 1.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* Stand-/Quellen-Box und Prüfstufe */
.stand-box {
  background: var(--pastel-creme);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.stand-box strong { color: var(--primary); }

.pruefstufe {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1.5px solid var(--cat-amt);
  color: var(--cat-amt);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

figure { margin: 1.5rem 0; }
figure img {
  width: 100%;
  max-width: 46rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
figcaption { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.4rem; }

/* Quellen-Tabelle */
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { border: 1px solid var(--border); padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; }
th { background: var(--pastel-gruen); }

/* Buttons & Chips */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
}
.btn:hover, .btn:focus-visible { background: var(--primary-light); outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--ghost { background: var(--surface); color: var(--primary); border: 2px solid var(--primary); }

/* Ideen-Notiz (sessionStorage) */
.idea-text {
  width: 100%;
  min-height: 5.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  font: inherit;
  margin-bottom: 0.6rem;
}
.hinweis { color: var(--text-muted); font-size: 0.95rem; }

/* Fußzeile */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.foerderlogo {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1rem;
  background: #fff;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.8rem;
}
/* Fokus-Stile */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Vorlese-Leiste (Web Speech API) */
.tts-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 3px solid var(--primary);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.15);
  padding: 0.7rem 1rem;
  gap: 0.7rem;
  align-items: center;
}
.tts-bar.on { display: flex; }
.tts-bar .tts-satz {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  max-height: 4.2em;
  overflow-y: auto;
}
.tts-bar button {
  border: 1px solid var(--border);
  background: var(--pastel-gruen);
  border-radius: var(--radius);
  min-width: 48px;
  min-height: 48px;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
}
.tts-bar .js-tts-stop { background: var(--surface); }

/* Audio-Leiste (professionelle Vorles-MP3s) */
.audio-bar audio { flex: 1; min-width: 0; height: 44px; }
.audio-bar .audio-tempo { display: flex; gap: 0.3rem; flex-shrink: 0; }
.audio-bar .audio-tempo button {
  min-width: 56px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--surface);
}
.audio-bar .audio-tempo button[aria-pressed="true"] {
  background: var(--pastel-gruen);
  border-color: var(--primary);
}
.audio-bar .js-audio-close { background: var(--surface); }
.audio-bar .audio-stimme-label {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.audio-bar .audio-stimme {
  font-size: 0.95rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.3rem 0.5rem;
  max-width: 15rem;
}
