/* ==========================================================================
   GEMEC – Grundlagen: Reset, Schrift, Fokus, Fliesstext
   ========================================================================== */

/* Inter wird selbst ausgeliefert. Keine Einbindung ueber Google Fonts:
   dabei wird die IP der Besucher an Google uebertragen, was das LG Muenchen I
   (Urteil vom 20.01.2022, 3 O 17493/20) als Datenschutzverstoss gewertet hat. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* Verhindert die 300-ms-Verzoegerung beim Antippen auf Touchgeraeten */
  touch-action: manipulation;
  /* Standard-Blaufleck beim Antippen abschalten; sichtbares Feedback
     kommt aus den :hover- und :active-Zustaenden der Komponenten. */
  -webkit-tap-highlight-color: transparent;
  /* Lange Woerter brechen notfalls um, statt seitwaerts aus dem Bild zu
     laufen. Vererbt sich in Fliesstext, Listen und Tabellenzellen.
     Deutsche Komposita und E-Mail-Adressen sind hier der Regelfall. */
  overflow-wrap: break-word;
}

/* Sprungziele nicht unter den fixierten Kopfbereich rutschen lassen.
   Der Kopf ist 4,5rem hoch, dazu etwas Luft. */
:target,
[id] {
  scroll-margin-top: 5.5rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-s);
  color: var(--navy-800);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.018em;
  text-wrap: balance;
  /* Deutsche Komposita wie "Baunebenleistungen" passen in einer schmalen
     Kartenspalte nicht in eine Zeile. Mit lang="de" trennt der Browser nach
     Silben; ohne das greift der harte Umbruch aus dem body und zerlegt das
     Wort an beliebiger Stelle. */
  hyphens: auto;
}

h1 {
  font-size: var(--step-5);
  letter-spacing: -0.028em;
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
  font-weight: 600;
}
h4 {
  font-size: var(--step-0);
  font-weight: 650;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-s);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--blue-500);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--blue-400);
}

strong {
  font-weight: 650;
}

/* Browser stellen <address> kursiv dar. Die Seite nutzt das Element fuer
   Anschriften im Fuss, auf der Kontaktseite und in der Anfahrt – ueberall
   aufrecht. Stand bisher 14x als Inline-Style im Markup. */
address {
  font-style: normal;
}

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

/* <picture> ist hier immer nur eine Huelle um ein <img>, damit der Browser
   die WebP-Fassung waehlen kann. Mit display: contents faellt die Huelle aus
   dem Layout heraus und das Bild verhaelt sich genau wie ein einzelnes <img>.
   Ohne diese Zeile wuerde das Buehnenbild eine eigene Zeile im Raster
   belegen und die Bilder in .split die Spaltenaufteilung verschieben. */
picture {
  display: contents;
}

/* <source> traegt nur die WebP-Kandidaten und stellt selbst nichts dar. Weil
   die Huelle oben aus dem Layout faellt, wuerde es im Rasterkontext zu einem
   eigenen Rasterelement blockifiziert: In .split sass es unsichtbar zwischen
   Textspalte und Bild und schob das Bild eine Spalte weiter. Die Auswahl der
   Bildfassung laeuft ueber das DOM und bleibt davon unberuehrt. */
picture > source {
  display: none;
}

/* Sichtbarer Fokus ueberall. :focus-visible zeigt den Ring nur bei
   Tastaturbedienung, nicht bei Mausklick. */
:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Fallback fuer Browser ohne :focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

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

hr {
  height: 1px;
  margin: var(--space-l) 0;
  border: 0;
  background: var(--steel-300);
}

/* --- Hilfsklassen --- */

.nur-fuer-screenreader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprungmarke {
  position: absolute;
  top: 0;
  left: var(--space-s);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-s);
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  transform: translateY(-110%);
  transition: transform var(--transition);
}

.sprungmarke:focus {
  color: var(--white);
  transform: translateY(0);
}
