/* Base / Reset – gilt für alle Seiten */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Sicherheitsnetz fuer die Icon-Sprite-SVGs (<svg><use .../></svg>, siehe
   td_icon() in inc/icons.php): ohne eigene width/height-Attribute wuerden
   Browser sie sonst auf ihre SVG-Default-Groesse (oft 300x150px) aufblasen,
   sobald ein Container-Kontext die Groesse mal nicht explizit setzt.
   Spezifischere Selektoren (z. B. .card__icon svg) ueberschreiben dies wie
   gewohnt dank hoeherer CSS-Spezifitaet. */
svg {
  width: 1.2em;
  height: 1.2em;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--lh-tight);
  color: var(--color-text);
  margin: 0;
  /* Lange deutsche Komposita (z. B. "Wasserschadensanierung") sollen umbrechen
     statt am Container-Rand abgeschnitten zu werden. Bewusst ohne automatische
     Silbentrennung (hyphens: auto) – die trennt sonst auch kurze Wörter wie
     "Projekt" an ungünstigen Stellen in Headlines. */
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip-Link für Tastatur-/Screenreader-Nutzung */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  background: var(--color-white);
  color: var(--color-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--space-4);
}

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

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-10);
}

@media (max-width: 767px) {
  .section {
    padding-block: var(--space-8);
  }
}

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

.section--dark {
  background: var(--color-navy-900);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--color-text-on-dark);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section--dark .eyebrow {
  color: #7fb3e0;
}

.eyebrow::after {
  content: "";
  width: 40px;
  height: 2px;
  background: currentColor;
  opacity: 0.6;
  display: inline-block;
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--color-text-muted);
}

.section--dark .lead {
  color: var(--color-text-on-dark-muted);
}

.text-muted {
  color: var(--color-text-muted);
}

.accent {
  color: var(--color-primary);
}

.rule {
  width: 56px;
  height: 3px;
  background: var(--color-primary);
  border: none;
  margin: var(--space-5) 0;
  border-radius: var(--radius-pill);
}

/* Grids */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1023px) {
  .grid-4,
  .grid-5,
  .grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-6 {
    grid-template-columns: 1fr;
  }
}

.visually-hidden-mobile {
  display: initial;
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}
