/* ==========================================================================
   FAHRSCHULPORTAL: DIE TEXTSEITEN
   (/datenschutz, /impressum, /nutzungsbedingungen, /konto-loeschen, und
   die Artikel unter /hilfe, die dasselbe Lese-Layout nutzen)
   ==========================================================================

   After /styles.css, /brand.css and /landing.css: header, footer, buttons
   and icons are the landing page's (src/lib/site-shell.js renders the
   frame). This file is the page between them:

     .pg-hero     crumbs, title, stand, the tabs between the legal pages —
                  over the landing page's ruled paper and a soft light;
     .pg-layout   a reading column and, beside it, a table of contents that
                  stays in view and marks where you are (js/pages.js);
     .lp          the text itself: a reading measure, clear section heads
                  with their number, links that look like links.

   Long text, so motion is limited to the page arriving and the contents
   following the reader. Prefix `pg-` (page), `lp-` kept for the building
   blocks the fragments under src/views/legal/ already use.
   ========================================================================== */

[data-i="life-buoy"] { --m: url("/app/vendor/lucide/life-buoy.svg"); }
[data-i="arrow-left"] { --m: url("/app/vendor/lucide/arrow-left.svg"); }

.pg { --pg-measure: 700px; --pg-side: 250px; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.pg-hero { position: relative; padding: 72px 0 40px; }
.pg-hero-bg {
  position: absolute;
  inset: calc(var(--ln-header) * -1) 0 -80px;
  overflow: hidden;
  pointer-events: none;
  /* Fade out at the bottom: the light never ends in an edge. */
  mask-image: linear-gradient(#000 55%, transparent);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
}
.pg-hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(55% 70% at 50% 20%, #000 10%, transparent 100%);
  -webkit-mask-image: radial-gradient(55% 70% at 50% 20%, #000 10%, transparent 100%);
}
.pg-hero-bg::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--ln-tint) / 0.1), transparent);
  filter: blur(20px);
}
.pg-hero-in { position: relative; width: min(100% - var(--ln-gut) * 2, calc(var(--pg-side) + var(--pg-measure) + 64px)); margin: 0 auto; }
.pg-hero-in.is-center { display: flex; flex-direction: column; align-items: center; max-width: 760px; text-align: center; }
.js .pg-hero-in > * { animation: ln-enter 800ms var(--ease-out) both; }
.js .pg-hero-in > :nth-child(2) { animation-delay: 60ms; }
.js .pg-hero-in > :nth-child(3) { animation-delay: 120ms; }
.js .pg-hero-in > :nth-child(4) { animation-delay: 180ms; }
.js .pg-hero-in > :nth-child(5) { animation-delay: 240ms; }

.pg-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--ink-faint); font-size: var(--t-base); }
.pg-crumbs .ln-i { --ln-i: 13px; opacity: .6; }
.pg-crumbs a { color: var(--ink-muted); transition: color var(--d-fast) ease; }
.pg-crumbs [aria-current] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .pg-crumbs a:hover { color: var(--ink); } }

.pg-title { font-size: clamp(32px, 4.2vw, 52px); font-weight: var(--w-semi); line-height: 1.05; letter-spacing: -0.045em; text-wrap: balance; }
.pg-title.is-xl { font-size: clamp(38px, 5.6vw, 68px); }
.pg-lead { max-width: 60ch; margin-top: 16px; color: var(--ink-muted); font-size: 18px; line-height: 1.6; text-wrap: pretty; }
.pg-stand { display: flex; align-items: flex-start; gap: 8px; max-width: 70ch; margin-top: 16px; color: var(--ink-faint); font-size: var(--t-md); line-height: 1.5; }
.pg-stand .ln-i { --ln-i: 14px; flex: none; margin-top: 3px; }

.pg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.pg-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--ln-tint) / 0.02);
  color: var(--ink-muted);
  font-size: var(--t-base);
  font-weight: var(--w-medium);
  transition: border-color var(--d-fast) ease, color var(--d-fast) ease, background var(--d-fast) ease;
}
.pg-tabs .ln-i { --ln-i: 15px; }
.pg-tabs a[aria-current] { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
@media (hover: hover) and (pointer: fine) { .pg-tabs a:not([aria-current]):hover { border-color: var(--line-strong); color: var(--ink); } }

/* ── Layout: contents beside the text ─────────────────────────────────── */
.pg-layout {
  display: grid;
  grid-template-columns: var(--pg-side) minmax(0, var(--pg-measure));
  justify-content: center;
  gap: 64px;
  width: min(100% - var(--ln-gut) * 2, calc(var(--pg-side) + var(--pg-measure) + 64px));
  margin: 24px auto 0;
}
.pg-layout.is-single { grid-template-columns: minmax(0, var(--pg-measure)); }
.pg-side { position: sticky; top: calc(var(--ln-header) + 28px); align-self: start; display: grid; gap: 20px; max-height: calc(100vh - var(--ln-header) - 56px); overflow: auto; scrollbar-width: none; }
.pg-side::-webkit-scrollbar { display: none; }
.pg-toc-title { margin-bottom: 10px; color: var(--ink-faint); font-size: var(--t-sm); font-weight: var(--w-semi); letter-spacing: .04em; text-transform: uppercase; }
.pg-toc ol { position: relative; margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.pg-toc a {
  position: relative;
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--ink-faint);
  font-size: var(--t-base);
  line-height: 1.4;
  transition: color var(--d-base) ease;
}
.pg-toc a::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; background: var(--ink); transform: scaleY(0); transition: transform var(--d-slow) var(--ease-out); }
.pg-toc a.is-on { color: var(--ink); }
.pg-toc a.is-on::before { transform: scaleY(1); }
@media (hover: hover) and (pointer: fine) { .pg-toc a:hover { color: var(--ink-muted); } }
.pg-side-card { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-faint); font-size: var(--t-base); line-height: 1.5; }
.pg-side-card > .ln-i { --ln-i: 18px; color: var(--ink); }
.pg-side-card a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* ── The text ─────────────────────────────────────────────────────────── */
.lp { min-width: 0; color: var(--ink-muted); font-size: 16px; line-height: 1.7; }
.lp > :first-child { margin-top: 0; }
.lp h2 {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 56px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: clamp(21px, 2vw, 25px);
  font-weight: var(--w-semi);
  line-height: 1.25;
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--ln-header) + 20px);
}
.lp > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pg-num { flex: none; min-width: 28px; color: var(--ln-slate); font: 500 14px/1 var(--font-mono); letter-spacing: 0; }
.pg-anchor { margin-left: 4px; color: var(--ink-faint); font-weight: var(--w-normal); text-decoration: none !important; opacity: 0; transition: opacity var(--d-fast) ease; }
.lp h2:hover .pg-anchor, .pg-anchor:focus-visible { opacity: 1; }
.lp h3 { margin: 32px 0 10px; color: var(--ink); font-size: 18px; font-weight: var(--w-semi); line-height: 1.35; letter-spacing: -0.01em; }
.lp p { margin: 0 0 16px; text-wrap: pretty; }
.lp ul, .lp ol { margin: 0 0 18px; padding-left: 1.3em; }
.lp li { padding-left: 4px; }
.lp li + li { margin-top: 8px; }
.lp li::marker { color: var(--ink-faint); }
.lp strong { color: var(--ink); font-weight: var(--w-semi); }
.lp a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color var(--d-fast) ease; }
@media (hover: hover) and (pointer: fine) { .lp a:hover { text-decoration-color: var(--ink-muted); } }
.lp address { margin: 0 0 16px; color: var(--ink-muted); font-style: normal; line-height: 1.7; }
.lp code { padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: .88em; }

/* A box for the one thing the reader came for: how to delete, whom to
   write to. */
.lp-box { margin: 0 0 20px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(180deg, rgb(var(--ln-tint) / 0.035), transparent), var(--surface); }
.lp-box > :first-child { margin-top: 0; }
.lp-box > :last-child { margin-bottom: 0; }

.lp table { width: 100%; margin: 0 0 20px; border-collapse: collapse; font-size: var(--t-md); }
.lp th, .lp td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-muted); line-height: 1.55; text-align: left; vertical-align: top; }
.lp th { color: var(--ink); font-weight: var(--w-semi); }
.lp-scroll { overflow-x: auto; margin: 0 0 20px; padding: 4px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lp-scroll table { min-width: 520px; margin: 0; }
.lp-scroll tr:last-child td { border-bottom: 0; }

/* ── Narrow ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .pg-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: var(--pg-measure); }
  .pg-side { position: static; max-height: none; }
  .pg-toc { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .pg-toc ol { border-left: 0; columns: 2; column-gap: 24px; }
  .pg-toc a { padding: 5px 0; }
  .pg-toc a::before { display: none; }
  .pg-side-card { display: none; }
  .pg-hero-in { max-width: var(--pg-measure); }
}
@media (max-width: 560px) {
  .pg-hero { padding: 44px 0 24px; }
  .pg-toc ol { columns: 1; }
  .lp { font-size: 15.5px; }
  .lp h2 { margin-top: 44px; padding-top: 22px; }
  .pg-tabs { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(var(--ln-gut) * -1); padding-right: var(--ln-gut); scrollbar-width: none; }
  .pg-tabs a { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .pg-hero-in > * { animation: none; }
}
