/* ============================================================
 * BASE — Reset, Typografie, Layout-Primitives
 * ============================================================ */

/* ─── Reset ─────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  /* Schwebender Mobile-CTA bekommt unten Platz, damit nichts dahinter rutscht */
  scroll-padding-bottom: var(--mobile-cta-clear, 0);
}

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

body {
  background: var(--c-bg-canvas);
  color: var(--c-text-high);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

/* Default fill für Icons, ABER fill="none" im Markup gewinnt */
svg:not([fill]) { fill: currentColor; }
svg[fill="none"] { fill: none; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-base) var(--ease-out);
}

a:hover { color: var(--c-accent); }

ul, ol { list-style: none; }


/* ─── Typografie ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  color: var(--c-text-high);
  text-wrap: balance;
}

/* Karmin-Punkt hinter Headlines — sitewide.
 * Display-Headlines tragen letter-spacing: -0.025em (Tight-Tracking),
 * das frisst auch den Abstand zum ::after-Punkt. Wir kompensieren
 * mit einem festen kleinen Margin und neutralisieren das Tracking
 * via display: inline-block, sodass der Abstand zur letzten Letter
 * unabhängig vom Tracking konstant bleibt. */
h1:not(.no-dot)::after,
h2:not(.no-dot)::after,
h3:not(.no-dot)::after {
  content: '.';
  color: var(--c-accent);
  display: inline-block;
  margin-left: 0.02em;
  letter-spacing: 0;
  font-weight: inherit;
}

/* Ausschlüsse: label-artige Überschriften ohne Punkt */
.hero__headline::after,
.site-footer__h::after,
.is-eyebrow::after,
.memberships__headline::after,
.sr-only::after {
  content: none !important;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--tracking-snug);
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: var(--tracking-snug);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
  max-width: 70ch;
}

p + p { margin-top: 1em; }

strong, b { font-weight: var(--fw-semi); }

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

/* Eigene Klassen für die zwei "Sonderfälle" */

.is-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--c-text-high);
  text-wrap: balance;
}

.is-eyebrow {
  display: inline-block;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-accent);
}

.is-lead {
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  line-height: var(--lh-relaxed);
  color: var(--c-text-mid);
  max-width: 60ch;
}


/* ─── Fokus — sichtbar, ohne UI-Bruch ─────────────────── */

:focus { outline: none; }

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

/* Bei Glas-Buttons/Links die offset-Outline statt outline */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 3px;
}


/* ─── Selection ───────────────────────────────────────── */

::selection {
  background: var(--c-accent);
  color: var(--c-text-on-accent);
}


/* ─── Layout-Primitives ──────────────────────────────── */

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

.container--narrow {
  max-width: var(--container-narrow);
}

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

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

/* Skip-Link für Screenreader */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-4);
  background: var(--c-bg-elevated);
  color: var(--c-text-high);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  transform: translateY(-200%);
  transition: transform var(--t-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--c-text-high);
}


/* Screen-reader-only */
.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;
}


/* ─── Body-Puffer für Mobile-CTA ────────────────────── */
/* Auf Mobil: unterer Padding-Puffer am Footer, damit der schwebende
   "Jetzt anrufen"-Button keinen Footer-Inhalt verdeckt. */

@media (max-width: 1023px) {
  body.has-mobile-cta .site-footer {
    padding-bottom: var(--mobile-cta-clear);
  }
}
