/* Rechtstexte (Impressum, Datenschutz, AGB, Widerruf, AVV) und Kündigungsseite
   mit Vorlage zum Kopieren (kein Formular). Wird nur auf diesen Seiten geladen
   (Seite.css in src/rechtliches.ts und src/seiten/recht.ts) und baut auf
   site.css auf: gleiche Farben, Schrift und Abstände. Druckansicht am Ende. */

/* ---------------------------------------------------------------- Kopf */
.recht-kopf { padding-bottom: 12px; }
/* Lange Wörter (z. B. Auftragsverarbeitungsvertrag) auf dem Handy trennen statt überlaufen lassen. */
.recht-kopf h1, .recht-text h2, .recht-text h3 { overflow-wrap: break-word; hyphens: auto; }
.recht-kopf .lead { margin: 14px 0 0; max-width: 720px; }
.recht-stand { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }

/* ---------------------------------------------------------------- Raster mit Inhaltsverzeichnis */
.recht-raster {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px;
  align-items: start; padding-top: 32px;
}
.recht-toc {
  position: sticky; top: calc(var(--kopf-h) + 24px);
  max-height: calc(100vh - var(--kopf-h) - 48px); overflow: auto;
  background: var(--flaeche); border-radius: 14px; padding: 20px 20px 16px;
}
.recht-toc h2 {
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 10px;
}
.recht-toc ol { list-style: none; margin: 0; padding: 0; }
.recht-toc a {
  display: block; padding: 5px 0; color: var(--text); text-decoration: none;
  font-size: 14.5px; line-height: 1.35;
}
.recht-toc a:hover { color: var(--blau); text-decoration: underline; }

/* ---------------------------------------------------------------- Fließtext */
.recht-text { max-width: 760px; min-width: 0; overflow-wrap: break-word; }
.recht-einspaltig { padding-top: 24px; }
.recht-text > :first-child,
.recht-text > .recht-abschnitt:first-child > h2 { margin-top: 0; }
.recht-text h2 { font-size: 1.4rem; margin: 2.2em 0 .6em; }
.recht-text h3 { font-size: 1.1rem; margin: 1.6em 0 .4em; }
.recht-text p, .recht-text li { line-height: 1.7; }
.recht-text ul, .recht-text ol { padding-left: 1.3em; }
.recht-text li { margin: 6px 0; }

/* Nummerierte Absätze: (1), (2), … hängend vor dem Text */
.abs { position: relative; padding-left: 2.3em; margin: 0 0 .9em; }
.abs > p { margin: 0 0 .5em; }
.abs-nr { position: absolute; left: 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.abs-liste { margin: .3em 0 .7em; }

.recht-hinweis {
  background: #eef4fb; border-left: 4px solid var(--blau);
  padding: 14px 18px; border-radius: 8px; margin: 0 0 1.6em;
}
.recht-druck { color: var(--text-2); font-size: 14.5px; margin-top: 2em; }

/* Amtliche Texte (Widerrufsbelehrung im Wortlaut des Musters) */
.recht-amtlich { border: 1px solid var(--linie); border-radius: 14px; padding: 4px 26px 14px; }
.recht-amtlich h3 { margin-top: 1.1em; }
.recht-amtlich-ende { color: var(--text-2); font-size: 14.5px; text-align: center; margin: 1.2em 0 0; }

/* Muster-Widerrufsformular zum Ausdrucken und Kopieren */
.recht-muster { border: 2px dashed #b3bac2; border-radius: 14px; padding: 22px 26px; background: #fff; }
.recht-muster-titel { font: 700 1.2rem/1.3 var(--titel); margin-bottom: .4em; }
.recht-muster-liste { list-style: none; padding: 0 !important; }
.recht-muster-liste li { margin: 16px 0; padding-left: 1.1em; text-indent: -1.1em; }
.recht-muster-liste li::before { content: '– '; }
.recht-linie { display: block; height: 1.9em; border-bottom: 1px solid #9aa1a9; text-indent: 0; }

/* Kündigungsvorlage zum Kopieren (Absätze mit Zeilenumbrüchen) */
.recht-vorlage {
  margin: .6em 0 1em; padding: 18px 24px; background: #fff;
  border: 2px dashed #b3bac2; border-radius: 14px; overflow-wrap: anywhere;
}
.recht-vorlage p { margin: 0 0 .9em; line-height: 1.6; }
.recht-vorlage p:last-child { margin-bottom: 0; }

/* Kästen (z. B. „So schließt du den AVV ab“) */
.recht-kasten { background: var(--flaeche); border-radius: var(--radius); padding: 24px 26px; }
.recht-text .recht-kasten { margin: 0 0 1.6em; }
.recht-kasten h2 { font-size: 1.2rem; margin: 0 0 .6em; }
.recht-kasten ul, .recht-kasten ol { padding-left: 1.2em; margin: 0 0 .8em; }
.recht-kasten li { margin: 8px 0; font-size: 15.5px; line-height: 1.55; }
.recht-kasten p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- AVV */
.recht-parteien { border: 1px solid var(--linie); border-radius: 14px; padding: 20px 24px; margin: 0 0 8px; }
.recht-parteien p { margin: 0 0 .6em; }
.recht-parteien p:last-child { margin-bottom: 0; }
.recht-vertragstitel { font: 700 1.25rem/1.3 var(--titel); }

.recht-tabelle-rahmen { margin: .6em 0 1em; }
.recht-tabelle { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.recht-tabelle th, .recht-tabelle td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--linie); }
.recht-tabelle th { background: var(--flaeche); font-weight: 600; }

.recht-unterschriften {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--linie);
}
.recht-feld { border-top: 1px solid #9aa1a9; padding-top: 6px; margin: 52px 0 0; font-size: 14px; color: var(--text-2); }

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 920px) {
  .recht-raster { grid-template-columns: 1fr; gap: 28px; }
  .recht-toc { position: static; max-height: none; }
}
@media (min-width: 600px) and (max-width: 920px) {
  .recht-toc ol { columns: 2; column-gap: 28px; }
  .recht-toc li { break-inside: avoid; }
}
@media (max-width: 640px) {
  .recht-tabelle thead { display: none; }
  .recht-tabelle tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--linie); }
  .recht-tabelle td { display: block; border: 0; padding: 3px 0; }
  .recht-tabelle td::before { content: attr(data-label) ': '; font-weight: 600; }
}
@media (max-width: 520px) {
  .recht-kopf h1 { font-size: 1.75rem; }
  .abs { padding-left: 2em; }
  .recht-amtlich, .recht-muster, .recht-vorlage { padding-left: 16px; padding-right: 16px; }
  .recht-kasten { padding: 20px; }
  .recht-unterschriften { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------------------------------------------------------------- Druck */
@media print {
  @page { margin: 18mm 16mm; }
  .kopf, .fuss, .skip, .recht-toc, .recht-nur-bildschirm, .recht-druck { display: none !important; }
  body { font-size: 10.5pt; line-height: 1.45; color: #000; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .seitenkopf, .klein-kopf { padding: 0 0 8pt; }
  .recht-kopf h1 { font-size: 20pt; }
  .recht-kopf .lead, .recht-stand { color: #000; font-size: 10.5pt; }
  .recht-raster { display: block; padding-top: 6pt; }
  .recht-text { max-width: none; }
  .recht-text h2 { font-size: 13pt; margin: 14pt 0 5pt; break-after: avoid; }
  .recht-text h3 { font-size: 11pt; break-after: avoid; }
  .recht-text p, .recht-text li { line-height: 1.45; orphans: 3; widows: 3; }
  a { color: #000; text-decoration: none; }
  .recht-text a[href^="/"]::after { content: " (mein-hartmann.de" attr(href) ")"; font-size: 9pt; color: #333; }
  .recht-hinweis, .recht-kasten, .recht-amtlich, .recht-parteien, .recht-vorlage { background: none; border: 1px solid #888; }
  .recht-muster, .recht-vorlage, .recht-unterschriften, .recht-parteien, .recht-tabelle tr { break-inside: avoid; }
  .recht-tabelle th { background: none; }
}
