/* ==========================================================================
   recht.css · schlichte Darstellung der Rechtstexte (Entwurf, 27.09.2026, Claude)
   Nutzt nur Tokens aus /ui/tokens.css (--c-*, Ebene 1, Struktur-Tokens).
   Keine Farbwerte, keine externen Schriften, kein [data-theme] hier.
   Die Seiten werden aus claude/release/recht/*.md erzeugt (werkzeug/recht_html.cjs).
   ========================================================================== */

.recht {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.recht *,
.recht *::before,
.recht *::after { box-sizing: border-box; }

.recht-kopf,
.recht-text,
.recht-fuss {
  width: 100%;
  max-width: 44rem;             /* Lesebreite für Fliesstext, schmaler als das Spiel nicht nötig */
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Sprunglink: nur bei Tastaturfokus sichtbar */
.recht-sprung {
  position: absolute;
  left: var(--gutter);
  top: calc(-1 * var(--touch-main));
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface);
  color: var(--c-text);
  border: var(--border-w-strong) solid var(--c-focus);
  border-radius: var(--radius-btn);
  z-index: 10;
}
.recht-sprung:focus { top: var(--space-2); }

/* Entwurfs-Kopfzeile: immer sichtbar, bis die Texte freigegeben sind */
.recht-entwurf {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  background: var(--c-warn-bg);
  color: var(--c-text);
  border: var(--border-w-strong) dashed var(--c-warn);
  border-radius: var(--radius-card);
  font-size: var(--fs-small);
  line-height: var(--lh-ui);
}

/* Navigation zwischen den Rechtsseiten */
.recht-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.recht-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  border: var(--border-w) solid var(--c-edge);
  border-radius: var(--radius-chip);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
  font-size: var(--fs-hint);
  font-weight: var(--fw-strong);
}
.recht-nav a[aria-current="page"] {
  background: var(--c-primary);
  color: var(--c-on-primary);
  border-color: var(--c-primary);
}

/* Text */
.recht-text { padding-top: var(--space-5); padding-bottom: var(--space-6); }

.recht-text h1,
.recht-text h2,
.recht-text h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-tight);
  color: var(--c-text);
}
.recht-text h1 { font-size: var(--fs-title); margin: 0 0 var(--space-4); }
.recht-text h2 {
  font-size: var(--fs-banner);
  margin: var(--space-6) 0 var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border-w) solid var(--c-line);
  scroll-margin-top: var(--space-4);
}
.recht-text h3 { font-size: var(--fs-body); margin: var(--space-5) 0 var(--space-2); }

.recht-text p,
.recht-text ul,
.recht-text ol { margin: 0 0 var(--space-3); }
.recht-text ul,
.recht-text ol { padding-left: var(--space-5); }
.recht-text li { margin: 0 0 var(--space-2); }
.recht-text strong { font-weight: var(--fw-heavy); }

.recht-text a,
.recht-fuss a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.recht a:focus-visible,
.recht summary:focus-visible,
.recht .tabelle:focus-visible {
  outline: var(--focus-w) solid var(--c-focus);
  outline-offset: 2px;
}

.recht-text code {
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

/* Platzhalter und Werte, die noch bestätigt werden müssen */
.platzhalter {
  background: var(--c-warn-bg);
  color: var(--c-text);
  border-bottom: var(--border-w) dashed var(--c-warn);
  padding: 0 2px;
  border-radius: var(--radius-bar);
}

/* Hinweis-Kästen */
.hinweis {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface);
  border-left: var(--border-w-strong) solid var(--c-accent-line);
  border-radius: var(--radius-card);
}
.hinweis p { margin: 0; }

/* Tabellen: auf dem Handy seitlich scrollbar, die Seite selbst nie */
.tabelle {
  margin: var(--space-3) 0 var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--border-w) solid var(--c-line);
  border-radius: var(--radius-card);
  background: var(--c-surface);
}
.tabelle table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: var(--fs-small);
  line-height: var(--lh-ui);
}
.tabelle th,
.tabelle td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-w) solid var(--c-line);
}
.tabelle thead th {
  font-weight: var(--fw-heavy);
  color: var(--c-muted);
  font-size: var(--fs-hint);
}
.tabelle tbody th { font-weight: var(--fw-strong); }
.tabelle tr:last-child th,
.tabelle tr:last-child td { border-bottom: 0; }

/* Schmale Bildschirme: jede Tabellenzeile wird zur Karte, Spaltenname vor dem Wert */
@media (max-width: 40rem) {
  .tabelle { overflow: visible; border: 0; background: none; }
  .tabelle table { min-width: 0; }
  .tabelle table,
  .tabelle tbody,
  .tabelle tr,
  .tabelle th,
  .tabelle td { display: block; width: 100%; }
  .tabelle thead { display: none; }
  .tabelle tr {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--c-surface);
    border: var(--border-w) solid var(--c-line);
    border-radius: var(--radius-card);
  }
  .tabelle tr:last-child th,
  .tabelle tr:last-child td,
  .tabelle th,
  .tabelle td { border-bottom: 0; padding: var(--space-1) 0; }
  .tabelle tbody th {
    font-family: var(--font-display);
    font-weight: var(--fw-display);
    font-size: var(--fs-body);
    padding-bottom: var(--space-2);
  }
  .tabelle td::before {
    content: attr(data-label);
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-hint);
    font-weight: var(--fw-strong);
  }
}

/* Inhaltsverzeichnis langer Seiten */
.recht-inhalt {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-4);
  border: var(--border-w) solid var(--c-line);
  border-radius: var(--radius-card);
  background: var(--c-surface);
}
.recht-inhalt summary {
  display: list-item;           /* behält das Aufklapp-Dreieck */
  min-height: var(--touch-min); /* Tippziel mindestens 48 px hoch */
  padding: var(--space-3) 0;
  line-height: var(--lh-ui);
  cursor: pointer;
  font-weight: var(--fw-strong);
}
.recht-inhalt ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.recht-inhalt li { margin: 0 0 var(--space-1); }

hr {
  border: 0;
  border-top: var(--border-w) solid var(--c-line);
  margin: var(--space-5) 0;
}

.recht-fuss {
  padding-bottom: var(--space-6);
  color: var(--c-muted);
  font-size: var(--fs-hint);
}

@media print {
  .recht-nav, .recht-sprung, .recht-inhalt { display: none; }
  .tabelle { overflow: visible; border: 0; }
  .tabelle table { min-width: 0; }
}
