/* ============================================================
   Rechtstexte und Fehlerseite.
   Lange Fliesstexte, die gelesen werden muessen, nicht ueberflogen.
   Deshalb eine schmale Spalte, ruhige Typografie und ein
   Inhaltsverzeichnis, das beim Scrollen stehen bleibt.
   Setzt basis.css und bausteine.css voraus.
   ============================================================ */

/* ---- Kopf ---- */
.recht-kopf {
  padding-block: clamp(96px, 12vw, 148px) clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.recht-kopf::before {
  content: "";
  position: absolute;
  inset: -40% 45% auto -12%;
  height: 130%;
  background: radial-gradient(50% 50% at 40% 45%, color-mix(in oklab, var(--accent) 13%, transparent), transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.recht-kopf .wrap { position: relative; }

.recht-kopf h1 {
  overflow-wrap: break-word;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 14px 0 0;
}

.recht-stand { color: var(--ink-3); font-size: 0.94rem; margin: 16px 0 0; }

/* ---- Raster ---- */
/* minmax(0, …) auch in der einspaltigen Fassung: eine Rasterspur ist sonst
   mindestens so breit wie der unteilbare Inhalt ihres breitesten Kindes.
   Die Regel ab 940px hat das schon, die darunter fehlte. */
.recht-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }

@media (min-width: 940px) {
  .recht-raster { grid-template-columns: 240px minmax(0, 1fr); }
  /* Das Verzeichnis bleibt stehen, damit man in einem langen Text
     jederzeit sieht, wo man ist und was noch kommt. */
  .recht-inhalt { position: sticky; top: 100px; }
}

/* ---- Inhaltsverzeichnis ---- */
.recht-inhalt h2 {
  font-family: var(--body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}

.recht-inhalt ol {
  list-style: none;
  counter-reset: punkt;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.recht-inhalt li { counter-increment: punkt; }

.recht-inhalt a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px;
  padding: 7px 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: color 260ms var(--ease-out);
}

.recht-inhalt a::before { content: counter(punkt); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.recht-inhalt a:hover { color: var(--accent); }
.recht-inhalt a:hover::before { color: var(--accent); }

@media (max-width: 939px) {
  .recht-inhalt {
    padding: clamp(20px, 3vw, 26px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
  }
}

/* ---- Fliesstext ---- */
/* Die Zeilenlaenge ist der wichtigste Hebel fuer Lesbarkeit. 72 Zeichen
   ist die Grenze, ab der das Auge die naechste Zeile schlechter findet. */
/* „anywhere“, nicht „break-word“: nur die erste Variante verkleinert auch
   die unteilbare Mindestbreite, an der sich die Rasterspur bemisst. In
   Rechtstexten stehen Adressen wie https://www.ld-motion.de und lange
   Zusammensetzungen, die sonst die ganze Seite breiter machen als das
   Telefon. Der Umbruch greift nur, wenn die Zeile sonst ueberliefe. */
.recht-text { max-width: 72ch; overflow-wrap: anywhere; }
.recht-text > section + section { margin-top: clamp(38px, 4.5vw, 58px); }
.recht-text :is(h2, h3) { scroll-margin-top: 100px; }

.recht-text h2 {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}

.recht-num {
  flex: none;
  margin-top: 0.2em;
  padding: 4px 9px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.recht-text h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.04rem;
  margin: 26px 0 10px;
}

.recht-text p { color: var(--ink-2); line-height: 1.72; margin: 0 0 14px; }
.recht-text p:last-child { margin-bottom: 0; }

.recht-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  /* Lange Adressen sprengen sonst die Spalte auf schmalen Fenstern. */
  overflow-wrap: anywhere;
}

.recht-text a:hover { color: var(--ink); }

.recht-text ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 9px; }

.recht-text li {
  position: relative;
  padding-left: 19px;
  color: var(--ink-2);
  line-height: 1.66;
}

.recht-text li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.recht-text strong, .recht-text b { color: var(--ink); font-weight: 600; }

/* ---- Karte fuer Anschriften und Kontaktdaten ---- */
.recht-karte {
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin: 18px 0;
}

.recht-karte p:last-child { margin-bottom: 0; }
.recht-anschrift { font-style: normal; line-height: 1.8; color: var(--ink-2); }
.recht-anschrift b { display: inline-block; margin-bottom: 4px; }

/* ---- Hinweis ---- */
.recht-hinweis {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  margin: 20px 0;
}

.recht-hinweis svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }
.recht-hinweis p { margin: 0; color: var(--ink-2); line-height: 1.66; }

.recht-hinweis a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.recht-hinweis a:hover { color: var(--ink); }

/* ---- Tabelle ---- */
/* Breite Tabellen scrollen in sich selbst, sonst schiebt eine einzige
   Zeile die ganze Seite seitlich weg. */
.recht-tabelle { display: block; overflow-x: auto; margin: 18px 0; }
.recht-tabelle table { width: 100%; border-collapse: collapse; min-width: 520px; }

.recht-tabelle :is(th, td) {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
  vertical-align: top;
}

.recht-tabelle th {
  color: var(--ink-3);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.recht-tabelle td { color: var(--ink-2); }
.recht-tabelle tr:last-child :is(th, td) { border-bottom: 0; }

/* ---- Fehlerseite ---- */
.fehler-wege { max-width: 72ch; }
.fehler-wege > p { color: var(--ink-2); font-size: 1.05rem; }
.fehler-wege .hero-actions { margin-top: 26px; }
.fehler-wege .recht-hinweis { margin-top: 32px; }
