/* Rechtliche Seiten des Eigentümerportals: Impressum, Datenschutzerklärung, Nutzungsbedingungen.
   Farben, Schriften und Logo nach docs/design-mfi.md. Dunkler Kopf, helle Lesefläche, dunkler Fuß.
   Keine Schriften oder Dateien von fremden Servern: Die Schriften kommen aus ../schriften/schriften.css
   (vom Portal selbst ausgeliefert). Fehlen sie, greifen die Ersatzschriften.
   Jede Fläche setzt ihre Schriftfarben selbst (sonst vererbt sich helle Schrift auf helle Flächen).
   Alle Klassen beginnen mit r-, damit sie nicht mit Klassen des Portals kollidieren. */

:root {
  --night: #07101F;
  --navy: #0B1D3A;
  --brand: #00255B;
  --brand-2: #1C3F73;
  --ice: #EEF2F7;
  --paper: #F7F9FC;
  --card: #FFFFFF;
  --text: #0F1A2B;
  --muted: #44566E;
  --on-dark: #EAF0F8;
  --on-dark-muted: #9DB0C8;
  --amber: #F2A93B;
  --amber-soft: #FFD48A;
  --line: rgba(255, 255, 255, .12);
  --font-head: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* 18 px wie im Portal */
body {
  margin: 0;
  background: var(--ice);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.r-skip {
  position: absolute; left: -9999px; top: 8px; z-index: 10;
  background: var(--amber); color: var(--night); font-weight: 700;
  padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.r-skip:focus { left: 8px; }

/* ---------- Kopf (dunkel) ---------- */
.r-kopf { background: var(--night); color: var(--on-dark); border-bottom: 1px solid var(--line); }
.r-kopf-innen {
  max-width: 1040px; margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
}
.r-marke { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; color: var(--on-dark); }
.r-logo { display: block; height: 52px; width: auto; }
.r-logo .logo-name { font-family: var(--font-head); fill: var(--on-dark); }
.r-logo .logo-sub { font-family: var(--font-mono); font-weight: 500; fill: var(--on-dark-muted); }
.r-marke-zusatz {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--amber);
}
.r-kopf-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.r-kopf-nav a {
  color: var(--on-dark-muted); text-decoration: none; font-size: .92rem; font-weight: 600;
  padding: 8px 0; border-bottom: 2px solid transparent; min-height: 44px; display: inline-flex; align-items: center;
}
.r-kopf-nav a:hover { color: var(--on-dark); }
.r-kopf-nav a[aria-current="page"] { color: var(--on-dark); border-bottom-color: var(--amber); }

/* ---------- Lesefläche (hell) ---------- */
.r-seite { background: var(--ice); color: var(--text); padding: 32px 16px 48px; }
.r-blatt {
  max-width: 860px; margin: 0 auto; padding: 48px 56px 40px;
  background: var(--card); color: var(--text);
  border: 1px solid rgba(15, 26, 43, .07); border-radius: var(--radius);
  box-shadow: 0 24px 50px -34px rgba(15, 26, 43, .35);
}

.r-vorzeile {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--brand-2); margin: 0 0 10px;
}
.r-blatt h1 {
  font-family: var(--font-head); font-weight: 400; color: var(--text);
  font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1.06; letter-spacing: -.005em; margin: 0 0 12px;
}
.r-blatt h1 em { font-style: italic; color: var(--brand-2); }
.r-stand { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; color: var(--muted); margin: 0 0 28px; }
.r-blatt .r-einleitung { font-size: 1.08rem; color: var(--text); }

.r-blatt h2 {
  font-family: var(--font-head); font-weight: 400; color: var(--text);
  font-size: clamp(1.55rem, 3.6vw, 2.05rem); line-height: 1.15; margin: 46px 0 14px; scroll-margin-top: 16px;
}
.r-nr {
  display: inline-block; min-width: 2.4em; margin-right: 8px; vertical-align: .3em;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .14em; color: var(--brand-2);
}
.r-blatt h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.04rem; color: var(--text); margin: 28px 0 8px; }

.r-blatt p, .r-blatt li, .r-blatt dd, .r-blatt td { color: var(--muted); }
.r-blatt p { margin: 0 0 14px; }
.r-blatt strong { color: var(--text); font-weight: 700; }
.r-blatt a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.r-blatt a:hover { color: var(--brand-2); }
.r-blatt :focus-visible { outline-color: var(--brand); }

.r-blatt ul { list-style: none; margin: 0 0 16px; padding: 0; }
.r-blatt ul li { position: relative; padding-left: 22px; margin-bottom: 7px; }
.r-blatt ul li::before { content: ""; position: absolute; left: 0; top: .82em; width: 11px; height: 1px; background: var(--brand-2); }
.r-blatt ol { margin: 0 0 16px; padding-left: 22px; }
.r-blatt ol li { margin-bottom: 7px; padding-left: 4px; }

/* Angaben (Impressum, Kontakt) */
.r-angaben { display: grid; grid-template-columns: 210px 1fr; gap: 10px 24px; margin: 0 0 26px; }
.r-angaben dt {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand-2); padding-top: .5em; line-height: 1.5;
}
.r-blatt .r-angaben dd { margin: 0; color: var(--text); }

/* Inhaltsverzeichnis */
.r-inhalt { background: var(--paper); color: var(--text); border: 1px solid rgba(15, 26, 43, .08); border-radius: 12px; margin: 0 0 30px; }
.r-inhalt summary {
  cursor: pointer; list-style: none; padding: 14px 18px; min-height: 44px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-2);
}
.r-inhalt summary::-webkit-details-marker { display: none; }
.r-inhalt summary::after { content: "+"; float: right; display: inline-block; font-size: 1.1rem; line-height: 1; color: var(--brand-2); transition: transform .2s; }
.r-inhalt details[open] summary::after { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .r-inhalt summary::after { transition: none; } }
.r-blatt .r-inhalt ol { margin: 0; padding: 0 18px 14px 40px; columns: 2 260px; column-gap: 28px; }
.r-blatt .r-inhalt li { margin-bottom: 4px; break-inside: avoid; color: var(--muted); }
.r-blatt .r-inhalt a { text-decoration: none; color: var(--brand); }
.r-blatt .r-inhalt a:hover { text-decoration: underline; }

/* Hervorgehobene Kästen (z. B. Widerspruchsrecht, KI-Hinweis) */
.r-kasten {
  background: var(--paper); color: var(--text);
  border: 1px solid rgba(15, 26, 43, .1); border-left: 4px solid var(--brand-2); border-radius: 10px;
  padding: 18px 20px; margin: 18px 0 22px;
}
.r-kasten h3 { margin-top: 0; }
.r-blatt .r-kasten p:last-child { margin-bottom: 0; }

/* Noch offene Angaben: müssen vor dem Livegang gefüllt oder gestrichen werden */
.r-offen {
  background: rgba(242, 169, 59, .22); color: var(--text);
  border-bottom: 2px dashed var(--amber); border-radius: 3px; padding: 0 4px; font-weight: 600;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Entwurfshinweis am Ende jeder Seite (dunkle Fläche, Schriftfarben selbst gesetzt) */
.r-entwurf { margin: 44px 0 0; padding: 18px 20px; background: var(--navy); color: var(--on-dark); border-radius: 12px; }
.r-blatt .r-entwurf p { color: var(--on-dark); margin: 0; }
.r-blatt .r-entwurf strong { color: var(--amber-soft); }

.r-hoch { margin: 34px 0 0; }
.r-blatt .r-hoch a { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }

/* ---------- Fuß (dunkel) ---------- */
.r-fuss { background: var(--night); color: var(--on-dark-muted); }
.r-fuss-innen { max-width: 1040px; margin: 0 auto; padding: 28px 16px 36px; display: grid; gap: 12px; font-size: .92rem; }
.r-fuss p { margin: 0; color: var(--on-dark-muted); }
.r-fuss a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.r-fuss a:hover { color: var(--amber-soft); }
.r-fuss-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.r-fuss-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.r-zurueck {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 10px 18px; border-radius: 99px; border: 1px solid rgba(234, 240, 248, .32);
  color: var(--on-dark) !important; text-decoration: none !important; font-weight: 600;
}
.r-zurueck:hover { border-color: var(--on-dark); background: rgba(255, 255, 255, .08); }

/* ---------- Handy ---------- */
@media (max-width: 900px) {
  .r-blatt { padding: 36px 32px 32px; }
}
@media (max-width: 640px) {
  .r-kopf-innen { padding: 14px 16px; }
  .r-logo { height: 42px; }
  .r-seite { padding: 0; }
  .r-blatt { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; padding: 28px 16px 32px; }
  .r-blatt h2 { margin-top: 38px; }
  .r-angaben { grid-template-columns: 1fr; gap: 2px 0; }
  .r-blatt .r-angaben dd { margin-bottom: 14px; }
  .r-blatt .r-inhalt ol { columns: 1; padding-left: 36px; }
  .r-kasten { padding: 16px; }
}

/* ---------- Druck ---------- */
@media print {
  body, .r-seite { background: #fff; color: #000; }
  .r-skip, .r-kopf-nav, .r-fuss-nav, .r-zurueck, .r-inhalt, .r-hoch { display: none !important; }
  .r-kopf { background: #fff; border: 0; }
  .r-logo { height: 40px; }
  .r-logo .logo-name { fill: #0F1A2B; }
  .r-logo .logo-sub { fill: #44566E; }
  .r-marke-zusatz { color: #1C3F73; }
  .r-seite { padding: 0; }
  .r-blatt { max-width: none; padding: 0; border: 0; box-shadow: none; }
  .r-blatt p, .r-blatt li, .r-blatt dd, .r-blatt td { color: #000; }
  .r-blatt a { color: #000; }
  .r-blatt a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .r-entwurf { background: #fff; border: 2px solid #000; }
  .r-blatt .r-entwurf p, .r-blatt .r-entwurf strong { color: #000; }
  .r-fuss { background: #fff; color: #000; }
  .r-fuss p, .r-fuss a { color: #000; }
  h2, h3 { break-after: avoid; }
}
