/* =====================================================================
   p-legal.css — geteiltes Seiten-Stylesheet für /impressum, /datenschutz
   und /barrierefreiheit. Nur Layout + Lesetypografie; Farben und Fonts
   kommen ausschließlich aus den Tokens in style.css (monochrom, Radius 0).
   Die finalen Texte werden als eRecht24-HTML in .legal-copy eingefügt
   und müssen dort ohne weitere Klassen sofort richtig aussehen.
   ===================================================================== */

/* 1. Kopf: dunkle Kopffläche, kompakter als Standard-Sektionen; der
      Wortmarken-Kopf steht eine Stufe leiser als auf den Hauptseiten. */
.legal-head {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.legal-head .section-head__title {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
}

/* 2. Helle Lesefläche: Lesespalte, ruhiger Grundrhythmus */
.legal-copy {
  max-width: 70ch; /* Zeilenlänge 45–75ch */
}

.legal-copy > * + * {
  margin-top: var(--space-sm);
}

/* 3. Überschriften der eingefügten Texte. Das Seiten-h1 ist der
      Wortmarken-Kopf; ein ggf. mitkopiertes h1 aus eRecht24 wird
      optisch auf h2-Ebene gesetzt. */
.legal-copy h1,
.legal-copy h2 {
  font-size: 1.375rem;
  line-height: 1.3;
}

.legal-copy h3 {
  font-size: 1.125rem;
  line-height: 1.35;
}

.legal-copy h4 {
  font-size: var(--fs-body);
}

.legal-copy > h1:not(:first-child),
.legal-copy > h2:not(:first-child) {
  margin-top: var(--space-xl);
}

.legal-copy > h3:not(:first-child) {
  margin-top: var(--space-lg);
}

.legal-copy > h4:not(:first-child) {
  margin-top: var(--space-md);
}

/* 4. Fließtext & Listen */
.legal-copy p,
.legal-copy li {
  line-height: var(--lh-body);
}

.legal-copy ul,
.legal-copy ol {
  padding-left: 1.35rem;
  max-width: 65ch;
}

.legal-copy li + li {
  margin-top: var(--space-3xs);
}

.legal-copy li::marker {
  color: var(--ctx-muted);
}

/* Lange URLs und E-Mail-Adressen dürfen die Spalte nie sprengen */
.legal-copy a {
  overflow-wrap: anywhere;
}

/* 5. Tabellen (z. B. Übersichten in der Datenschutzerklärung)
      Die Cookie-Tabelle hat fünf Spalten und passt auf dem Handy nicht in die
      Lesespalte (gemessen: 543 px bei 375 px Viewport). Sie scrollt deshalb in
      einem eigenen Container, statt die ganze Seite waagerecht zu schieben.
      tabindex + role im Markup, damit der Bereich auch per Tastatur scrollbar
      ist — ein Scroll-Container ohne Fokus ist für Tastatur-Nutzung tot. */
.legal-copy .table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.legal-copy .table-scroll:focus-visible {
  outline: 2px solid var(--ctx-ink);
  outline-offset: 2px;
}

.legal-copy .table-scroll table {
  min-width: 34rem;
}

.legal-copy table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.legal-copy th,
.legal-copy td {
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--ctx-hairline);
  text-align: left;
  vertical-align: top;
}

.legal-copy th {
  font-weight: 500;
  color: var(--ctx-ink);
}

/* 6. Platzhalter-Hinweis, bis der eRecht24-Text eingefügt ist */
.legal-pending {
  padding: var(--space-md);
  border: 1px solid var(--ctx-hairline);
  border-left: 3px solid var(--ctx-ink);
  color: var(--ctx-ink);
  font-weight: 500;
  max-width: 60ch;
}
