/* ==========================================================================
   SK Haustechnik - Stylesheet
   --------------------------------------------------------------------------
   Die HTML-Struktur ist fix und wird an anderer Stelle gepflegt. Dieses
   Stylesheet arbeitet ausschliesslich mit den bestehenden Klassen:
     section, section-white, section-dark, container, section-head,
     service-grid, service-card, trust-grid, trust-card, process,
     process-step, cta-band, contact-layout, note-box, hero*, nav*, footer*,
     page-hero, legal-content, placeholder, button*, icon, order-head, hero-line
   Zusaetzliche Sections mit denselben Klassen und ein <picture> im Hero
   werden bewusst mit abgedeckt (siehe "Bilder" und "Robustheit").

   Kontrastwerte (WCAG 2.1, selbst nachgerechnet, Werte in ../DEPLOY.md):
     Textfarben erreichen AA (>= 4.5:1), Bedienelement-Grenzen >= 3:1.
   ========================================================================== */

:root {
  --color-ink: #07090d;
  --color-ink-soft: #111827;
  --color-panel: #151922;
  --color-white: #ffffff;
  --color-paper: #f7f8fa;

  /* Sekundaertext auf hellem Grund.
     Vorher #667085: 4.97:1 auf Weiss, 4.68:1 auf --color-paper - bestand AA
     nur knapp. Jetzt #5d6675: 5.80:1 auf Weiss, 5.45:1 auf Paper. */
  --color-muted: #5d6675;

  /* Sekundaertext auf dunklem Grund: 9.13:1 auf --color-ink,
     8.06:1 auf --color-panel. */
  --color-muted-dark: #a8b0bf;

  --color-line: #d8dde6;

  /* Dekorative Trennlinien auf dunklem Grund. Absichtlich schwach:
     rein dekorativ, unterliegt daher nicht der 3:1-Regel (WCAG 1.4.11). */
  --color-line-dark: rgba(255, 255, 255, 0.14);

  /* Grenze von BEDIENELEMENTEN auf dunklem Grund. Muss 3:1 erreichen.
     rgba(255,255,255,0.42) ergibt 4.06:1 gegen --color-ink
     (0.14 waeren nur 1.41:1, 0.32 nur 2.78:1). */
  --color-line-control: rgba(255, 255, 255, 0.42);

  --color-blue: #0b78c8;
  --color-blue-bright: #38bdf8;

  /* Inline-Links im Fliesstext auf hellem Grund: 6.68:1 auf Weiss. */
  --color-link: #0a5f9e;

  /* Fokusring. Kein einziger Farbwert erreicht 3:1 gegen Hell UND Dunkel
     (#38bdf8: 9.30:1 auf Ink, aber nur 2.14:1 auf Weiss). Deshalb eine
     Variable, die in dunklen Kontexten ueberschrieben wird. */
  --focus-ring: var(--color-link);

  /* --shadow-soft entfernt: war deklariert, wurde aber nirgends per var()
     verwendet (toter Token). */
  --container: 1160px;
  --radius: 8px;
  --header-h: 82px;
}

/* Dunkle Kontexte erben den helleren Fokusring an alle Kinder. */
.site-header,
.hero,
.section-dark,
.cta-band,
.site-footer,
.page-hero {
  --focus-ring: var(--color-blue-bright);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Der Header ist sticky (82px). Ohne scroll-padding verschwindet das
     Sprungziel eines #anchors darunter. */
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
  /* Die Scrollleiste behaelt ihren Platz, auch wenn das Scrollen kurzzeitig
     abgeschaltet ist (offenes Menue, offene Bild-Vollansicht). Ohne das
     springt der Inhalt um die Leistenbreite. */
  scrollbar-gutter: stable;
}

/* --------------------------------------------------------------------------
   Schriften
   Zwei Schriften, wie es die Design-Leitlinien fordern: eine eigenstaendige
   Schrift fuer die Ueberschriften, die System-Schrift fuer den Fliesstext
   (dort zaehlt Lesbarkeit, nicht Wiedererkennbarkeit).

   Archivo (SIL Open Font License, Lizenztext in assets/archivo-OFL.txt) liegt
   als variable Schrift SELBST GEHOSTET im Projekt - kein Google-Fonts-CDN,
   keine externen Requests, kein Datenschutzproblem. Auf Latin plus deutsche
   Umlaute und Satzzeichen zusammengeschnitten: 27 kB fuer alle Schnitte von
   100 bis 900.

   ACHTUNG beim Austauschen: Die Datei wird ein Jahr lang unveraenderlich
   gecacht (siehe _headers). Eine neue Version braucht deshalb einen NEUEN
   Dateinamen, sonst sehen wiederkehrende Besucher weiter die alte.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Archivo Variable";
  src: url("archivo-var-latin.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Archivo Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Ueberschriften und die Zahlen in den Hero-Kacheln - alles, was als
   Schlagzeile gelesen wird. Der Fliesstext bleibt bewusst System-Schrift. */
h1,
h2,
h3,
.hero-line strong {
  font-family: var(--font-display);
  /* Archivo laeuft etwas weiter als die System-Schriften; in den grossen
     Graden wirkt das luftig, deshalb leicht zusammengezogen. */
  letter-spacing: -0.015em;
}

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* Lange deutsche Komposita ("Umsatzsteuer-Identifikationsnummer",
     "Heizungsmodernisierung") sollen umbrechen statt das Layout zu sprengen. */
  overflow-wrap: break-word;
  hyphens: auto;
}

body.menu-open {
  overflow: hidden;
}

/* Zusaetzliche Absicherung fuer Sprungziele in beliebigen neuen Sections. */
:target {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* --------------------------------------------------------------------------
   Bilder
   Global, damit auch spaeter ergaenzte Bilder (z. B. ein <picture> im Hero)
   nicht aus dem Layout laufen. height:auto ist wichtig: die HTML-Bilder
   tragen width/height-Attribute (Logo 1546x265), ohne height:auto wuerden
   sie beim Greifen von max-width:100% verzerrt.
   -------------------------------------------------------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  max-width: 100%;
  display: block;
}

picture {
  display: block;
}

picture img {
  width: 100%;
}

figure {
  margin: 0;
}

a {
  color: inherit;
}

/* Inline-Links im Fliesstext. Bewusst auf klassenlose <a> beschraenkt,
   damit .button, .brand, .main-nav a, .footer-links a unberuehrt bleiben. */
.legal-content a:not([class]),
.note-box a:not([class]),
.section-head a:not([class]),
.service-card a:not([class]),
.trust-card a:not([class]),
.process-step a:not([class]) {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section-dark a:not([class]),
.cta-band a:not([class]),
.page-hero a:not([class]) {
  color: var(--color-blue-bright);
}

/* --------------------------------------------------------------------------
   Fokus-Sichtbarkeit
   Breiter Selektor statt nur a/button, damit auch spaeter ergaenzte
   Formularfelder, details/summary und tabindex-Elemente sichtbar fokussiert
   werden. :focus-visible zeigt den Ring nur bei Tastatur-/AT-Bedienung.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

/* Alte Browser ohne :focus-visible bekommen wenigstens :focus. */
@supports not selector(:focus-visible) {
  a:focus,
  button:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
  }
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  transform: translateY(-160%);
  background: var(--color-white);
  color: var(--color-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 9, 13, 0.86);
  border-bottom: 1px solid var(--color-line-dark);
  backdrop-filter: blur(18px);
}

/* Ohne backdrop-filter waere der Header halbtransparent und der Text
   koennte ueber hellen Inhalten den Kontrast verlieren - dann deckend. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--color-ink);
  }
}

.nav-shell {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  width: min(270px, 58vw);
  height: auto;
  background: var(--color-white);
  padding: 7px 9px;
  border-radius: 6px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--color-white);
  font-size: 0.94rem;
}

.main-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  /* rgba(255,255,255,0.82) auf --color-ink: 13.27:1 */
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: color 200ms ease;
}

.main-nav a:hover {
  color: var(--color-white);
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  /* Bedienelement-Grenze: 4.06:1 statt vorher 1.41:1 */
  border: 1px solid var(--color-line-control);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-white);
  cursor: pointer;
  flex: none;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 200ms ease, opacity 200ms ease;
}

.menu-open .nav-toggle span {
  opacity: 0;
}

.menu-open .nav-toggle::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .nav-toggle::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Buttons - Touch-Targets >= 44px (min-height 48px)
   -------------------------------------------------------------------------- */
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 12px 18px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

/* Bewusst flach: kein Leuchtschatten, kein Hochspringen. Hover und Fokus
   zeigen einen dunklen Balken an der Unterkante - wie ein gedrueckter
   Schalter, nicht wie eine schwebende App-Kachel. */
.button:hover {
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}

.button svg {
  flex: none;
}

/* Weiss auf #0b78c8: 4.63:1 - AA erfuellt (Text < 18.66px bold zaehlt
   nicht als "gross", Ziel bleibt 4.5:1). */
.button-primary {
  color: var(--color-white);
  background: var(--color-blue);
}

.button-secondary {
  color: var(--color-white);
  /* Grenze eines Bedienelements: 4.06:1 (vorher 0.32 = 2.78:1, unter 3:1) */
  border-color: var(--color-line-control);
  background: rgba(255, 255, 255, 0.08);
}

/* Auf hellem Grund war der Sekundaer-Button weiss auf weiss (404-Seite,
   Formular-Ergebnisseiten). Grenze #6b7383 auf Weiss: 4.83:1. */
.section-white .button-secondary,
.section-paper .button-secondary {
  color: var(--color-ink);
  border-color: #6b7383;
  background: var(--color-white);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  min-height: calc(100vh - var(--header-h)); /* Fallback */
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  align-items: end;
  /* Zwei Zeilen (Grid + Kurzvorteile): ohne align-content wuerden beide
     Zeilen gestreckt und es entstuende eine Luecke dazwischen. */
  align-content: end;
  color: var(--color-white);
  background: var(--color-ink);
  /* Fuer ein optionales, vollflaechiges <picture> als direktes Kind. */
  position: relative;
  isolation: isolate;
}

/* Variante A: <picture> als direktes Kind von .hero = Hintergrundbild.
   Es liegt hinter dem Text, deckt die Flaeche ab und wird zugeschnitten. */
.hero > picture {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
}

.hero > picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Abdunkelung, damit weisser Text auch auf einem Foto lesbar bleibt.
   Nur wenn tatsaechlich ein Bild vorhanden ist. */
.hero:has(> picture)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.72) 0%, rgba(7, 9, 13, 0.82) 55%, rgba(7, 9, 13, 0.94) 100%);
}

.hero-grid {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding: 88px 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
  gap: 40px;
  align-items: end;
  position: relative;
}

/* Variante B: <picture> innerhalb des Grids = normales Inhaltsbild. */
.hero-grid picture {
  border-radius: var(--radius);
  overflow: hidden;
}

/* Hero-Foto (Portrait 600x800). Steht auf grossen Viewports in der zweiten
   Spalte neben dem Text, die .hero-line liegt darunter ueber die ganze
   Breite. Feste Seitenverhaeltnis-Angabe verhindert Layout-Shift auch dann,
   wenn das Bild spaeter ersetzt wird. */
.hero-media {
  align-self: end;
  border: 1px solid var(--color-line-control);
  background: var(--color-panel);
}

.hero-media img {
  aspect-ratio: 600 / 800;
  object-fit: cover;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 5.7rem);
  line-height: 0.98;
  max-width: 780px;
  text-wrap: balance;
}

.hero-lead {
  max-width: 680px;
  margin: 24px 0 0;
  /* 13.27:1 auf --color-ink */
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* Einsatzzeile unter dem Hero: Notdienst, Nummer, typische Schaeden.
   Ersetzt die frueheren Glaskacheln "24/7 / 3 / 1" - nur 24/7 war eine echte
   Aussage. Gesetzt wie eine Zeile auf einem Einsatzzettel: Linien oben und
   unten, keine Kachel, kein Blur. */
.hero > .hero-line {
  width: min(100% - 32px, var(--container));
  margin: 0 auto clamp(32px, 5vw, 56px);
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  border-block: 1px solid var(--color-line-control);
  font-variant-numeric: tabular-nums;
}

.hero-line strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* #38bdf8 auf --color-ink: 9.30:1 */
  color: var(--color-blue-bright);
}

.hero-line a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  text-underline-offset: 4px;
}

.hero-line span {
  /* 13.27:1 auf --color-ink */
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.96rem;
}

/* Trennstriche nur zwischen Elementen in derselben Zeile sinnvoll; beim
   Umbruch auf dem Handy entfallen sie. */
@media (min-width: 641px) {
  .hero-line a::before,
  .hero-line span::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 1.2em;
    margin-right: 22px;
    background: var(--color-line-control);
    vertical-align: middle;
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(64px, 9vw, 112px) 0;
}

.section-dark {
  color: var(--color-white);
  background: var(--color-ink);
}

.section-white {
  background: var(--color-white);
}

/* Aufeinanderfolgende helle Abschnitte trennt eine Linie statt eines
   Farbwechsels. */
.section-white + .section-white,
.legal-content + .section-white {
  border-top: 1px solid var(--color-line);
}

/* Helle Zwischensection mit leichtem Grauwert, damit zwei helle Sections in
   Folge (Leistungen -> Praxis) optisch getrennt bleiben. --color-muted
   erreicht auf --color-paper 5.45:1, also AA. */
.section-paper {
  background: var(--color-paper);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.65fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 36px;
}

/* Gestapelte Variante: Titel und Beitext untereinander (Kontaktspalte). */
.section-head.is-stacked {
  display: block;
  margin-bottom: 0;
}

.section-head.is-stacked p {
  margin-top: 18px;
}

/* Section-Head ohne Beitext soll nicht die halbe Zeile leer lassen. */
.section-head:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.section-head h2,
.legal-content h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.08;
  text-wrap: balance;
}

.section-head p {
  margin: 0;
  /* #5d6675 auf Weiss: 5.80:1 */
  color: var(--color-muted);
  font-size: 1.05rem;
  text-wrap: pretty;
}

.section-dark .section-head p {
  color: var(--color-muted-dark);
}

/* --------------------------------------------------------------------------
   Karten-Grids
   auto-fit statt fester Spaltenzahl: falls weitere Sections mit mehr oder
   weniger Karten ergaenzt werden, bleibt das Raster tragfaehig
   (vorher repeat(3,1fr) bzw. repeat(4,1fr) - eine 4. Service-Karte oder
   ein 5. Prozessschritt haetten eine unausgewogene Restzeile ergeben).
   -------------------------------------------------------------------------- */
.service-grid,
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.service-card,
.trust-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(7, 9, 13, 0.04);
  min-width: 0; /* verhindert Ueberlauf durch lange Woerter im Grid */
}

/* Karten auch in dunklen Sections tragfaehig, falls dort eingesetzt. */
.section-dark .service-card,
.section-dark .trust-card,
.cta-band .service-card,
.cta-band .trust-card {
  background: var(--color-panel);
  border-color: var(--color-line-dark);
}

.icon {
  width: 42px;
  height: 42px;
  /* #0b78c8 auf Weiss: 4.63:1 - deutlich ueber den 3:1 fuer Grafiken */
  color: var(--color-blue);
  margin-bottom: 20px;
}

.section-dark .icon,
.cta-band .icon {
  color: var(--color-blue-bright);
}

.service-card h3,
.trust-card h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
  text-wrap: balance;
}

.service-card p,
.trust-card p,
.legal-content p,
.legal-content li {
  color: var(--color-muted);
}

.section-dark .service-card p,
.section-dark .service-card ul,
.section-dark .trust-card p {
  color: var(--color-muted-dark);
}

.service-card ul {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--color-muted);
}

.service-card li + li {
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Leistungsverzeichnis (#leistungen)
   Ersetzt das Dreier-Kartenraster. Aufgebaut wie die Positionen eines
   Angebots: kraeftige Linie oben, duenne Linien zwischen den Zeilen,
   Positionsnummer links, keine Icons.
   -------------------------------------------------------------------------- */
.lv {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--color-ink);
}

.lv-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(10rem, 14rem) minmax(0, 1fr) 11rem;
  gap: 8px 28px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--color-line);
}

.lv-pos {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  /* #0b78c8 auf Weiss: 4.63:1 */
  color: var(--color-blue);
  font-variant-numeric: tabular-nums;
}

.lv-row h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.lv-items {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
}

/* Punkte fliessen als Text, getrennt durch Mittelpunkte. */
.lv-items li {
  display: inline;
}

.lv-items li + li::before {
  content: " · ";
  color: var(--color-blue);
  font-weight: 700;
}

.lv-link {
  justify-self: end;
  align-self: center;
}

@media (max-width: 900px) {
  .lv-row {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .lv-items,
  .lv-link {
    grid-column: 2;
  }

  .lv-link {
    justify-self: start;
  }
}

/* --------------------------------------------------------------------------
   Ueber uns: Text plus Betriebsdaten-Blatt
   -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about-text h2 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.08;
}

.about-text p {
  margin: 0;
  max-width: 62ch;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.about-text p + p {
  margin-top: 14px;
}

/* Gleiche Sprache wie das Kontaktformular: blaue Kopflinie, Papiergrund. */
.about-sheet {
  margin: 0;
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-blue);
  background: var(--color-paper);
}

.about-sheet div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 14px 20px;
}

.about-sheet div + div {
  border-top: 1px solid var(--color-line);
}

.about-sheet dt {
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.about-sheet dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.about-sheet a {
  color: var(--color-link);
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .about-sheet div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* --------------------------------------------------------------------------
   Foerderung: Text plus beschriftetes Anlagenfoto
   -------------------------------------------------------------------------- */
.funding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.funding-text h2 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.08;
  text-wrap: balance;
}

.funding-lead {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.funding-note {
  margin: 22px 0 0;
  padding: 12px 16px;
  border-left: 4px solid var(--color-blue);
  background: var(--color-paper);
  color: var(--color-ink-soft);
}

.funding-topics {
  margin-top: 30px;
  border-top: 2px solid var(--color-ink);
}

.funding-topics > div {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-line);
}

.funding-topics h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.funding-topics p {
  margin: 0;
  color: var(--color-muted);
}

.plan {
  margin: 0;
}

.plan-image {
  position: relative;
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-blue);
}

.plan-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Nummernmarker wie die Positionsnummern einer Explosionszeichnung.
   --x/--y setzt das HTML je Marker (Mittelpunkt des Bauteils in Prozent). */
.plan-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: var(--color-blue);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 0 0 2px var(--color-white);
}

.plan-legend {
  margin: 0;
  padding: 16px 0 0;
  list-style: none;
  counter-reset: plan;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.plan-legend li {
  counter-increment: plan;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.plan-legend li + li {
  border-top: 1px solid var(--color-line);
}

.plan-legend li::before {
  content: counter(plan);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--color-blue);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
}

.plan-legend strong {
  color: var(--color-ink);
}

@media (max-width: 999px) {
  .funding {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Fotoreihe "Aus der Praxis" auf den Unterseiten
   Gleiches Seitenformat fuer alle Fotos (Hoch- und Querformat gemischt),
   zugeschnitten per object-fit. Ein einzelnes Foto bleibt schmal.
   -------------------------------------------------------------------------- */
.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.photo-row figure {
  margin: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.photo-row img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
}

.photo-row figcaption {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.section-paper .section-head a:not([class]) {
  color: var(--color-link);
}

/* --------------------------------------------------------------------------
   Weiterfuehrende Links (Karten, Section-Fuss, Footer)
   Bewusst als Links in den Karten plus eine kompakte Zeile am Fuss der
   Leistungs-Section - die Hauptnavigation bleibt bei ihren 7 Eintraegen.
   -------------------------------------------------------------------------- */
.card-more {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 18px 0 0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--color-link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-link::after {
  content: "\2192"; /* Pfeil, rein dekorativ */
  font-weight: 400;
  transition: transform 160ms ease;
}

.card-link:hover::after {
  transform: translateX(3px);
}

.section-dark .card-link,
.cta-band .card-link {
  color: var(--color-blue-bright);
}





/* --------------------------------------------------------------------------
   Arbeiten aus der Praxis - Galerie
   Die Liste ist ein horizontaler Scroll-Container mit Scroll-Snap. Ohne
   JavaScript bleibt sie per Wischen, Scrollrad und Tastatur voll bedienbar;
   assets/galerie.js ergaenzt Autoplay, Pfeile, Punkte und die Vollansicht.

   Kachelbreite und -hoehe sind fest, damit 2 Bilder genauso funktionieren
   wie 12 und niemand CSS anfassen muss, wenn ein Bild dazukommt. Die
   vorhandenen Motive sind teils quer (4:3), teils hoch (3:4) - ohne feste
   Medienhoehe + object-fit: cover haetten die Kacheln unterschiedliche
   Hoehen und die Reihe wuerde ausgefranst wirken. Zuschnitt ist hier das
   kleinere Uebel als eine springende Grundlinie.
   -------------------------------------------------------------------------- */
.gallery {
  /* 760px ist bewusst so gewaehlt, dass im Container (1160px) neben einer
     Kachel noch etwa die HALBE naechste sichtbar bleibt. Dieser Anschnitt
     ist die Einladung zum Weiterblaettern - und er sorgt dafuer, dass die
     Galerie schon mit zwei Bildern ueberlaeuft, also Autoplay und Pfeile
     ueberhaupt einen Sinn haben. */
  --gallery-tile: 760px;
  --gallery-media-h: clamp(200px, 28vw, 400px);
  display: grid;
  gap: 18px;
}

.gallery-track {
  position: relative;
  display: flex;
  gap: 24px;
  margin: 0;
  /* 4px Innenabstand, damit der Fokusring einer Kachel nicht abgeschnitten
     wird - overflow: auto wuerde ihn sonst kappen. */
  padding: 4px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  /* Verhindert, dass ein Wisch in der Galerie die ganze Seite mitzieht. */
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.gallery-item {
  flex: 0 0 min(84%, var(--gallery-tile));
  scroll-snap-align: start;
  display: grid;
}

.gallery-figure {
  display: grid;
  gap: 12px;
  margin: 0;
  align-content: start;
}

.gallery-figure img {
  display: block;
  width: 100%;
  height: var(--gallery-media-h);
  object-fit: cover;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
}

.gallery-figure figcaption {
  color: var(--color-muted);
  font-size: 0.95rem;
  text-wrap: pretty;
}

/* Bedienleiste. Wird von galerie.js erzeugt und nur eingehaengt, wenn die
   Galerie ueberhaupt breiter ist als der sichtbare Bereich - bei zwei
   Bildern auf einem breiten Monitor gibt es nichts zu blaettern, dann
   waeren Pfeile und Punkte nur Dekoration. */
.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gallery-controls[hidden] {
  display: none;
}

.gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--color-ink);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.gallery-btn:hover {
  border-color: var(--color-ink);
}

.gallery-btn svg {
  flex: none;
}

.gallery-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0 auto 0 6px;
  padding: 0;
  list-style: none;
}

.gallery-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Der sichtbare Punkt ist kleiner als die 44x44-Trefferflaeche des Buttons. */
.gallery-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--color-muted);
  background: transparent;
}

.gallery-dot[aria-current="true"]::before {
  background: var(--color-ink);
  border-color: var(--color-ink);
  transform: scale(1.2);
}

/* --------------------------------------------------------------------------
   Vollansicht (Lightbox)
   In der Kachel ist das Foto beschnitten (feste Hoehe + object-fit: cover).
   Ein Klick darauf zeigt es im nativen <dialog> vollstaendig. Der Auslöser
   ist ein echter <button>, den galerie.js um das <img> legt - deshalb muss
   er hier alles ablegen, was ein Button von sich aus mitbringt (Rahmen,
   Hintergrund, Innenabstand, inline-Fluss), sonst waere die Kachel ploetzlich
   gerahmt und schmaler.
   -------------------------------------------------------------------------- */
.gallery-zoom {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  text-align: inherit;
  appearance: none;
  cursor: zoom-in;
}

/* Dezenter Hinweis "laesst sich vergroessern". Rein dekorativ (Pseudo-
   Element, also nicht im Vorlesetext); die Information selbst steckt im
   aria-label des Buttons. */
.gallery-zoom::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.94);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2307090d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E");
}

.gallery-zoom:hover img,
.gallery-zoom:focus-visible img {
  border-color: var(--color-ink);
}

.lightbox {
  /* Der Dialog nimmt den ganzen Viewport ein: so ist die Flaeche neben dem
     Bild Teil des Dialogs und laesst sich anklicken (Schliessen). */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--color-white);
  /* Die Abdunklung liegt auf dem Dialog selbst und nicht nur auf ::backdrop:
     der Dialog fuellt denselben Bereich, und so ist das Bild auch dort
     freigestellt, wo ein Browser den Backdrop nicht darstellt. */
  background: rgba(7, 9, 13, 0.92);
  border: 0;
  overflow: hidden;
  --focus-ring: var(--color-blue-bright);
  --lightbox-pad: clamp(12px, 3vw, 28px);
  /* Platz fuer Bildunterschrift, Pfeilzeile und Abstaende. Wird von der
     Hoehengrenze des Bildes abgezogen, damit auch ein HOCHFORMAT auf einem
     kleinen Handy-Bildschirm komplett hineinpasst. */
  --lightbox-reserve: 210px;
}

.lightbox::backdrop {
  background: rgba(7, 9, 13, 0.9);
}

.lightbox-surface {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: var(--lightbox-pad);
  /* Oben rechts sitzt der Schliessen-Knopf - dort bleibt Platz frei. */
  padding-top: calc(var(--lightbox-pad) + 52px);
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
  max-width: 100%;
  margin: 0;
}

.lightbox-image {
  /* Unbeschnitten und unverzerrt: nur Obergrenzen, die Seiten bleiben auto. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - var(--lightbox-reserve));
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--color-panel);
}

@supports (height: 100dvh) {
  .lightbox-image {
    max-height: calc(100dvh - var(--lightbox-reserve));
  }
}

.lightbox-caption {
  max-width: min(70ch, 100%);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.lightbox-bar {
  display: flex;
  gap: 12px;
}

/* Weisser Knopf mit dunklem Zeichen und Rahmen: bleibt auch dann erkennbar,
   wenn dahinter ein heller Bildbereich liegt. */
.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--color-ink);
  background: var(--color-white);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(7, 9, 13, 0.45);
  font: inherit;
  cursor: pointer;
}

.lightbox-btn:hover {
  background: var(--color-paper);
}

.lightbox-close {
  position: absolute;
  top: var(--lightbox-pad);
  right: var(--lightbox-pad);
}

/* Sanftes Aufblenden. Kein Scroll-Lock-Hack am Body: das Scrollen des
   Hintergrunds unterbindet die Regel weiter unten sprungfrei. */
@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

.lightbox[open] {
  animation: lightbox-in 180ms ease-out;
}

/* Hintergrund-Scrollen anhalten, solange die Vollansicht offen ist.
   scrollbar-gutter: stable (siehe html) haelt die Breite dabei konstant,
   deshalb springt das Layout nicht. */
body:has(dialog.lightbox[open]) {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Prozess
   -------------------------------------------------------------------------- */
/* Ablauf als Leitungsschema: eine durchgehende blaue Leitung, die Schritte
   haengen als quadratische Anschlusspunkte daran - wie in einem
   Strangschema. Ersetzt die frueheren Nummernkreise im Kachelraster.
   Waagerecht nur, wenn alle vier Schritte in eine Zeile passen; sonst
   senkrecht, damit die Leitung nie mitten in einer Umbruchzeile endet. */
.process {
  counter-reset: steps;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
}

.process::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 3px;
  /* #0b78c8 auf Weiss: 4.63:1, ueber 3:1 fuer Grafiken */
  background: var(--color-blue);
}

.process-step {
  counter-increment: steps;
  position: relative;
  padding-top: 38px;
  min-width: 0;
}

/* Anschlusspunkt auf der Leitung */
.process-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 13px;
  height: 13px;
  background: var(--color-ink);
  box-shadow: 0 0 0 3px var(--color-white);
}

.process-step h3 {
  margin: 0 0 10px;
}

.process-step h3::before {
  content: "Schritt " counter(steps, decimal-leading-zero);
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* 6.68:1 auf Weiss */
  color: var(--color-link);
}

.process-step p {
  margin: 0;
  color: var(--color-muted);
}

@media (max-width: 999px) {
  .process {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .process::before {
    left: 5px;
    right: auto;
    top: 6px;
    bottom: 6px;
    width: 3px;
    height: auto;
  }

  .process-step {
    padding: 0 0 30px 40px;
  }

  .process-step:last-child {
    padding-bottom: 0;
  }

  .process-step::before {
    top: 4px;
  }
}

/* --------------------------------------------------------------------------
   CTA-Band
   -------------------------------------------------------------------------- */
/* Dunkle Flaechen gibt es nur noch im Hero und hier. Dunkel bedeutet auf
   dieser Seite "dringend" - alle Inhaltsabschnitte sind hell. */
.cta-band {
  color: var(--color-white);
  background: var(--color-ink);
}

.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: 32px;
  align-items: center;
}

.cta-grid h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 1.05;
  text-wrap: balance;
}

.cta-panel {
  border-left: 4px solid var(--color-blue-bright);
  padding: 8px 0 8px 24px;
}

.cta-panel p {
  margin: 0 0 18px;
  /* 11.06:1 auf --color-ink-soft */
  color: rgba(255, 255, 255, 0.78);
}

/* --------------------------------------------------------------------------
   Kontakt
   -------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(340px, 1fr);
  gap: 42px;
  align-items: start;
}

.contact-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.contact-item {
  display: grid;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-line);
  min-width: 0;
}

.section-dark .contact-item {
  border-bottom-color: var(--color-line-dark);
}

.contact-item span {
  color: var(--color-muted);
  font-size: 0.93rem;
}

.section-dark .contact-item span {
  color: var(--color-muted-dark);
}

.contact-item a,
.contact-item strong {
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}

/* Telefon-/Mail-Link ist ein echtes Bedienelement: Touch-Target >= 44px. */
.contact-item a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  /* Lange E-Mail-Adressen duerfen die Karte nicht aufsprengen. */
  overflow-wrap: anywhere;
}

.section-dark .contact-item a {
  color: var(--color-blue-bright);
}

/* Auch tel:/mailto:-Links ausserhalb der Kontaktliste gross genug. */
a[href^="tel:"]:not([class]),
a[href^="mailto:"]:not([class]) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.note-box {
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  background: var(--color-paper);
  padding: 24px;
  min-width: 0;
}

.note-box p {
  margin: 0;
  /* #5d6675 auf --color-paper: 5.45:1 */
  color: var(--color-muted);
}

.note-box p + p {
  margin-top: 12px;
}

.section-dark .note-box,
.cta-band .note-box {
  background: var(--color-panel);
  border-color: var(--color-line-dark);
}

.section-dark .note-box p,
.cta-band .note-box p {
  color: var(--color-muted-dark);
}

.contact-note {
  margin-top: 28px;
  border-left: 4px solid var(--color-blue);
}

/* Kontaktformular
   Bewusst kein schwebendes Karten-Design mit Schatten: ein ruhiges Blatt mit
   blauer Kopflinie, wie ein Auftragszettel. Felder mit echter Grenze
   (#6b7383 auf Weiss 4.83:1, WCAG 1.4.11 verlangt 3:1). */
.contact-form {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-blue);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--color-paper);
}

.contact-form h3 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.form-intro,
.form-hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.93rem;
}

.form-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.contact-form label {
  font-weight: 700;
  color: var(--color-ink-soft);
}

.contact-form .optional {
  font-weight: 400;
  color: var(--color-muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #6b7383;
  border-radius: 6px;
  background: var(--color-white);
  color: var(--color-ink);
  font: inherit;
  /* 16px verhindert das automatische Hineinzoomen in iOS Safari. */
  font-size: max(1rem, 16px);
}

.contact-form textarea {
  resize: vertical;
  min-height: 132px;
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--color-link);
}

/* Fehlerzustand erst nach Interaktion, nicht schon beim Laden. */
.contact-form :user-invalid {
  border-color: #b42318;
  box-shadow: inset 4px 0 0 #b42318;
}

.contact-form .button {
  justify-self: start;
}

.form-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  /* 10.84:1 auf --color-ink */
  color: rgba(255, 255, 255, 0.74);
  background: var(--color-ink);
  border-top: 1px solid var(--color-line-dark);
  padding: 34px 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: grid;
  gap: 4px;
}

.footer-brand strong {
  color: var(--color-white);
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-brand span {
  /* 7.76:1 auf --color-ink */
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
}

/* Leistungs-Linkgruppe im Footer: zweiter Weg zu den Detailseiten,
   ohne die Hauptnavigation zu verlaengern. */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.footer-heading {
  margin: 0;
  /* 7.76:1 auf --color-ink */
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-nav a:hover {
  color: var(--color-white);
  text-decoration-thickness: 2px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Rechtliche Seiten
   -------------------------------------------------------------------------- */
.page-hero {
  color: var(--color-white);
  background: var(--color-ink);
  padding: clamp(70px, 10vw, 120px) 0 clamp(44px, 7vw, 72px);
}

/* Unterseiten: bewusst kleiner als die Startseite. Die grosse Headline
   gibt es nur einmal, hier fuehrt der Auftragskopf. */
.page-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  max-width: 780px;
  text-wrap: balance;
}

/* Kopf wie auf einem Arbeitsauftrag (ersetzt die fruehere Ueberzeile).
   Feste Felder statt Werbezeile: Leistung, Einsatz, Ansprechpartner. */
.order-head {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 28px;
  border: 1px solid var(--color-line-control);
  border-left: 6px solid var(--color-blue-bright);
}

.order-head div {
  display: grid;
  gap: 2px;
  padding: 10px 18px;
  min-width: 0;
}

.order-head div + div {
  border-left: 1px solid var(--color-line-dark);
}

.order-head dt {
  /* 9.13:1 auf --color-ink */
  color: var(--color-muted-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.order-head dd {
  margin: 0;
  color: var(--color-white);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .order-head {
    flex-direction: column;
    width: 100%;
  }

  .order-head div + div {
    border-left: 0;
    border-top: 1px solid var(--color-line-dark);
  }
}

.page-hero p {
  max-width: 700px;
  margin: 20px 0 0;
  /* 9.13:1 auf --color-ink */
  color: var(--color-muted-dark);
  font-size: 1.12rem;
}

.legal-content {
  background: var(--color-white);
  padding: clamp(48px, 8vw, 90px) 0;
}

.legal-content article {
  max-width: 860px;
}

.legal-content h2 {
  margin-top: 42px;
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  margin-top: 26px;
  margin-bottom: 8px;
}

.legal-content p {
  margin: 0 0 14px;
}

/* Listen und Tabellen werden in Impressum/Datenschutz erfahrungsgemaess
   nachgetragen - hier vorab tragfaehig gemacht. */
.legal-content ul,
.legal-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal-content li + li {
  margin-top: 6px;
}

.legal-content dl {
  margin: 0 0 16px;
}

.legal-content dt {
  font-weight: 800;
  margin-top: 12px;
}

.legal-content dd {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  /* Tabellen mit langen Zellen sollen scrollen, nicht ueberlaufen. */
  display: block;
  overflow-x: auto;
}

.legal-content th,
.legal-content td {
  border: 1px solid var(--color-line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.legal-content th {
  background: var(--color-paper);
}

/* "Bitte ergaenzen"-Marker. #5c4200 auf #fff2cc: 8.43:1 */
.placeholder {
  display: inline-block;
  border-radius: 6px;
  background: #fff2cc;
  color: #5c4200;
  padding: 1px 6px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

::selection {
  background: var(--color-blue);
  color: var(--color-white);
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */
@media (max-width: 920px) {
  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: grid;
    gap: 0;
    padding: 18px 24px 28px;
    background: rgba(7, 9, 13, 0.98);
    border-bottom: 1px solid var(--color-line-dark);
    transform: translateY(-120%);
    transition: transform 220ms ease;
    /* Die Navigation ist auf 7 Eintraege gewachsen. Auf kleinen Geraeten in
       Querlage passt sie sonst nicht mehr ins Bild und waere nicht
       erreichbar - daher scrollbar begrenzen. */
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .menu-open .main-nav {
    transform: translateY(0);
  }

  .hero-grid,
  .section-head,
  .cta-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 72px;
    gap: 28px;
  }

  /* Einspaltig steht das Portraitfoto unter dem Text - ohne Begrenzung waere
     es bei 900px Spaltenbreite 1200px hoch. */
  .hero-media {
    max-width: 420px;
    justify-self: start;
  }

}

@media (max-width: 640px) {
  :root {
    --header-h: 74px;
  }

  .container,
  .hero-grid,
  .hero > .hero-line {
    width: min(100% - 24px, var(--container));
  }

  .nav-shell {
    min-height: var(--header-h);
  }

  .brand img {
    width: min(230px, 63vw);
  }

  .hero {
    min-height: auto;
  }

  .hero-grid {
    padding: 64px 0 28px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .service-grid,
  .trust-grid,
  .form-pair {
    grid-template-columns: 1fr;
  }

  /* Auf kleinen Geraeten eine Kachel fast bildschirmbreit, mit einem
     schmalen Streifen der naechsten als Hinweis "hier geht es weiter". */
  .gallery-item {
    flex-basis: 86%;
  }

  .hero-media {
    max-width: none;
  }

  .service-card,
  .trust-card,
  .note-box {
    padding: 20px;
  }

  .cta-panel {
    padding-left: 18px;
  }

  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ==========================================================================
   Bewegung reduzieren
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  /* Galerie: kein weiches Gleiten, und galerie.js startet kein Autoplay. */
  .gallery-track {
    scroll-behavior: auto !important;
  }

  /* Vollansicht erscheint ohne Auf- und Zoom-Animation. */
  .lightbox[open] {
    animation: none !important;
  }
}

/* ==========================================================================
   Erzwungene Farben (Windows-Kontrastmodus)
   ========================================================================== */
@media (forced-colors: active) {
  /* Leitung und Anschlusspunkte sind Hintergrundflaechen und wuerden im
     Kontrastmodus verschwinden. */
  .process::before,
  .process-step::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .plan-marker,
  .plan-legend li::before {
    forced-color-adjust: none;
    background: Canvas;
    color: CanvasText;
    border: 2px solid CanvasText;
  }

  .button,
  .nav-toggle,
  .service-card,
  .trust-card,
  .note-box,
  .gallery-btn,
  .lightbox-btn {
    border: 1px solid ButtonBorder;
  }

  /* Im Kontrastmodus wird das Lupen-Hinweisbild nicht dargestellt; der
     Hinweis steckt ohnehin im aria-label. */
  .gallery-zoom::after {
    display: none;
  }

  .lightbox {
    background: Canvas;
  }

  .gallery-dot::before {
    border: 1px solid ButtonText;
  }

  .gallery-dot[aria-current="true"]::before {
    background: Highlight;
    border-color: Highlight;
  }

  .button-primary {
    forced-color-adjust: none;
    color: ButtonText;
    background: ButtonFace;
  }

  :focus-visible {
    outline: 3px solid Highlight;
  }
}

/* ==========================================================================
   Druck
   Ziel: lesbares Schwarz-auf-Weiss, keine Farbflaechen, keine Bedien-
   elemente, und die Telefonnummer/Links bleiben als Text erhalten.
   ========================================================================== */
@media print {
  html {
    scroll-behavior: auto;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.45;
  }

  /* Dunkle Flaechen wuerden im Druck die Patrone leeren und Text
     unlesbar machen (weiss auf weiss). */
  .hero,
  .section-dark,
  .cta-band,
  .page-hero,
  .site-footer,
  .section-white,
  .legal-content,
  .trust-card,
  .service-card,
  .process-step,
  .note-box,
  .cta-band .note-box {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .hero > picture,
  .hero:has(> picture)::before {
    display: none !important;
  }

  .section-head p,
  .service-card p,
  .service-card ul,
  .trust-card p,
  .process-step p,
  .contact-item span,
  .note-box p,
  .page-hero p,
  .legal-content p,
  .legal-content li,
  .footer-brand span,
  .cta-panel p,
  .hero-lead {
    color: #000 !important;
  }

  /* Bedienelemente und Deko haben auf Papier keinen Nutzen. */
  .skip-link,
  .nav-toggle,
  .main-nav,
  .hero-actions,
  .site-header {
    display: none !important;
  }

  .icon {
    color: #000 !important;
  }

  .hero {
    min-height: auto !important;
  }

  .hero-grid {
    padding: 0 0 12pt !important;
    display: block !important;
  }

  /* Grossflaechige Fotos kosten im Druck nur Toner. */
  .hero-media {
    display: none !important;
  }

  .section-paper {
    background: #fff !important;
  }

  .gallery-track {
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .gallery-figure img {
    max-width: 92mm;
    height: auto !important;
  }

  .gallery-item {
    break-inside: avoid;
    margin-bottom: 8pt;
  }

  .gallery-controls,
  .gallery-zoom::after,
  .lightbox {
    display: none !important;
  }

  .gallery-zoom {
    cursor: auto;
  }

  .gallery-figure figcaption,
  .card-link,
  .footer-heading,
  .footer-nav a {
    color: #000 !important;
  }

  .section {
    padding: 12pt 0 !important;
  }

  .container,
  .hero-grid,
  .legal-content article {
    width: auto !important;
    max-width: none !important;
  }

  /* Karten sollen nicht mitten durchgeschnitten werden. */
  .service-card,
  .trust-card,
  .process-step,
  .note-box,
  .lv-row,
  .contact-item {
    break-inside: avoid;
    border: 1pt solid #999 !important;
  }

  .process {
    display: block !important;
    border: 0 !important;
    background: none !important;
  }

  .process::before,
  .process-step::before {
    display: none !important;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 24pt !important;
  }

  .section-head h2,
  .cta-grid h2,
  .legal-content h2 {
    font-size: 15pt !important;
  }

  /* Ziel von Links sichtbar machen - auf Papier ist ein Link sonst wertlos.
     tel:-Nummern und interne Anker bleiben ausgespart. */
  .legal-content a:not([class])::after,
  .note-box a:not([class])::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }

  .footer-links a,
  .contact-item a {
    color: #000 !important;
    text-decoration: none !important;
  }

  .cta-panel {
    border-left: 2pt solid #000 !important;
  }

  .placeholder {
    background: none !important;
    color: #000 !important;
    border: 1pt dashed #666;
  }

  @page {
    margin: 15mm;
  }
}
