/* Rechtsseiten (impressum/, datenschutz/, projekte/<slug>/{impressum,datenschutz,nutzungsbedingungen}/) – gemeinsam für
   alle Rechtstexte aus ../recht/*.md (gebaut von _quelle/bauen.mjs + recht.mjs). Eigentümer: Baumeister.
   Ruhig und lesbar: Text 18 px, höchstens ~70 Zeichen je Zeile, Inhaltsverzeichnis am Desktop seitlich, am Handy zum
   Aufklappen. Gleiche Familie wie die Kommandozentrale: Nacht, Schibsted-Überschriften, Mono nur für Kennung und Stand. */

/* ---------------------------------------------------------------- Kopf */
body.seite-recht .recht-kopf { padding-bottom: clamp(1rem, .8rem + .8vw, 1.6rem); }
.recht-kennung { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 24px; }
.recht-zurueck {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--text-2); text-decoration: none; font-size: 16px; border-bottom: 1px solid transparent;
}
.recht-zurueck:hover { color: var(--text); border-bottom-color: var(--linie-3); }
.recht-pfeil { font-family: var(--sans); transition: transform .3s var(--ease); }
.recht-zurueck:hover .recht-pfeil { transform: translateX(-3px); }
body.seite-recht .kraft { font-size: clamp(2.1rem, 1.5rem + 2vw, 3.3rem); margin-top: 6px; }
.recht-pflichtzeile { display: inline-block; margin-top: 16px; }
.recht-stand { margin-top: 16px; font: 500 15px/1.4 var(--mono); letter-spacing: .02em; color: var(--text-3); }
.recht-stand time { color: var(--text); }
body.seite-recht .recht-lead { margin-top: 14px; max-width: 32em; }
.recht-lead a { color: var(--text); text-decoration-color: var(--linie-3); text-underline-offset: .2em; }
.recht-offen {
  margin-top: 18px; padding: 10px 14px; max-width: 60ch;
  border: 1px dashed rgb(243 197 107 / .55); border-radius: 10px; background: rgb(243 197 107 / .06);
  font-size: 16px; line-height: 1.5; color: var(--text);
}
.recht-offen b { margin-right: .5em; font: 500 14px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.recht-offen a { color: var(--text); text-underline-offset: .2em; }
.recht-geschwister { display: flex; flex-wrap: wrap; gap: 0 26px; margin-top: 22px; border-bottom: 1px solid var(--linie); }
.recht-geschwister a {
  display: inline-flex; align-items: center; min-height: 46px; margin-bottom: -1px;
  color: var(--text-2); text-decoration: none; font-size: 16px; border-bottom: 2px solid transparent;
}
.recht-geschwister a:hover { color: var(--text); border-bottom-color: var(--linie-3); }
.recht-geschwister a[aria-current] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

/* ---------------------------------------------------------------- Fläche: Inhaltsverzeichnis + Text */
.recht-flaeche { padding-top: clamp(1.25rem, .8rem + 1.6vw, 2.6rem); }
.recht-toc { display: none; }
.recht-toc-titel { font: 600 15px/1.3 var(--sans); letter-spacing: 0; color: var(--text-3); margin: 0 0 12px; }
.recht-toc ol, .recht-klapp ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--linie); }
.recht-toc a, .recht-klapp a {
  display: block; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent;
  color: var(--text-2); text-decoration: none; font-size: 15px; line-height: 1.38;
  transition: color .2s, border-color .2s;
}
.recht-toc a:hover, .recht-klapp a:hover { color: var(--text); border-left-color: var(--linie-3); }
.recht-toc a[aria-current] { color: var(--text); border-left-color: var(--text); }

.recht-klapp { margin: 0 0 30px; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.recht-klapp summary {
  list-style: none; display: flex; align-items: center; gap: 14px; min-height: 56px; cursor: pointer;
  font: 600 17px/1.2 var(--kopf);
}
.recht-klapp summary::-webkit-details-marker { display: none; }
.recht-klapp-n { margin-left: auto; font: 400 15px/1 var(--sans); color: var(--text-3); }
.recht-klapp .pfeil { flex: 0 0 auto; margin-right: 4px; }
.recht-klapp[open] .pfeil { transform: rotate(225deg) translate(-2px, -2px); }
.recht-klapp nav { padding: 2px 0 16px; }
.recht-klapp a { display: flex; align-items: center; min-height: 44px; padding-block: 6px; font-size: 16px; }

@media (min-width: 1024px) {
  .recht-flaeche { display: grid; grid-template-columns: 228px minmax(0, 1fr); column-gap: clamp(44px, 5vw, 84px); align-items: start; }
  .recht-flaeche.ohne-toc { display: block; }
  .recht-toc {
    display: block; position: sticky; top: calc(var(--reiter-h) + 30px);
    max-height: calc(100vh - var(--reiter-h) - 60px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    padding: 4px 4px 4px 0;
  }
  .recht-klapp { display: none; }
}

/* ---------------------------------------------------------------- Text */
.recht-text { font-size: 18px; line-height: 1.7; color: var(--text-2); min-width: 0; }
/* Zeilenlänge: höchstens ~70 Zeichen (576 px bei 18 px, gemessen). Tabellen dürfen die ganze Spalte nutzen. */
.recht-text > :not(.recht-tabelle) { max-width: 36rem; }   /* 576 px – auch für größere Überschriften */
.recht-text > * { margin: 0 0 1em; }
.recht-text h2 {
  font: 600 clamp(1.4rem, 1.25rem + .5vw, 1.7rem)/1.2 var(--kopf); letter-spacing: -.015em; color: var(--text); text-wrap: balance;
  margin: 2.2em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--linie);
}
.recht-text > h2:first-child, .recht-text > .recht-anker:first-child + h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.recht-text h3 { font: 600 20px/1.3 var(--kopf); letter-spacing: -.01em; color: var(--text); margin: 1.8em 0 .5em; }
.recht-text h4 { font: 600 18px/1.4 var(--sans); color: var(--text); margin: 1.5em 0 .4em; }
.recht-text h2 + *, .recht-text h3 + *, .recht-text h4 + * { margin-top: 0; }
.recht-text strong { color: var(--text); font-weight: 600; }
.recht-text em { font-style: italic; }
.recht-text a, .recht-zitat a {
  color: var(--text); text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--linie-3); text-underline-offset: .22em; overflow-wrap: anywhere;
}
.recht-text a:hover { text-decoration-color: var(--text); }
.recht-text ul { list-style: none; padding-left: 1.25em; }
.recht-text ul > li { position: relative; }
.recht-text ul > li::before {
  content: ''; position: absolute; left: -1.05em; top: .72em; width: 6px; height: 6px; border-radius: 1.5px; background: var(--text-3);
}
.recht-text ol { list-style: decimal; padding-left: 1.4em; }
.recht-text ol > li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.recht-text li + li { margin-top: .45em; }
.recht-text li > ul, .recht-text li > ol { margin-top: .45em; }
.recht-text code {
  font: 500 max(.84em, 14px)/1 var(--code); color: var(--text); background: var(--nacht-3);
  padding: .14em .38em; border-radius: 5px; overflow-wrap: anywhere;
}
.recht-text hr { border: 0; border-top: 1px solid var(--linie); margin: 2.2em 0; }
.recht-zitat {
  padding: 14px 18px; border-left: 2px solid var(--linie-3); border-radius: 0 10px 10px 0;
  background: var(--nacht-2); color: var(--text);
}
.recht-zitat > :last-child { margin-bottom: 0; }
.recht-zitat p + p { margin-top: .7em; }
.recht-anker { display: block; height: 0; }

/* Tabellen: Desktop klassisch, Handy als Karten (Spaltenname über jedem Wert) */
.recht-tabelle { margin: .2em 0 1.4em; overflow-x: auto; }
.recht-tabelle table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.5; }
.recht-tabelle th {
  text-align: left; vertical-align: bottom; padding: 8px 18px 10px 0;
  font: 600 15px/1.35 var(--sans); color: var(--text); border-bottom: 1px solid var(--linie-2);
}
.recht-tabelle td { vertical-align: top; padding: 12px 18px 12px 0; border-bottom: 1px solid var(--linie); color: var(--text-2); }
.recht-tabelle th:last-child, .recht-tabelle td:last-child { padding-right: 0; }
.recht-tabelle td:first-child { color: var(--text); }
.recht-tabelle table:has(th:nth-child(4)) { font-size: 16px; }   /* breite Übersichten (4–5 Spalten) etwas dichter */
.recht-leer { color: var(--text-3); }

/* Offene Angaben [ … ]: sichtbar, ehrlich, nicht zu übersehen */
.luecke {
  color: var(--text); background: rgb(243 197 107 / .10); border: 1px dashed rgb(243 197 107 / .6); border-radius: 6px;
  padding: .06em .4em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.luecke-etikett { margin-right: .25em; font: 500 14px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.luecke:target { outline: 2px solid var(--warn); outline-offset: 3px; }

@media (max-width: 640px) {
  .recht-kennung { gap: 0 16px; }
  body.seite-recht .recht-kopf { padding-bottom: 1.1rem; }
  .recht-flaeche { padding-top: .4rem; }
  /* Geschwister als Etiketten, die sauber umbrechen (drei Wörter passen nicht als Reiter in 390 px) */
  .recht-geschwister { gap: 8px; border-bottom: 0; margin-top: 20px; }
  .recht-geschwister a { min-height: 44px; margin: 0; padding: 0 15px; border: 1px solid var(--linie-2); border-radius: 999px; font-size: 15px; }
  .recht-geschwister a:hover { border-color: var(--linie-3); }
  .recht-geschwister a[aria-current] { border-color: var(--text); background: var(--nacht-3); }
  .recht-text { font-size: 17.5px; line-height: 1.66; }
  .recht-text h2 { margin-top: 1.9em; }
  .recht-tabelle { overflow: visible; }
  .recht-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .recht-tabelle table, .recht-tabelle tbody, .recht-tabelle tr, .recht-tabelle td { display: block; width: 100%; }
  .recht-tabelle tr { padding: 12px 0 14px; border-bottom: 1px solid var(--linie); }
  .recht-tabelle tbody tr:first-child { border-top: 1px solid var(--linie-2); }
  .recht-tabelle td { padding: 0; border: 0; }
  .recht-tabelle td + td { margin-top: 8px; }
  .recht-tabelle td:first-child { font-weight: 600; font-family: var(--kopf); }
  .recht-tabelle td + td[data-label]::before {
    content: attr(data-label); display: block; font: 600 14px/1.4 var(--sans); color: var(--text-3); margin-bottom: 1px;
  }
}

/* Druck: nur der Text */
@media print {
  body { background: #fff; color: #000; }
  .kopf, .recht-toc, .recht-klapp, .recht-geschwister, .recht-zurueck, .fuss-leiste, .fuss-unten, .sprung { display: none !important; }
  .recht-text, .recht-text strong, .recht-text h2, .recht-text h3, .kraft, .lead, .recht-stand time, .recht-tabelle td { color: #000 !important; }
  .recht-text a { color: #000; }
  .recht-flaeche { display: block; }
}
