/* Rechtstext lang – Datenschutzerklärung, AGB (Owner: wdf-section-builder, Auftrag B-rechtstexte) — nur Tokens, mobil zuerst.
   Erweitert die Impressum-Vorlage (impressum-010-rechtstext.css, wird davor geladen) um das, was lange Texte brauchen:
   Stand-Zeile, Einleitung, Inhaltsverzeichnis (Muster wie .ra-toc im Ratgeber-Artikel), Blöcke Überschrift über Inhalt,
   H3-Zwischenüberschriften, Listen, Adressen und die Kennzeichnung offener Kundenangaben (data-wdf-todo).
   Mobil: Kopf → Inhaltsverzeichnis (aufklappbar) → Einleitung → Blöcke. Ab 1024 px: Kopf mit Inhaltsverzeichnis links mitlaufend. */

/* ---------- Kopf ---------- */
.recht--lang .heading-1 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.recht-stand { color: var(--color-text-tertiary); }

/* ---------- Inhaltsverzeichnis ---------- */
.recht-toc { margin-top: var(--space-8); border-radius: var(--radius-lg); background: var(--gradient-card-module); box-shadow: var(--shadow-card); }
.recht-toc summary { display: flex; align-items: center; justify-content: space-between; min-height: var(--size-button); padding: 0 var(--space-16) 0 var(--space-24);
  color: var(--color-text-secondary); cursor: pointer; list-style: none; border-radius: inherit; }
.recht-toc summary::-webkit-details-marker { display: none; }
.recht-toc summary:focus-visible { outline-offset: calc(-1 * var(--stroke-focus)); }
.recht-toc-plus { position: relative; width: var(--size-faq-toggle); height: var(--size-faq-toggle); border-radius: var(--radius-round); box-shadow: var(--ring-hairline); }
.recht-toc-plus::before, .recht-toc-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: var(--space-12); height: var(--stroke-bold);
  margin: calc(var(--stroke-bold) / -2) 0 0 calc(var(--space-12) / -2); background: var(--color-text-secondary); border-radius: var(--radius-pill);
  transition: transform var(--dur-base) var(--ease-out); }
.recht-toc-plus::after { transform: rotate(90deg); }
.recht-toc[open] .recht-toc-plus::after { transform: rotate(0deg); }
.recht-toc nav { padding: 0 var(--space-24) var(--space-16); }
.recht-toc ol { display: grid; }
.recht-toc a { display: flex; align-items: center; min-height: var(--size-target); padding: var(--space-6) 0; color: var(--color-text-secondary); text-decoration: none;
  font-size: var(--font-size-ui); line-height: var(--leading-snug); text-wrap: pretty; transition: color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .recht-toc a:hover { color: var(--color-text); } }

/* ---------- Lesespalte ---------- */
.recht-spalte { display: grid; gap: var(--space-40); min-width: 0; }
.recht-lead { max-width: 60ch; color: var(--color-text-secondary); font-size: var(--font-size-lead); line-height: var(--leading-body); text-wrap: pretty; }
.recht-lead strong { color: var(--color-text); font-weight: var(--font-weight-medium); }

.recht--lang .recht-block { gap: var(--space-16); padding: var(--space-32) 0; }
.recht--lang .recht-block h2 { font-size: var(--font-size-h3); line-height: var(--leading-h3); letter-spacing: var(--tracking-h3); }
.recht--lang .recht-inhalt { gap: var(--space-12); min-width: 0; overflow-wrap: break-word; }
.recht--lang .recht-inhalt h3 { margin-top: var(--space-24); color: var(--color-text); text-wrap: balance;
  font: var(--font-weight-display) var(--font-size-body-lg) / var(--leading-title) var(--font-display); letter-spacing: var(--tracking-title); }
.recht--lang .recht-inhalt > h3:first-child { margin-top: 0; }
.recht--lang .recht-block strong { color: var(--color-text); font-weight: var(--font-weight-medium); }
.recht--lang .recht-block address { max-width: 60ch; color: var(--color-text-secondary); line-height: var(--leading-body); }
.recht--lang .recht-block ul { display: grid; gap: var(--space-8); max-width: 60ch; margin: var(--space-4) 0; color: var(--color-text-secondary); line-height: var(--leading-body); }
.recht--lang .recht-block li { position: relative; padding-left: var(--space-24); text-wrap: pretty; }
.recht--lang .recht-block li::before { content: ""; position: absolute; left: 0; top: calc(var(--leading-body) * .5em); top: round(calc(var(--leading-body) * .5em), 1px); width: var(--space-10); height: 1px; background: var(--color-accent); }
.recht--lang .recht-block .link { overflow-wrap: anywhere; }

/* ---------- Offene Kundenangaben (Scurio) ---------- */
.recht-todo { display: grid; gap: var(--space-12); padding: var(--space-16); border: 1px dashed var(--color-warm); border-radius: var(--radius-md); background: var(--color-warm-a10); }
.recht--lang .recht-block .recht-todo-hinweis { max-width: none; color: var(--color-warm); font-size: var(--font-size-mono-xs); line-height: var(--leading-mono); }
.recht-platzhalter { padding: 0 var(--space-4); border-radius: var(--radius-sm); background: var(--color-warm-a14); color: var(--color-warm);
  font-family: var(--font-mono); font-size: var(--font-size-mono-md); overflow-wrap: anywhere; }

@media (min-width: 768px) {
  /* Lange Texte: Überschrift über dem Inhalt, damit die Lesespalte breit genug bleibt (Impressum: nebeneinander). */
  .recht--lang .recht-block { grid-template-columns: minmax(0, 1fr); padding: var(--space-40) 0; }
  .recht-todo { padding: var(--space-20) var(--space-24); }
}
@media (min-width: 1024px) {
  .recht--lang .recht-in { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .recht--lang .recht-kopf { gap: var(--space-20); }
  .recht--lang .heading-1 { font-size: min(var(--font-size-h1), var(--font-size-h2) * 1.25); }
  .recht-toc { margin-top: var(--space-16); background: none; box-shadow: none; border-radius: 0; }
  .recht-toc summary { min-height: 0; padding: 0 0 var(--space-12); pointer-events: none; color: var(--color-text-tertiary); }
  .recht-toc-plus { display: none; }
  .recht-toc nav { padding: 0; border-top: 1px solid var(--color-line); padding-top: var(--space-8); }
  .recht-toc a { min-height: var(--space-32); padding: var(--space-4) 0; font-size: var(--font-size-small); }
  .recht-spalte { padding-top: var(--space-8); }
}
/* Niedrige Fenster: Kopf samt Inhaltsverzeichnis würde nicht ganz sichtbar mitlaufen → normal scrollen. */
@media (min-width: 1024px) and (max-height: 760px) {
  .recht--lang .recht-kopf { position: static; }
}
/* Langes Inhaltsverzeichnis (AGB, 13 Einträge, Kopf ≈ 730 px + Abstand oben ≈ 140 px) braucht mehr Höhe. */
@media (min-width: 1024px) and (max-height: 880px) {
  .recht--lang .recht-kopf:has(.recht-toc li:nth-child(11)) { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .recht-toc-plus::before, .recht-toc-plus::after, .recht-toc a { transition: none; }
}
