/* ===========================================================================
   zweiterdraht – öffentliche Website (zweiterdraht.de)
   ---------------------------------------------------------------------------
   Dieselbe Marke wie das Portal: Grundwerte übernommen aus
   tenancy/static/krisennetz/css/krisennetz.css (Primärfarbe, Markenachse
   Blau→Türkis, neutrale Flächen, Radien, flache Schatten, Fokusring).
   Die Website darf großzügiger sein als die Verwaltungsoberfläche, bleibt
   aber erkennbar dieselbe Familie.

   Keine externen Quellen: Schrift (Inter, 2 Schnitte) und alle Bilder werden
   selbst ausgeliefert.
   =========================================================================== */

/* ── Schrift ──────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/schrift/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/schrift/inter-latin-700-normal.woff2") format("woff2");
}

/* ── Grundwerte (aus dem Portal-Designsystem) ─────────────────────────────── */
:root {
  --k-bg:            #f3f5fa;
  --k-surface:       #ffffff;
  --k-surface-muted: #f8fafc;
  --k-border:        #e4e9f1;
  --k-border-strong: #cbd5e1;

  --k-text:          #0f172a;
  --k-text-soft:     #334155;
  --k-text-muted:    #55657c;   /* dunkler als im Portal: 4,5:1 auf Weiß */

  --k-primary:       #2563eb;
  --k-primary-dark:  #1d4ed8;
  --k-primary-darker:#1e40af;
  --k-primary-soft:  #eef4ff;
  --k-primary-line:  #c7dbfc;
  --k-accent-2:      #0ea5b7;
  --k-brand-axis: linear-gradient(90deg, #2563eb, #06b6d4);

  --k-ok:        #15803d;
  --k-ok-soft:   #e7f8ee;
  --k-warn:      #b45309;
  --k-warn-soft: #fff8e6;

  --k-nav-bg:      #0d1526;
  --k-nav-bg-soft: #1c2941;
  --k-nav-text:    #b6c2d6;
  --k-nav-text-on: #ffffff;

  --k-r-sm: 7px;
  --k-r-md: 10px;
  --k-r-lg: 14px;
  --k-r-pill: 999px;

  --k-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --k-shadow-md: 0 2px 4px rgba(15, 23, 42, .05), 0 14px 28px -18px rgba(15, 23, 42, .28);
  --k-ring: 0 0 0 3px rgba(37, 99, 235, .18);

  --k-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --mass: 72rem;          /* Seitenbreite */
  --mass-text: 44rem;     /* Textbreite, ~65 Zeichen bei 17-18 px */
}

/* ── Basis ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--k-font);
  font-size: 1.0625rem;               /* 17 px */
  line-height: 1.65;
  color: var(--k-text);
  background: var(--k-bg);
}
@media (min-width: 48em) {
  body { font-size: 1.125rem; }       /* 18 px auf großen Bildschirmen */
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--k-primary-dark); text-underline-offset: 3px; }
a:hover { color: var(--k-primary-darker); }

:focus-visible {
  outline: none;
  box-shadow: var(--k-ring);
  border-radius: var(--k-r-sm);
}

h1, h2, h3 { line-height: 1.22; font-weight: 700; letter-spacing: -0.015em;
  overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); margin: 0 0 0.7em; }
h3 { font-size: 1.17rem; margin: 0 0 0.5em; }

p, ul, ol { margin: 0 0 1.1em; max-width: var(--mass-text); }
li { margin-bottom: 0.4em; }
strong { font-weight: 700; }

.sichtbar-nur-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.zum-inhalt {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--k-surface); color: var(--k-primary-dark);
  padding: 0.7rem 1.1rem; border-radius: 0 0 var(--k-r-md) 0;
  font-weight: 700; text-decoration: none;
}
.zum-inhalt:focus-visible { left: 0; }

/* ── Kopfbereich ──────────────────────────────────────────────────────────── */
.kopf {
  background: var(--k-nav-bg);
  color: var(--k-nav-text);
  position: relative;
}
.kopf::after {
  content: ""; display: block; height: 3px;
  background: var(--k-brand-axis);
}
.kopf-innen {
  max-width: var(--mass); margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.marke {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--k-nav-text-on); text-decoration: none;
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em;
  padding: 0.25rem 0.25rem;
}
.marke img { width: 34px; height: 34px; display: block; }
.marke .zusatz {
  font-weight: 400; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--k-nav-text);
  margin-left: 0.25rem;
}
@media (max-width: 30em) { .marke .zusatz { display: none; } }

.kopf nav { margin-left: auto; }
.kopf nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem; flex-wrap: wrap;
}
.kopf nav a {
  display: block; padding: 0.55rem 0.85rem;
  color: var(--k-nav-text); text-decoration: none;
  border-radius: var(--k-r-sm); font-size: 0.99rem;
  min-height: 44px; display: flex; align-items: center;
  transition: background-color 200ms ease, color 200ms ease;
}
.kopf nav a:hover { color: var(--k-nav-text-on); background: var(--k-nav-bg-soft); }
.kopf nav a[aria-current="page"] {
  color: var(--k-nav-text-on); background: var(--k-nav-bg-soft);
  font-weight: 700;
}
.kopf nav a.nav-kontakt {
  background: var(--k-primary); color: #fff; font-weight: 700;
}
.kopf nav a.nav-kontakt:hover { background: var(--k-primary-dark); }

@media (max-width: 47.99em) {
  .kopf-innen { padding: 0.6rem 1rem; }
  .kopf nav { margin-left: 0; width: 100%; }
  .kopf nav ul { gap: 0.15rem; }
  .kopf nav a { padding: 0.55rem 0.7rem; font-size: 0.95rem; }
}

/* ── Abschnitte und Flächen ──────────────────────────────────────────────── */
main { display: block; }
.abschnitt { padding: 3.2rem 1.25rem; }
@media (min-width: 48em) { .abschnitt { padding: 4.5rem 1.25rem; } }
.abschnitt > .innen { max-width: var(--mass); margin: 0 auto; }
.abschnitt.hell { background: var(--k-surface); }
.abschnitt.dunkel { background: var(--k-nav-bg); color: #d7deeb; }
.abschnitt.dunkel h2 { color: #fff; }

.vorzeile {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--k-primary-dark);
  margin-bottom: 0.7rem;
}
.abschnitt.dunkel .vorzeile { color: #7fd3e2; }

.einleitung { font-size: 1.15em; color: var(--k-text-soft); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { padding: 3.5rem 1.25rem 3rem; background:
  radial-gradient(60rem 30rem at 85% -10%, rgba(6, 182, 212, 0.10), transparent 60%),
  radial-gradient(50rem 26rem at 5% 110%, rgba(37, 99, 235, 0.08), transparent 60%),
  var(--k-bg);
}
@media (min-width: 62em) { .hero { padding: 5rem 1.25rem 4rem; } }
.hero .innen { max-width: var(--mass); margin: 0 auto; }
.hero h1 { max-width: 21ch; }
.hero .einleitung { max-width: 56ch; }

.knopfzeile { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.6rem 0 0; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.65rem 1.4rem;
  border-radius: var(--k-r-md); font-weight: 700; font-size: 1.02rem;
  text-decoration: none; border: 1px solid transparent;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.knopf:active { transform: translateY(1px); }
.knopf-primaer { background: var(--k-primary); color: #fff; box-shadow: var(--k-shadow-sm); }
.knopf-primaer:hover { background: var(--k-primary-dark); color: #fff; }
.knopf-zweit {
  background: var(--k-surface); color: var(--k-primary-dark);
  border-color: var(--k-border-strong);
}
.knopf-zweit:hover { border-color: var(--k-primary); }

.hero-fakten {
  display: flex; gap: 1.9rem; flex-wrap: wrap;
  margin-top: 2.2rem; color: var(--k-text-muted); font-size: 0.98rem;
}
.hero-fakten span strong { color: var(--k-text); display: block; font-size: 1.05rem; }

/* ── Karten (Stärken, Schritte) ───────────────────────────────────────────── */
.kartenreihe {
  display: grid; gap: 1.1rem; margin-top: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}
.karte {
  background: var(--k-surface);
  border: 1px solid var(--k-border);
  border-radius: var(--k-r-lg);
  box-shadow: var(--k-shadow-sm);
  padding: 1.5rem 1.4rem;
}
.karte .symbol {
  width: 44px; height: 44px; border-radius: var(--k-r-md);
  background: var(--k-primary-soft); color: var(--k-primary-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem;
}
.karte .symbol svg { width: 24px; height: 24px; }
.karte p { font-size: 0.99rem; color: var(--k-text-soft); margin-bottom: 0; }
.karte p + p { margin-top: 0.7em; }
.karte .beleg { font-size: 0.88rem; color: var(--k-text-muted); margin-top: 0.8em; }

/* Nummerierte Schritte (Ablauf einer Einführung) */
.schritte { list-style: none; margin: 1.6rem 0 0; padding: 0; counter-reset: schritt; max-width: none; }
.schritte li {
  counter-increment: schritt;
  position: relative; padding: 0 0 1.6rem 3.4rem; margin: 0;
}
.schritte li::before {
  content: counter(schritt);
  position: absolute; left: 0; top: 0.05rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--k-primary); color: #fff;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.schritte li::after {
  content: ""; position: absolute; left: 1.12rem; top: 2.6rem; bottom: 0.2rem;
  width: 2px; background: var(--k-primary-line);
}
.schritte li:last-child { padding-bottom: 0; }
.schritte li:last-child::after { display: none; }
.schritte h3 { margin-bottom: 0.25em; }
.schritte p { color: var(--k-text-soft); font-size: 1rem; margin-bottom: 0; }

/* ── Bildschirmfotos ─────────────────────────────────────────────────────── */
.bild {
  background: var(--k-surface);
  border: 1px solid var(--k-border);
  border-radius: var(--k-r-lg);
  box-shadow: var(--k-shadow-md);
  overflow: hidden;
  margin: 0;
}
.bild img { display: block; width: 100%; height: auto; }
.bild figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.92rem; color: var(--k-text-muted);
  border-top: 1px solid var(--k-border);
}
.bild a { display: block; line-height: 0; }
.bild a:focus-visible { box-shadow: inset var(--k-ring); }

.bildreihe {
  display: grid; gap: 1.3rem; margin-top: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  align-items: start;
}

.bild-gross { margin-top: 1.8rem; }

/* Großansicht (funktioniert ohne JavaScript als normaler Link) */
dialog.leuchtkasten {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 90rem);
}
dialog.leuchtkasten::backdrop { background: rgba(13, 21, 38, 0.82); }
dialog.leuchtkasten img {
  display: block; width: 100%; height: auto;
  border-radius: var(--k-r-md); box-shadow: var(--k-shadow-md);
}
dialog.leuchtkasten .schliessen {
  position: absolute; top: -0.4rem; right: -0.4rem;
  background: var(--k-surface); border: 1px solid var(--k-border-strong);
  border-radius: 50%; width: 44px; height: 44px; cursor: pointer;
  font-size: 1.2rem; line-height: 1;
}

/* ── Zweispalter Text+Bild ───────────────────────────────────────────────── */
.duo {
  display: grid; gap: 2.2rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 62em) {
  .duo { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .duo.getauscht > :first-child { order: 2; }
}

/* ── Schaubilder (SVG) ───────────────────────────────────────────────────── */
.schaubild {
  background: var(--k-surface);
  border: 1px solid var(--k-border);
  border-radius: var(--k-r-lg);
  box-shadow: var(--k-shadow-sm);
  padding: 1rem;
  margin: 1.6rem 0 0;
}
.schaubild svg { display: block; width: 100%; height: auto; }
.schaubild figcaption {
  padding: 0.7rem 0.4rem 0.1rem;
  font-size: 0.92rem; color: var(--k-text-muted);
}
.schaubild .steuerung { display: flex; gap: 0.5rem; padding: 0.6rem 0.3rem 0; }
.schaubild .steuerung button {
  font: inherit; font-size: 0.9rem; font-weight: 700;
  color: var(--k-primary-dark); background: var(--k-primary-soft);
  border: 1px solid var(--k-primary-line); border-radius: var(--k-r-pill);
  padding: 0.35rem 1rem; cursor: pointer; min-height: 44px;
}
.schaubild .steuerung button:hover { background: #e0ecff; }

/* ── Merklisten / Grenzen ─────────────────────────────────────────────────── */
.merkliste { list-style: none; padding: 0; margin: 1.2rem 0 0; max-width: var(--mass-text); }
.merkliste li {
  padding: 0.35rem 0 0.35rem 1.9rem; position: relative;
}
.merkliste li::before {
  content: ""; position: absolute; left: 0; top: 0.78em;
  width: 1.05rem; height: 0.6rem;
  border-left: 3px solid var(--k-ok); border-bottom: 3px solid var(--k-ok);
  transform: rotate(-45deg) scale(0.8); transform-origin: left bottom;
}
.merkliste.grenzen li::before {
  border: 0; width: 0.85rem; height: 3px; top: 0.85em;
  background: var(--k-warn); transform: none;
}

/* Hinweiskasten */
.hinweis {
  background: var(--k-primary-soft);
  border-left: 4px solid var(--k-primary);
  border-radius: var(--k-r-sm);
  padding: 0.9rem 1.1rem; margin: 1.4rem 0;
  max-width: var(--mass-text);
  font-size: 0.99rem; color: var(--k-text-soft);
}
.hinweis.warnung { background: var(--k-warn-soft); border-left-color: var(--k-warn); }

/* ── Tabellen ────────────────────────────────────────────────────────────── */
.tabellenrahmen { overflow-x: auto; margin: 1.4rem 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.99rem; }
th, td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--k-border); vertical-align: top; }
th { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--k-text-muted); }
tbody tr:nth-child(even) { background: var(--k-surface-muted); }

/* ── Formulare ───────────────────────────────────────────────────────────── */
.formular { max-width: var(--mass-text); }
.feld { margin-bottom: 1.1rem; }
.feld label { display: block; font-weight: 700; font-size: 0.98rem; margin-bottom: 0.3rem; }
.feld .freiwillig { font-weight: 400; color: var(--k-text-muted); }
.feld input, .feld textarea {
  width: 100%; font: inherit; color: var(--k-text);
  background: var(--k-surface); border: 1px solid var(--k-border-strong);
  border-radius: var(--k-r-md); padding: 0.65rem 0.85rem; min-height: 48px;
}
.feld textarea { min-height: 10rem; resize: vertical; }
.feld input:focus-visible, .feld textarea:focus-visible {
  border-color: var(--k-primary); box-shadow: var(--k-ring); outline: none;
}
button.knopf { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* ── Kontaktblock ────────────────────────────────────────────────────────── */
.kontaktkarte {
  background: var(--k-surface); border: 1px solid var(--k-border);
  border-radius: var(--k-r-lg); box-shadow: var(--k-shadow-sm);
  padding: 1.5rem 1.4rem;
}
.kontaktkarte .gross { font-size: 1.25rem; font-weight: 700; }
.kontaktkarte a { word-break: break-word; }
.kontaktzeile { display: flex; align-items: center; gap: 0.6rem; margin: 0.55rem 0; }
.kontaktzeile svg { flex: 0 0 auto; color: var(--k-primary-dark); }

/* ── Fußzeile ────────────────────────────────────────────────────────────── */
.fuss {
  background: var(--k-nav-bg); color: var(--k-nav-text);
  margin-top: 0; padding: 2.8rem 1.25rem 2rem;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #2563eb, #06b6d4) 1;
  font-size: 0.98rem;
}
.fuss .innen {
  max-width: var(--mass); margin: 0 auto;
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}
.fuss h2 {
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #8fa1bd; margin-bottom: 0.8rem;
}
.fuss a { color: #dbe4f2; }
.fuss a:hover { color: #fff; }
.fuss ul { list-style: none; margin: 0; padding: 0; }
.fuss li { margin: 0 0 0.55rem; }
.fuss .marke { padding: 0; margin-bottom: 0.8rem; }
.fuss p { color: var(--k-nav-text); font-size: 0.95rem; }
.fuss .rechtszeile {
  max-width: var(--mass); margin: 2.2rem auto 0; padding-top: 1.2rem;
  border-top: 1px solid #2a3a58; color: #8fa1bd; font-size: 0.9rem;
  display: flex; gap: 1.4rem; flex-wrap: wrap;
}
.fuss .rechtszeile a { color: #b6c2d6; }

/* ── Rechtstexte ─────────────────────────────────────────────────────────── */
.rechtstext h2 { margin-top: 2.2rem; font-size: 1.35rem; }
.rechtstext h3 { margin-top: 1.6rem; }
.adresse { font-style: normal; line-height: 1.7; }
.luecke {
  background: var(--k-warn-soft); border: 1px dashed var(--k-warn);
  border-radius: var(--k-r-sm); padding: 0.1rem 0.45rem;
  font-weight: 700; color: var(--k-warn);
}

/* ── Einblendungen beim Scrollen ─────────────────────────────────────────── */
/* Grundzustand: sichtbar. Erst wenn JavaScript läuft (html.js), wird der
   Ausgangszustand versteckt und vom IntersectionObserver einmalig
   eingeblendet - Inhalte gehen ohne Skript also nie verloren. */
html.js .einblenden {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 380ms ease-out, transform 380ms ease-out;
}
html.js .einblenden.sichtbar { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .einblenden { opacity: 1; transform: none; transition: none; }
  .knopf, .kopf nav a { transition: none; }
  * { animation: none !important; }
}

/* ── Druck ───────────────────────────────────────────────────────────────── */
@media print {
  .kopf nav, .knopfzeile, .schaubild .steuerung { display: none; }
  body { background: #fff; }
}

/* ── Feinabstände und Schaubild-Stile ────────────────────────────────────────
   Ohne Inline-Stile und ohne <style>-Blöcke in den Seiten: Der Testlauf des
   Portals prüft ALLE HTML-Dateien des Repositorys auf beides - die Website
   hält sich an dieselbe Regel. */
.ohne-abstand { margin-bottom: 0; }
.abstand-oben { margin-top: 1.4rem; }
.bild-folge { margin-top: 1.3rem; }
.duo-abstand { margin-top: 1.8rem; }
.bild-schmal { max-width: 22rem; }
.kleingedruckt { margin-top: 1.2rem; font-size: 0.95rem; color: var(--k-text-muted); }
#formular-hinweis { margin-top: 1rem; }

/* Mesh-Animation (Startseite) */
#mesh-animation text { font: 700 15px Inter, system-ui, sans-serif; fill: #334155; }
#mesh-animation .klein { font-weight: 400; font-size: 13px; fill: #55657c; }
#mesh-animation .strecke { stroke: #2563eb; stroke-width: 2.5; stroke-dasharray: 7 7; opacity: .55; }
#mesh-animation .halo { fill: #2563eb; opacity: 0; }
#mesh-animation .station.aktiv .halo { opacity: .18; }
#mesh-animation .geraet { stroke: #1d4ed8; stroke-width: 3; fill: none; stroke-linecap: round; }
#mesh-animation .flaeche { fill: #eef4ff; stroke: #c7dbfc; }
#mesh-animation .tot { stroke: #94a3b8; }
#mesh-animation #funke circle { fill: #06b6d4; }
#mesh-animation #funke .kern { fill: #ffffff; }

/* Architektur-Schaubild (Technikseite) */
#arch-schaubild .a-text { font: 700 15px Inter, system-ui, sans-serif; fill: #0f172a; }
#arch-schaubild .a-klein { font: 400 13px Inter, system-ui, sans-serif; fill: #55657c; }
#arch-schaubild .a-box { fill: #ffffff; stroke: #cbd5e1; }
#arch-schaubild .a-boxblau { fill: #eef4ff; stroke: #c7dbfc; }
#arch-schaubild .a-linie { stroke: #2563eb; stroke-width: 2.5; fill: none; }
#arch-schaubild .a-mesh { stroke: #0ea5b7; stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
#arch-schaubild .a-geraet { stroke: #1d4ed8; stroke-width: 2.6; fill: none; stroke-linecap: round; }
