/* Eatova — Rechtsseiten (Impressum, Datenschutz, AGB).
 *
 * Page-level stylesheet for impressum.html / datenschutz.html / agb.html.
 * Loaded AFTER css/fonts.css, css/tokens.css, css/base.css and nothing else —
 * these pages never load hero.css or any section stylesheet.
 *
 * It owns exactly three scopes and touches nothing outside them:
 *   .lg-*      page chrome (sticky header, footer, tick rule)
 *   .legal*    the prose column. Element selectors (h2, p, ul, code …) are
 *              scoped under .legal on purpose: these are long-form legal
 *              documents, not sections, and base.css deliberately leaves bare
 *              headings and lists unstyled.
 *   .wordmark  the brand mark. hero.css owns it on the home page; these pages
 *              do not load hero.css, so the two rules from sections/_wordmark.html
 *              are repeated here verbatim.
 *
 * Every colour, font, radius and step comes from css/tokens.css. The one local
 * value is --lg-read: a reading ink mixed from --ink and --bg, because long
 * prose in --ink (16:1) glares and in --ink-2 (6.5:1) is thinner than a legal
 * text should be. Declared twice so browsers without color-mix() keep --ink-2.
 */

/* ---------- page shell ---------- */

.lg-body {
  --lg-read: var(--ink-2);
  --lg-read: color-mix(in oklab, var(--ink) 82%, var(--bg));   /* ≈ 11:1 on --bg */
  --lg-measure: 68ch;
  --lg-head-h: 60px;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.lg-body > main { flex: 1 0 auto; }

/* Prose column: ~65–70 characters at the body size below. The class sits
   alongside .container, it does not restyle it. */
.legal-container { max-width: calc(var(--lg-measure) + var(--gutter) * 2); }

/* ---------- brand mark (mirrors sections/_wordmark.html) ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.wordmark-ring {
  width: 0.82em;
  height: 0.82em;
  margin: 0 0.05em;
  transform: translateY(0.09em);
  color: var(--lime);
}

/* ---------- header ---------- */

.lg-head {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  background: var(--bg);
  border-bottom: var(--rule-hair) solid var(--line);
}
@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .lg-head {
    background: var(--bg-a85);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.lg-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  min-height: var(--lg-head-h);
  padding-block: var(--space-sm);
}

.lg-mark { font-size: 22px; }

.lg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) clamp(var(--space-md), 3vw, var(--space-lg));
}
.lg-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--ink-2);
  transition: color var(--dur-micro) var(--ease-out);
}
.lg-nav-link:hover { color: var(--ink); }
.lg-nav-link[aria-current="page"] { color: var(--ink); }
.lg-nav-link[aria-current="page"]::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}

/* ---------- document head ---------- */

.legal {
  padding-block: clamp(var(--space-xl), 7vw, var(--space-3xl)) clamp(var(--space-2xl), 9vw, var(--space-3xl));
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
  hyphens: auto;
}

.legal-kicker { margin-bottom: var(--space-md); }

/* Sits alongside .h1: the display size is right for a hero, not for a
   document that has to stay readable next to its own body text. */
.legal-title {
  font-size: clamp(34px, 5.6vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.032em;
  font-variation-settings: 'opsz' 72;
}

.legal-updated {
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* Tick rule — the app's gauge motif, drawn in CSS so these pages need no JS.
   Two layers of the same repeating gradient; the lime one is confined to the
   left 18 % by its background-size, so the rule reads as a part-filled gauge. */
.lg-rule {
  height: 14px;
  margin: clamp(var(--space-lg), 4vw, var(--space-xl)) 0 0;
  background-image:
    repeating-linear-gradient(90deg, var(--lime) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(90deg, var(--line-strong) 0 2px, transparent 2px 9px);
  background-size: 18% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  background-position: left center, left center;
}

/* Opening paragraph: one notch up from body size, so the document has a lede. */
.legal-intro {
  margin-top: clamp(var(--space-lg), 4vw, var(--space-xl));
  font-size: 1.06em;
  line-height: 1.6;
}

/* ---------- prose ---------- */

.legal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.5vw, 26px);
  line-height: 1.16;
  letter-spacing: -0.022em;
  font-variation-settings: 'opsz' 48;
  color: var(--ink);
  text-wrap: balance;
  margin: clamp(var(--space-xl), 5vw, 60px) 0 var(--space-sm);
  scroll-margin-top: calc(var(--lg-head-h) + var(--space-lg));
}

.legal h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.014em;
  font-variation-settings: 'opsz' 24;
  color: var(--ink);
  margin: var(--space-lg) 0 var(--space-xs);
  scroll-margin-top: calc(var(--lg-head-h) + var(--space-lg));
}

.legal p,
.legal li,
.legal address {
  color: var(--lg-read);
  text-wrap: pretty;
}

.legal p + p { margin-top: var(--space-sm); }

.legal ul,
.legal ol {
  margin: var(--space-md) 0;
  padding-left: 1.4em;
  display: grid;
  gap: 10px;
}
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
/* Marker sind Text (Nummern tragen Bedeutung): --ink-2 = 6,6:1 dunkel / 5,1:1 hell.
   --ink-3 fiel auf 3,45:1 / 2,72:1 und ist laut Token nur fuer dekorative Striche. */
.legal li::marker { color: var(--ink-2); }

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

/* Buttons keep their own colour pair. `.legal a` (0-1-1) outranks `.btn` (0-1-0), so the 404 page's
   only recovery link rendered lime-on-lime: 1.00:1, an invisible label inside a 195x52 pill.
   Excluding .btn restores --btn-fg and the button's underline-free look; prose links are untouched. */
.legal a:not(.btn) {
  color: var(--lime);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--lime-a40);
  transition: text-decoration-color var(--dur-micro) var(--ease-out);
}
.legal a:not(.btn):hover { text-decoration-color: currentColor; }

.legal address {
  font-style: normal;
  line-height: 1.75;
}

.legal code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
  background: var(--ink-a06);
  padding: 0.12em 0.36em;
  border-radius: 6px;
}

/* ---------- boxes ---------- */

.legal-box {
  background: var(--surf);
  border: var(--rule-hair) solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 28px) clamp(20px, 4vw, 30px);
  margin: var(--space-lg) 0;
}
.legal-box > :first-child { margin-top: 0; }

/* Reserved for the one block that must not be skimmed past (AGB § 4). */
.legal-box--accent {
  background: var(--surf-2);
  border-color: var(--lime-a25);
}

/* ---------- table of contents (Datenschutz) ---------- */

.legal-toc {
  margin: clamp(var(--space-lg), 4vw, var(--space-xl)) 0 0;
  padding: clamp(18px, 3.5vw, 24px);
  background: var(--surf);
  border: var(--rule-hair) solid var(--line);
  border-radius: var(--radius);
}
.legal-toc-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  display: grid;
  gap: 10px var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.legal-toc a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--lg-read);
  text-decoration: none;
}
.legal-toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal-toc-n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--lime);
  flex: none;
}

/* Nummerierte Paragraphen-Überschriften der AGB */
/* Accessible Name: "§ 1" + NBSP + Titel statt "§ 1Geltungsbereich" (Screenreader, Copy, Suche). */
.legal .para-num::after { content: " "; }  /* real U+00A0 on purpose: a CSS escape got mangled twice on its way through shell+python */
.legal .para-num {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.62em;
  letter-spacing: 0.04em;
  color: var(--lime);
  margin-right: 12px;
  white-space: nowrap;
}

/* ---------- footer ----------
   Ft5 Statement, identical to the React footer in src/sections/footer.tsx: statement sentence,
   hairline meta row under it, tick rule closing the page. The legal pages used to carry a reduced
   version of it -- no statement, no rule, mono copyright, and the whole thing squeezed into
   `.legal-container` (68ch = 703px at 1440) instead of the page container (1180px), which read as
   a different site's footer. The reading measure belongs to the prose, not to the chrome, so the
   footer takes `.container` like every section on the landing page. Values below are the resolved
   Tailwind classes of the React footer -- keep the two in sync. */

.lg-foot {
  padding-block: var(--section-y-tight) var(--space-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-2);
}

/* The statement. `.display .h2` carry the type; only the measure is footer-specific. */
.lg-foot-line { max-width: 38ch; }

.lg-foot-meta {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: var(--rule-hair) solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
}

.lg-foot-mark {
  font-size: 20px;
  min-height: 24px;
  transition: transform 140ms var(--ease-out);
}
/* Lift only where a real cursor can hover -- on touch this would stick after the tap. */
@media (hover: hover) and (pointer: fine) {
  .lg-foot-mark:hover { transform: translateY(-1px); }
}
.lg-foot-mark:active { transform: translateY(0) scale(0.97); }

.lg-foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
}
.lg-foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;          /* 24px hit target on a 21px line */
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 5px;
  transition: color var(--dur-micro) var(--ease-out),
              text-decoration-color var(--dur-micro) var(--ease-out);
}
.lg-foot-links a:hover,
.lg-foot-links a:focus-visible,
.lg-foot-links a:active { color: var(--ink); }
.lg-foot-links a:hover { text-decoration-color: var(--ink-2); }

/* Pushes itself and the copyright after it to the right edge of the row. */
.lg-foot-lang { margin-inline-start: auto; }

/* Tick rule: 44 lit bars, `justify-content: space-between` spreads the slack the 3px cap leaves. */
.lg-foot-rule {
  margin-top: var(--space-xl);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(3px, 1.2vw, 6px);
}
.lg-foot-rule i {
  display: block;
  flex: 1;
  min-width: 2px;
  max-width: 3px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--lime);
}

/* ---------- narrow screens ---------- */

@media (max-width: 560px) {
  .legal { font-size: 16px; }
  .lg-mark { font-size: 20px; }
  .lg-head-inner { row-gap: var(--space-sm); }
}

/* Under 640 the React footer stops wrapping and stacks: wordmark, links, note, copyright, each on
   its own line, left aligned. Wrapping alone broke the links across two ragged lines instead. */
@media (max-width: 639.98px) {
  .lg-foot-meta,
  .lg-foot-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .lg-foot-lang { margin-inline-start: 0; }
}

/* ---------- print ---------- */

@media print {
  .lg-head,
  .lg-foot,
  .lg-rule,
  .legal-toc { display: none; }

  .lg-body { --lg-read: #1a1a1a; background: #fff; color: #000; }
  .legal { padding-block: 0; font-size: 11pt; }
  .legal-title,
  .legal h2,
  .legal h3,
  .legal strong { color: #000; }
  .legal-kicker,
  .legal-updated { color: #444; }
  .legal a { color: #000; }
  .legal code { background: none; color: #000; }
  .legal-box { background: none; border-color: #999; }
  .legal h2, .legal h3 { break-after: avoid; }
  .legal p, .legal li { break-inside: avoid; }
}
