/* Rechtsseiten (Auftrag 87): Impressum, Datenschutz, AGB. Seit Auftrag 96 auf dem CI-Fundament (../assets/ci/ci.css: Farben, Schrift, Kopf, Fuß).
   Eigene Regeln mit Präfix re-, Farben nur über Rollen und Tokens, Größen nur über die Schriftleiter.
   Aufbau: Titel auf Petrol (rb-dunkel), der Rechtstext als Lesespalte auf Hell (rb-hell), daneben das Inhaltsverzeichnis. */

[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--rb-kopf-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.re { overflow-x: clip; }
/* Grundregeln: rb-grund am body. Hier nur, was es nicht abdeckt (Listen ohne Klasse, Unterstreichung) */
:where(.re) :where(a) { text-decoration: none; }
:where(.re) :where(ul, ol) { list-style: none; margin: 0; padding: 0; }

.re-kopf { padding: calc(var(--rb-kopf-h) + clamp(44px, 6vw, var(--rb-a-9))) 0 clamp(36px, 4.6vw, var(--rb-a-8)); }
.re-kopf .rb-marke + .rb-h2 { margin-top: var(--rb-a-4); }
.re-kopf .rb-h2 { max-width: 18em; overflow-wrap: anywhere; hyphens: auto; }
.re-blatt { padding: clamp(40px, 5.4vw, var(--rb-a-9)) 0 clamp(72px, 9vw, var(--rb-luft)); }
.re-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, var(--rb-a-8)); }
.re-etikett { font-size: var(--rb-t-1); line-height: 1.3; font-weight: var(--rb-w-mittel); letter-spacing: var(--rb-lw-marke); text-transform: uppercase; color: var(--rb-leise); }

/* Lesespalte */
.re-text { max-width: 44em; font-size: var(--rb-t-3); line-height: 1.62; overflow-wrap: break-word; }
.re-text > * + * { margin-top: 1.05em; }
.re-text h2 { margin-top: 2.6em; padding-top: 1.1em; border-top: 1px solid var(--rb-linie); color: var(--rb-kopf); font-size: var(--rb-t-5); line-height: var(--rb-zh-mittel); font-weight: var(--rb-w-kopf); text-wrap: balance; }
.re-text > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.re-text h2.re-teil { margin-top: 4em; padding-top: 1.6em; border-top: 2px solid var(--rb-gruen); }
.re-text h3 { margin-top: 1.9em; color: var(--rb-kopf); font-size: var(--rb-t-3); line-height: 1.4; font-weight: var(--rb-w-mittel); }
.re-text h2 + h3 { margin-top: 1.1em; }
.re-text h3 + p { margin-top: 0.4em; }
.re-text strong { color: var(--rb-kopf); font-weight: var(--rb-w-mittel); }
.re-text a { color: var(--rb-kopf); text-decoration: underline; text-decoration-color: var(--rb-gruen); text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.re-text a:hover { text-decoration-color: currentColor; }
.re-text ul { display: grid; gap: 6px; }
.re-text li { position: relative; padding-left: 22px; }
.re-text li::before { content: ""; position: absolute; left: 2px; top: 0.76em; width: 10px; height: 2px; border-radius: 2px; background: var(--rb-gruen); }

/* Impressum: Angaben etwas größer, ohne Inhaltsverzeichnis */
.re-seite:not(.re-mit-inhalt) .re-text { font-size: var(--rb-t-4); line-height: 1.55; }
.re-seite:not(.re-mit-inhalt) .re-text > p { padding-bottom: 1.05em; border-bottom: 1px solid var(--rb-linie); }
.re-seite:not(.re-mit-inhalt) .re-text > p:nth-last-of-type(1) { padding-bottom: 0; border-bottom: 0; }
.re-seite:not(.re-mit-inhalt) .re-text ul { margin-top: 0.4em; }

/* Inhaltsverzeichnis */
.re-mit-inhalt .re-raster { grid-template-columns: minmax(200px, calc(280px + 80 * var(--rb-w))) minmax(0, 1fr); column-gap: clamp(32px, 6vw, var(--rb-a-9)); }
.re-inhalt { position: sticky; top: calc(var(--rb-kopf-h) + 24px); align-self: start; max-height: calc(100vh - var(--rb-kopf-h) - 56px); overflow-y: auto; }
.re-inhalt ol { counter-reset: ri; margin-top: 12px; border-top: 1px solid var(--rb-linie); }
.re-inhalt li { counter-increment: ri; border-bottom: 1px solid var(--rb-linie); }
.re-inhalt a { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: baseline; padding: 10px 0; font-size: var(--rb-t-2); line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; transition: color .2s; }
.re-inhalt a::before { content: counter(ri); color: var(--rb-leise); }
.re-inhalt a:hover { color: var(--rb-kopf); }

/* Inhalt fehlt (Arbeitskasten, mit ?fertig=1 ausgeblendet). Nur in main: die Kopfzeile nutzt .offen für das Menü */
main.re-seite .offen { display: block; margin-top: 26px; padding: 14px 18px; max-width: 52em; border: 1.5px dashed var(--rb-leise); border-radius: var(--rb-r-feld); color: var(--rb-tx); font-size: var(--rb-t-1); line-height: 1.5; }
main.re-seite .offen b { font-weight: var(--rb-w-mittel); }
html.fertig main.re-seite .offen { display: none; }

.rb-fuss-unten a[aria-current] { color: var(--rb-kopf); }

@media (max-width: 900px) {
  .re-mit-inhalt .re-raster { grid-template-columns: minmax(0, 1fr); }
  .re-inhalt { position: static; max-height: none; padding: 18px 20px 8px; border-radius: var(--rb-r-karte); background: var(--rb-karte); box-shadow: var(--rb-karte-schatten); }
  .re-inhalt li:last-child { border-bottom: 0; }
}

/* Druck: Petrol auf Weiß, ohne Kopf- und Fußzeile */
@media print {
  .re, .re .rb-dunkel, .re .rb-hell { --rb-fl: var(--rb-weiss); --rb-kopf: var(--rb-petrol); --rb-tx: var(--rb-petrol); --rb-leise: var(--rb-hell-text); --rb-linie: var(--rb-linie-hell); --rb-marke: var(--rb-petrol); background: var(--rb-weiss) !important; color: var(--rb-petrol) !important; }
  .rb-kopf, .rb-fuss, main.re-seite .offen { display: none !important; }
  .re-kopf { padding: 0 0 18px; }
  .re-blatt { padding: 0; }
  .re-mit-inhalt .re-raster { grid-template-columns: minmax(0, 1fr); }
  .re-inhalt { position: static; max-height: none; break-after: page; }
  .re-text { max-width: none; font-size: 11pt; line-height: 1.45; }
  .re-text h2, .re-text h3 { break-after: avoid; }
  .re-text a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
}
