/* ==========================================================================
   Rechtstexte (impressum.html, datenschutz.html)
   Lange Fliesstexte: ruhige Typografie, Inhaltsverzeichnis mit Ankern,
   Tabellen, die auf dem Handy waagerecht scrollen, druckfreundlich.
   Baut auf den Variablen aus /style.css auf (--green-700, --ink-900 ...).
   ========================================================================== */

.legal-main { padding: 2.5rem 1rem 4rem; }

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  color: var(--ink-900, #143b32);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  hyphens: auto;
}

.legal-eyebrow {
  margin: 0 0 .4rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700, #0c3f35);
}

.legal-page h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 0 0 1rem;
  hyphens: manual;
}

.legal-page h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  margin: 2.8rem 0 .7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--sand-300, #dfd8d0);
  hyphens: manual;
}

.legal-page h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 1.8rem 0 .5rem;
  hyphens: manual;
}

/* Sprungziele nicht unter der klebenden Kopfzeile verstecken */
.legal-page [id] { scroll-margin-top: 7rem; }

.legal-page p,
.legal-page ul,
.legal-page ol { margin: 0 0 1rem; }

.legal-page ul,
.legal-page ol { padding-left: 1.3rem; }

.legal-page li { margin: 0 0 .35rem; }

.legal-page a {
  color: var(--green-700, #0c3f35);
  font-weight: 600;
  text-underline-offset: 2px;
}

.legal-page a:focus-visible {
  outline: 2px solid var(--green-700, #0c3f35);
  outline-offset: 2px;
  border-radius: 3px;
}

.legal-page address { font-style: normal; margin: 0 0 1rem; }

.legal-lead {
  font-size: 1.08rem;
  color: var(--ink-700, #5f756d);
}

.legal-muted { color: var(--ink-700, #5f756d); font-size: .92rem; }

/* ── Inhaltsverzeichnis ─────────────────────────────────────────────────── */
.legal-toc {
  margin: 2rem 0 1rem;
  padding: 1.1rem 1.3rem 1rem;
  border-radius: 16px;
  background: var(--sand-100, #f5f1eb);
  border: 1px solid var(--sand-200, #ece6de);
}

.legal-toc-title {
  margin: 0 0 .6rem;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-700, #5f756d);
}

.legal-toc ol {
  margin: 0;
  padding-left: 1.6rem;
  font-size: .95rem;
  line-height: 1.5;
}

.legal-toc li { margin: 0 0 .3rem; break-inside: avoid; }

.legal-toc a { font-weight: 500; text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }

@media (min-width: 760px) {
  .legal-toc ol { columns: 2; column-gap: 2.2rem; }
}

/* ── Gleiches Schema je Verarbeitung (Zweck, Daten, Rechtsgrundlage ...) ── */
.legal-scheme {
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) 1fr;
  gap: 0;
  margin: 1rem 0 1.4rem;
  border-top: 1px solid var(--sand-200, #ece6de);
}

.legal-scheme dt,
.legal-scheme dd {
  margin: 0;
  padding: .7rem 0;
  border-bottom: 1px solid var(--sand-200, #ece6de);
}

.legal-scheme dt {
  font-weight: 700;
  font-size: .92rem;
  padding-right: 1rem;
  color: var(--ink-900, #143b32);
}

.legal-scheme dd > :last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .legal-scheme { grid-template-columns: 1fr; }
  .legal-scheme dt { border-bottom: 0; padding-bottom: 0; }
  .legal-scheme dd { padding-top: .2rem; }
}

/* ── Tabellen: auf schmalen Bildschirmen waagerecht scrollen ─────────────── */
.legal-table-wrap {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--sand-200, #ece6de);
  border-radius: 12px;
}

.legal-table-wrap:focus-visible {
  outline: 2px solid var(--green-700, #0c3f35);
  outline-offset: 2px;
}

.legal-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: .9rem;
  line-height: 1.5;
  hyphens: manual;
}

.legal-table caption {
  text-align: left;
  padding: .7rem .9rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink-700, #5f756d);
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: .6rem .9rem;
  border-top: 1px solid var(--sand-200, #ece6de);
}

.legal-table thead th {
  background: var(--sand-100, #f5f1eb);
  font-weight: 700;
  white-space: nowrap;
}

.legal-table tbody tr:nth-child(even) td,
.legal-table tbody tr:nth-child(even) th { background: rgba(245, 241, 235, .45); }

.legal-table code,
.legal-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  background: var(--mint-100, #ecf0ef);
  padding: .05rem .3rem;
  border-radius: 4px;
  overflow-wrap: anywhere;
  hyphens: none;
}

/* ── Hervorgehobene Kaesten ─────────────────────────────────────────────── */
.legal-box {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: rgba(12, 63, 53, .07);
  border: 1.5px solid rgba(12, 63, 53, .35);
}

.legal-box > :last-child { margin-bottom: 0; }

.legal-box h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-box-objection {
  border-width: 2px;
  border-color: var(--green-700, #0c3f35);
  background: rgba(12, 63, 53, .09);
}

.legal-note {
  margin: 1.2rem 0;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: rgba(214, 150, 40, .09);
  border: 1px solid rgba(214, 150, 40, .28);
}

.legal-note > :last-child { margin-bottom: 0; }

.legal-stand {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sand-300, #dfd8d0);
  font-size: .92rem;
  color: var(--ink-700, #5f756d);
}

.legal-top { font-size: .88rem; }

/* ── Druck ──────────────────────────────────────────────────────────────── */
@media print {
  @page { margin: 18mm 16mm; }

  .topbar,
  .nav-toggle,
  .site-footer,
  .legal-top { display: none !important; }

  body, .site-shell { background: #fff !important; }

  .legal-main { padding: 0; }

  .legal-page {
    max-width: none;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .legal-page a { color: #000; text-decoration: underline; font-weight: 600; }
  .legal-page a[href^="http"]::after,
  .legal-page a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-weight: 400;
    font-size: .85em;
  }

  .legal-toc a::after { content: none !important; }

  .legal-page h2 { break-after: avoid; page-break-after: avoid; border-top-color: #999; }
  .legal-page h3 { break-after: avoid; page-break-after: avoid; }

  .legal-toc,
  .legal-box,
  .legal-note { background: none !important; border-color: #666 !important; }

  .legal-box, .legal-note, .legal-scheme dt, .legal-table tr { break-inside: avoid; page-break-inside: avoid; }

  .legal-table-wrap { overflow: visible; border-color: #999; }
  .legal-table { min-width: 0; font-size: 9pt; }
  .legal-table thead th,
  .legal-table tbody tr:nth-child(even) td,
  .legal-table tbody tr:nth-child(even) th { background: none !important; }
  .legal-table th, .legal-table td { border-top-color: #bbb; }
  .legal-table code, .legal-page code { background: none; padding: 0; }
}
