/* ===================================================================
   Klinik Dr. Herter – Base
   Reset, Schrifteinbindung, Typografie, Layout-Primitive
   =================================================================== */

/* -------------------------------------------------------------------
   SCHRIFTEN – lokal eingebunden (DSGVO: kein Google-Fonts-Abruf)
   woff2-Dateien nach /assets/fonts/ legen, Namen siehe README
   ------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-variable.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------
   RESET
   ------------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Die Kopfleiste bleibt beim Scrollen oben stehen (position: sticky) und
     verdeckte sonst die Oberkante jedes Sprungziels – beim Terminbutton
     landete die Ueberschrift "Nehmen Sie Kontakt mit uns auf" genau unter
     der Leiste. --header-h waechst ab 1024 px mit, der Abstand also auch. */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--c-text-body);
  background: var(--c-bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* -------------------------------------------------------------------
   TYPOGRAFIE
   ------------------------------------------------------------------- */

h1, h2, h3, h4 {
  color: var(--c-text);
  text-wrap: balance;

  /* Deutsche Komposita wie "Schamlippenverkleinerung" haben keine
     Bruchstelle und sprengten bei 320 px die Spalte um 5 px. Die
     Silbentrennung greift ueber lang="de" am <html>; der harte
     Umbruch bleibt der letzte Ausweg. Dieselbe Absicherung traegt
     .hero__titel schon laenger. */
  hyphens: auto;
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: var(--fw-regular);   /* Figma: Newsreader Regular */
  line-height: var(--lh-tight);
  letter-spacing: 0;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

p { text-wrap: pretty; }

p + p { margin-top: var(--sp-4); }

/* Fliesstext-Bloecke auf Lesebreite begrenzen */
.prose { max-width: var(--container-text); }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }

.lead {
  font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
  line-height: 1.55;
  color: var(--c-text-body);
}

.eyebrow {
  font-size: var(--fs-xsmall);
  font-weight: var(--fw-bold);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primary);
}

.text-secondary { color: var(--c-text-secondary); }
.text-small     { font-size: var(--fs-small); }

/* -------------------------------------------------------------------
   LINKS
   ------------------------------------------------------------------- */

a {
  color: var(--c-link);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: color var(--dur-fast) var(--ease);
}
a:hover  { color: var(--c-link-hover); }
a:visited { color: var(--c-link-visited); }

/* Navigation erbt ihre Farbe. Buttons regeln ihre Farben selbst
   (siehe components.css) – hier bewusst keine .btn:visited-Regel,
   sie wuerde die Variantenfarben ueberschreiben. */
nav a { color: inherit; }
nav a:visited { color: inherit; }

/* -------------------------------------------------------------------
   FOKUS – durchgehend sichtbar (EU-Barrierefreiheit ab 28.06.2025)
   ------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: calc(-1 * var(--sp-12));
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-primary);
  color: var(--c-text-inverse);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); color: var(--c-text-inverse); }

/* -------------------------------------------------------------------
   LAYOUT
   ------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* 60:30:10 – Flaechenverteilung */
.section--page  { background: var(--c-bg-page); }
.section--white { background: var(--c-bg-card); }
.section--sand  { background: var(--c-bg-alt); }
.section--sage  { background: var(--c-sage-light); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid {
  display: grid;
  gap: var(--sp-5);
}
@media (min-width: 640px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

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