/* legal.css — shared styling for AGB / Datenschutz / Widerruf legal pages.
   Mirrors the dark-editorial token system (tokens.css) with safe fallbacks so
   the pages render correctly even if a token is missing. Light/dark via
   [data-theme] on <html>. */

:root {
  --legal-bg: var(--color-bg, #111113);
  --legal-surface: var(--color-surface, #1a1a1d);
  --legal-text: var(--color-text, #ececf0);
  --legal-text-muted: var(--color-text-muted, #a0a0a8);
  --legal-border: var(--color-border, #2a2a2e);
  --legal-accent: var(--color-accent, #ff4081);
  --legal-max: 760px;
}

[data-theme="light"] {
  --legal-bg: var(--color-bg, #ffffff);
  --legal-surface: var(--color-surface, #f6f6f8);
  --legal-text: var(--color-text, #16161a);
  --legal-text-muted: var(--color-text-muted, #55555f);
  --legal-border: var(--color-border, #e4e4ea);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--legal-bg);
  color: var(--legal-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.legal-page {
  max-width: var(--legal-max);
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ── Nav ── */
.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--legal-border);
  flex-wrap: wrap;
}

.legal-logo { display: inline-flex; align-items: center; text-decoration: none; }
.legal-logo .logo-full-img { height: 44px; width: auto; }

/* Theme-correct logo swap: show EXACTLY ONE logo per theme. Scoped under
   .legal-logo + theme attribute so neither rule can be overridden into showing
   both (the earlier `.legal-logo .logo-full-img{display:block}` did exactly that
   in light theme, which rendered two logos). */
.legal-logo .logo-dark,
.legal-logo .logo-light { display: none; }
[data-theme="dark"] .legal-logo .logo-dark { display: block; }
[data-theme="light"] .legal-logo .logo-light { display: block; }

.legal-back {
  color: var(--legal-text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}
.legal-back:hover { color: var(--legal-accent); }

/* ── Content ── */
.legal-content h1 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 8px 0 8px;
}

.legal-updated {
  color: var(--legal-text-muted);
  font-size: 14px;
  margin: 0 0 40px;
}

.legal-content section { margin: 0 0 32px; }

.legal-content h2 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
}

.legal-content h3 {
  font-weight: 600;
  font-size: 17px;
  margin: 24px 0 8px;
}

.legal-content p {
  margin: 0 0 14px;
  color: var(--legal-text);
}

.legal-content ul,
.legal-content ol { margin: 0 0 16px; padding-left: 22px; }
.legal-content li { margin-bottom: 6px; }

.legal-content strong { font-weight: 600; }

.legal-content a {
  color: var(--legal-accent);
  text-decoration: none;
  word-break: break-word;
}
.legal-content a:hover { text-decoration: underline; }

/* ── Nav actions (language toggle + back link, grouped on the right) ── */
.legal-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language toggle — ported from landing.css so legal pages (which don't load
   landing.css) get the identical pill button. Tokens come from tokens.css. */
.lang-toggle {
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-3, 12px);
  border-radius: var(--radius-full, 999px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, var(--legal-text-muted));
  background: transparent;
  border: 1px solid var(--border-color, var(--legal-border));
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.lang-toggle:hover {
  color: var(--text-primary, var(--legal-text));
  border-color: var(--border-hover, var(--legal-accent));
  background: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .lang-toggle { border-color: var(--border-color, var(--legal-border)); }
[data-theme="light"] .lang-toggle:hover { background: rgba(0, 0, 0, 0.05); }

/* ── Binding-language note (shown on every legal page) ── */
.legal-binding-note {
  margin: 0 0 32px;
  padding: 10px 14px;
  border-left: 3px solid var(--legal-accent);
  background: rgba(255, 64, 129, 0.06);
  border-radius: 0 6px 6px 0;
  color: var(--legal-text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ── Cross-page legal footer strip (Impressum) ── */
.legal-footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--legal-border);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
}
.legal-footer a {
  color: var(--legal-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.legal-footer a:hover { color: var(--legal-accent); }

@media (max-width: 600px) {
  .legal-page { padding: 24px 16px 64px; }
  .legal-nav { gap: 12px; }
  .legal-nav-actions { gap: 10px; }
  .legal-footer { gap: 16px; }
}
