/* =====================================================================
   Rechtsseiten (/impressum/, /datenschutz/, /agb/, /widerruf/) und 404
   im hellen Look der Startseite. Baut auf start.css auf; hier nur, was es
   dort nicht gibt. Die Rechtstexte selbst bleiben unveraendert, nur ihre
   vorhandenen Klassen (legal-*) werden neu gestaltet.
   Drei Abstandsstufen: --u-abschnitt, --u-block, --u-satz.
   ===================================================================== */

.seite-recht {
  --u-abschnitt: clamp(44px, 5vw, 64px);
  --u-block: 28px;
  --u-satz: 14px;
  --toc-oben: 96px;
}

/* ---------- Kopf der Seite: Brotkrumen, Kategorie, H1 ---------- */
.recht-kopf { padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 4vw, 52px); border-bottom: 1px solid var(--line); }
.recht-kopf::before {
  background-image: linear-gradient(to right, #d1d5db 1px, transparent 1px), linear-gradient(to bottom, #d1d5db 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 55% 90% at 0% 0%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 55% 90% at 0% 0%, #000 30%, transparent 80%);
}
.brotkrumen { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--u-block); font-size: 14px; color: var(--ink-3); }
.brotkrumen a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.brotkrumen a:hover { color: var(--accent); }
.recht-kategorie { margin-bottom: 10px; font: 600 15px/1.4 Manrope, sans-serif; color: var(--accent); }
.recht-kopf h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.05; max-width: 16em; hyphens: manual; }
.recht-stand { margin-top: var(--u-satz); font-size: 14px; color: var(--ink-3); }

/* ---------- Zweispaltig: Inhaltsverzeichnis links, Text rechts ---------- */
.recht-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--u-block); padding-top: clamp(28px, 4vw, 56px); padding-bottom: var(--section); }

.recht-toc details { border: 1px solid var(--line-mid); border-radius: var(--r-card); background: var(--tint-weak); }
.recht-toc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; list-style: none; cursor: pointer;
  font: 600 15px/1.3 var(--head); letter-spacing: -.01em; color: var(--ink);
}
.recht-toc summary::-webkit-details-marker { display: none; }
.recht-toc summary .ic { width: 18px; height: 18px; color: var(--ink-3); transition: transform .25s var(--ease); }
.recht-toc details[open] summary .ic { transform: rotate(180deg); }
.recht-toc ol { list-style: none; display: grid; gap: 2px; padding: 0 10px 12px; }
.recht-toc a {
  display: block; padding: 7px 10px; border-radius: var(--r-btn);
  font-size: 14.5px; line-height: 1.4; color: var(--ink-2); hyphens: manual;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.recht-toc a:hover { color: var(--accent); }
.recht-toc a[aria-current] { color: var(--accent-deep); font-weight: 600; background: var(--tint); }

@media (min-width: 1000px) {
  .recht-raster { grid-template-columns: 250px minmax(0, 760px); gap: clamp(56px, 6vw, 96px); }
  .recht-raster--ohne-toc { grid-template-columns: minmax(0, 760px); }
  .recht-toc { position: sticky; top: var(--toc-oben); align-self: start; max-height: calc(100vh - var(--toc-oben) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .recht-toc details { border: 0; background: none; }
  .recht-toc summary { padding: 0 0 12px; cursor: default; font: 600 13px/1.3 Manrope, sans-serif; color: var(--ink-3); }
  .recht-toc summary .ic { display: none; }
  .recht-toc ol { padding: 0; gap: 0; border-left: 1px solid var(--line-mid); }
  .recht-toc a { margin-left: -1px; padding: 6px 0 6px 16px; border-radius: 0; border-left: 2px solid transparent; font-size: 14px; }
  .recht-toc a[aria-current] { background: none; border-left-color: var(--accent); }
}

/* ---------- Rechtstext ---------- */
.recht-text { max-width: 760px; min-width: 0; font-size: 17px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; hyphens: manual; }
@media (max-width: 759px) { .recht-text { hyphens: auto; } }
.recht-text > :first-child { margin-top: 0; }
.recht-text h2, .recht-text h3, .recht-text h4 { overflow-wrap: normal; hyphens: manual; scroll-margin-top: var(--toc-oben); }
.recht-text h2 { margin-top: var(--u-abschnitt); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
.recht-text h3 { margin-top: var(--u-block); font-size: 19.5px; line-height: 1.3; letter-spacing: -.015em; }
.recht-text h4 { margin-top: var(--u-block); font: 700 16.5px/1.4 Manrope, sans-serif; letter-spacing: 0; color: var(--ink); }
.recht-text p, .recht-text ul, .recht-text ol { margin-top: var(--u-satz); }
.recht-text h2 + p, .recht-text h2 + ol, .recht-text h2 + h3 { margin-top: var(--u-satz); }
.recht-text strong { font-weight: 700; color: var(--ink); }
.recht-text a { color: var(--accent-deep); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.recht-text a:hover { color: var(--accent); text-decoration-color: currentColor; }
.recht-text ul { list-style: disc; padding-left: 1.3em; }
.recht-text ul li { padding-left: 4px; }
.recht-text ul li + li { margin-top: 6px; }
.recht-text li::marker { color: var(--accent); }

/* Nummerierte Absaetze (AGB, Widerruf): (1), (2) ... */
.recht-text .legal-list { list-style: none; counter-reset: absatz; padding: 0; }
.recht-text .legal-list li { counter-increment: absatz; position: relative; padding-left: 44px; }
.recht-text .legal-list li + li { margin-top: var(--u-satz); }
.recht-text .legal-list li::before { content: "(" counter(absatz) ")"; position: absolute; left: 0; top: 0; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }

.recht-text .legal-meta { color: var(--ink-2); }
.recht-text .legal-subtitle { font-style: italic; color: var(--ink-3); }
.recht-text .legal-divider { height: 1px; margin-top: var(--u-abschnitt); background: var(--line-mid); }
.recht-text .legal-divider + h2 { margin-top: var(--u-block); }

/* Hervorgehobener Absatz (Widerspruchsrecht) */
.recht-text .legal-important { margin-top: var(--u-block); padding: 20px 22px; border: 1px solid var(--line-mid); border-radius: var(--r-card); background: var(--tint-weak); }
.recht-text .legal-important > :first-child { margin-top: 0; }
.recht-text .legal-important p { font-size: 16px; }

/* Abschluss (AGB) */
.recht-text .legal-sign { margin-top: var(--u-abschnitt); padding: 22px 24px; border: 1px solid var(--line-mid); border-radius: var(--r-card); background: var(--paper-2); }
.recht-text .legal-sign .name { font: 500 20px/1.3 var(--head); letter-spacing: -.02em; color: var(--ink); }
.recht-text .legal-sign p { margin-top: 8px; font-size: 15px; color: var(--ink-3); }
.recht-text .legal-version { margin-top: var(--u-satz); font-size: 13px; color: var(--ink-3); }

/* Aktuelle Rechtsseite im Fuss */
.fuss-spalte a[aria-current="page"] { color: var(--accent-deep); font-weight: 700; }

/* ---------- 404 ---------- */
.fehler { padding: clamp(48px, 7vw, 96px) 0 clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.fehler::before {
  background-image: linear-gradient(to right, #d1d5db 1px, transparent 1px), linear-gradient(to bottom, #d1d5db 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 0% 0%, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 90% at 0% 0%, #000 35%, transparent 85%);
}
.fehler-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--u-block); align-items: center; }
.fehler h1 { font-size: clamp(38px, 5.6vw, 68px); line-height: 1.04; max-width: 11em; }
.fehler-lead { margin-top: 20px; max-width: 32em; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; }
.fehler-weiter { margin-top: var(--u-satz); color: var(--ink); font-weight: 600; }
.fehler-knoepfe { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; }
.fehler-notiz { position: absolute; left: 4px; top: -40px; display: inline-flex; align-items: flex-start; gap: 2px; font: 600 25px/1 Caveat, cursive; color: var(--accent); transform: rotate(-4deg); white-space: nowrap; pointer-events: none; }
.fehler-notiz svg { width: 30px; height: 34px; margin: 10px 0 0 6px; overflow: visible; transform: rotate(10deg); }
.fehler-notiz path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fehler-zahl {
  justify-self: center; font: 600 clamp(120px, 24vw, 300px)/.9 var(--head); letter-spacing: -.06em; user-select: none;
  background:
    linear-gradient(to right, rgba(108, 43, 242, .3) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(to bottom, rgba(108, 43, 242, .3) 1px, transparent 1px) 0 0 / 18px 18px,
    #EDE4FD;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.fehler-liste { padding: clamp(48px, 6vw, 80px) 0 var(--section); }
.fehler-liste h2 { font-size: clamp(24px, 2.8vw, 32px); }
.fehler-leistungen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: var(--u-block); }
.fehler-leistung { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 18px; border-radius: var(--r-card); background: var(--paper); border: 1px solid var(--line-mid); color: var(--ink); transition: background-color .2s var(--ease); }
.fehler-leistung:hover { background: color-mix(in srgb, var(--farbe) 6%, #fff); }
.fehler-leistung:hover .ic-pfeil { transform: translateX(3px); }

@media (min-width: 760px) {
  .fehler-leistungen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .fehler-raster { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .fehler-leistungen { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  .fehler-zahl { grid-row: 1; justify-self: start; font-size: 112px; }
  .fehler-knoepfe .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .recht-toc summary .ic { transition: none; }
}
