/* ==========================================================================
   Gerhard GmbH – Basis: Reset, Typografie, Links, Formulare, Hilfsklassen
   Werte ausschließlich aus tokens.css (docs/styleguide.md)
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-s));
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-inline-size: 100%; block-size: auto; }
figure { margin: 0; }

/* ---------- Überschriften ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: var(--weight-head);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-head);
  color: var(--color-heading);
  hyphens: auto;
  overflow-wrap: break-word;
  hyphenate-limit-chars: 12 6 6;   /* keine Trennungen wie „Meis-terbetrieb“ */
  text-wrap: balance;
  margin: 0 0 var(--space-s);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); }

p, li { max-width: var(--measure); text-wrap: pretty; }
p, ul, ol, dl { margin: 0 0 var(--stack); }
:where(p, ul, ol):last-child { margin-bottom: 0; }
strong, b { font-weight: var(--weight-bold); }
small { font-size: var(--step--1); }

/* ---------- Links ---------- */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--color-link-hover); }

:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* ---------- Fließtext-Abstände in Rich-Text ---------- */
.rte > * + h2 { margin-top: var(--space-l); }
.rte > * + h3 { margin-top: var(--space-m); }

/* Listen im Fließtext: Flammenzunge (Motivtyp B) */
.rte ul,
.content-list:not(.steps, .trust-strip, .timeline, .link-list) ul {
  list-style: none;
  padding: 0;
}
.rte ul > li,
.content-list:not(.steps, .trust-strip, .timeline, .link-list) ul > li {
  position: relative;
  padding-left: calc(var(--motiv-bullet-w) + var(--space-xs));
  margin-bottom: var(--space-2xs);
}
.rte ul > li::before,
.content-list:not(.steps, .trust-strip, .timeline, .link-list) ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  inline-size: var(--motiv-bullet-w);
  block-size: var(--motiv-bullet-h);
  background-color: var(--color-motiv);
  -webkit-mask: var(--motiv-flammenzunge) no-repeat center / contain;
          mask: var(--motiv-flammenzunge) no-repeat center / contain;
}

/* ---------- Formulare (Grundlage) ---------- */
input, select, textarea, button { font: inherit; color: inherit; }

/* ---------- Hilfsklassen ---------- */
.invisible,
.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100%;
  z-index: 100;
  padding: var(--space-xs) var(--space-s);
  background: var(--color-dark);
  color: var(--color-on-dark);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-s); outline-color: var(--color-focus-on-dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
