/* ============================================================
   legal-pages.css — Gemeinsames Design-System für Rechts-/Support-Seiten
   Hicri Takvim · Ummah Services
   Eingebunden via: <link rel="stylesheet" href="./legal-pages.css">
   Kein Build-Schritt erforderlich — standalone-tauglich.
   ============================================================ */

/* ── Design-Token ───────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Kern-Farben (Light) */
  --bg: #fbf8f1;
  --fg: #1a1a1a;
  --muted: #555;
  --primary: #005b2f;
  --primary-soft: #e8f5ee; /* Card-Akzent, Hinweis-Hintergrund */
  --card: #fff;
  --border: #e6e3da;

  /* Typografie */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --line-height: 1.5;

  /* Abstände */
  --radius-card: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #f4f1ea;
    --muted: #9a978f;
    --primary: #4fc788;
    --primary-soft: #1a2e22;
    --card: #1e1e1e;
    --border: #2a2a2a;
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  }
}

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

/* ── Basis ──────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: var(--line-height);
  padding: 16px 14px 48px;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

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

/* ── Haupt-Container ────────────────────────────────────────── */

/**
 * .legal-main
 * Zentrierter Inhaltsbereich; max 720 px; bricht auf kleinen Schirmen
 * mobil-freundlich durch Padding.
 */
.legal-main {
  max-width: 720px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────── */

/**
 * .legal-header
 * Flexbox-Zeile mit Logo + H1; bleibt oben stehen (nicht sticky, da
 * standalone-Seiten kein Scroll-Container-Problem haben).
 */
.legal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.legal-header img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ── Typografie-Hierarchie ──────────────────────────────────── */
h1 {
  font-size: 1.55rem;
  margin: 0;
  color: var(--primary);
  line-height: 1.25;
}

h2 {
  font-size: 1.1rem;
  margin-top: 18px;
  margin-bottom: 4px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

h3 {
  font-size: 1rem;
  margin-top: 20px;
  margin-bottom: 4px;
  color: var(--primary);
}

p,
ul,
ol {
  margin: 0.5em 0;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 4px;
}

/* ── Stand-Zeile ────────────────────────────────────────────── */

/**
 * .legal-updated
 * Kleine, gedämpfte "Stand: …"-Zeile direkt unter dem Header oder
 * oben in einem Tab-Panel.
 */
.legal-updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ── Inline-Icon ────────────────────────────────────────────── */

/**
 * .legal-icon
 * Inline-SVG oder <img> neben einer h2-Überschrift;
 * 1 em groß, vertikal zentriert.
 */
.legal-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  flex-shrink: 0;
  fill: currentColor;
}

/* ── Sprach-Tabs (ARIA-Tablist) ─────────────────────────────── */

/**
 * .legal-tablist / [role="tablist"]
 * Flex-Reihe aus Pill-Buttons; läuft auf kleinen Schirmen um.
 */
.legal-tablist,
[role="tablist"] {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/**
 * [role="tab"]
 * Pill-Button; inaktiv = umrandet, aktiv = primary-Hintergrund.
 * Touch-Target mindestens 44 px durch min-height.
 */
[role="tab"] {
  background: var(--card);
  color: var(--fg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

[role="tab"][aria-selected="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

[role="tab"]:hover:not([aria-selected="true"]) {
  border-color: var(--primary);
  color: var(--primary);
}

[role="tab"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Tab-Panels ─────────────────────────────────────────────── */

/**
 * [role="tabpanel"]
 * Ausgeblendet bis .active gesetzt wird (via JS).
 */
[role="tabpanel"] {
  display: none;
}

[role="tabpanel"].active {
  display: block;
}

/* ── Section + Card ─────────────────────────────────────────── */

/**
 * .legal-section
 * Visuell abgetrennter Abschnitt innerhalb eines Tab-Panels;
 * kein Schatten, nur Abstand.
 */
.legal-section {
  margin-bottom: 20px;
}

/**
 * .legal-card
 * Karten-Container für gruppierte Inhalte (z. B. Kontaktblock,
 * Adressblock im Impressum). Weißer Hintergrund, Schatten, Radius 12 px.
 */
.legal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ── Hinweis-Blöcke ─────────────────────────────────────────── */

/**
 * .legal-notice
 * Neutraler Hinweis-Block (z. B. Datenschutz-Kurzübersicht).
 * Linker Primary-Balken, primary-soft Hintergrund.
 */
.legal-notice {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 0.95rem;
}

/**
 * .legal-warning
 * Auffälligerer Warn-Block (z. B. Impressum-Pflicht-Adress-Banner,
 * Pflichtfelder). Identisches Layout wie .legal-notice.
 */
.legal-warning {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── FAQ-Akkordeon (natives <details>) ──────────────────────── */

/**
 * .legal-faq details / .legal-faq summary
 * Nativer <details>-Toggle; kein JS nötig.
 * Summary: Cursor pointer, custom Marker via list-style-type.
 */
.legal-faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.legal-faq details[open] {
  background: var(--card);
}

.legal-faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  list-style-type: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  user-select: none;
}

.legal-faq summary::-webkit-details-marker {
  display: none;
}

/* Pfeil-Icon per ::after */
.legal-faq summary::after {
  content: "▸";
  color: var(--primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.legal-faq details[open] > summary::after {
  transform: rotate(90deg);
}

.legal-faq summary:hover {
  color: var(--primary);
}

.legal-faq summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.legal-faq details > *:not(summary) {
  padding: 0 16px 16px;
}

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

/**
 * .legal-footer
 * Seitenfuß mit Cross-Link-Navigation zu allen 4 Seiten.
 */
.legal-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/**
 * .legal-footer-nav
 * Flex-Reihe mit Links zu den 4 Seiten; läuft auf kleinen Schirmen um.
 * Trennzeichen via gap und optionalem · im HTML.
 */
.legal-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 10px;
}

.legal-footer-nav a {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.legal-footer-nav a:hover,
.legal-footer-nav a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

/* ── Barrierefreiheit: Reduced Motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [role="tab"],
  .legal-faq summary::after {
    transition: none;
  }
}

/* ── Responsive ab 480 px ───────────────────────────────────── */
@media (min-width: 480px) {
  body {
    padding: 32px 24px 80px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .legal-card {
    padding: 24px 28px;
  }
}
