/* ==========================================================================
   Kernholz – Basis: Reset, Typografie, Links, Fokus, Hilfsklassen
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Sprungziele nicht unter dem klebenden Kopf verstecken */
  scroll-padding-top: calc(var(--hauptleiste-h) + var(--s-4));
}

body {
  margin: 0;
  background: var(--farbe-grund);
  color: var(--farbe-text);
  font-family: var(--schrift-text);
  font-size: var(--fs-m);
  font-weight: var(--gewicht-normal);
  line-height: var(--zh-text);
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 10 4 4; /* nur lange Wörter trennen */
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--farbe-ueberschrift);
  font-weight: var(--gewicht-kraeftig);
  line-height: var(--zh-eng);
  letter-spacing: var(--sperrung-titel);
  hyphens: manual;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
}

h2 {
  font-size: var(--fs-2xl);
}

h3 {
  font-size: var(--fs-l);
  line-height: var(--zh-mittel);
}

h4 {
  font-size: var(--fs-m);
  line-height: var(--zh-mittel);
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding: 0;
}

strong {
  font-weight: var(--gewicht-kraeftig);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dauer-kurz) var(--kurve), text-decoration-color var(--dauer-kurz) var(--kurve);
}

a:hover {
  color: var(--farbe-akzent-text);
}

/* Fließtext-Links deutlich, aber ruhig */
.fliesstext a,
.text-link {
  color: var(--c-nacht-700);
  text-decoration-color: var(--farbe-akzent);
  text-decoration-thickness: 2px;
}

.fliesstext a:hover,
.text-link:hover {
  color: var(--farbe-akzent-text);
}

/* Sichtbarer, kontrastreicher Fokus – überall gleich */
:focus-visible {
  outline: var(--linie-dick) solid var(--farbe-fokus);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--c-ocker-100);
  color: var(--c-nacht-900);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

address {
  font-style: normal;
}

abbr[title] {
  text-decoration: none;
}

hr {
  border: 0;
  border-top: var(--linie) solid var(--farbe-linie);
  margin: var(--s-6) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Kennzahlen und Maße immer mit gleich breiten Ziffern */
.zahl,
time,
td {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Sprunglink */
.sprunglink {
  position: absolute;
  left: var(--s-4);
  top: var(--s-2);
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--c-ocker-500);
  color: var(--c-nacht-950);
  font-weight: var(--gewicht-kraeftig);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dauer) var(--kurve);
}

.sprunglink:focus-visible {
  transform: translateY(0);
  outline-color: var(--c-nacht-950);
}

/* Nur für Screenreader */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* Bewegung reduzieren, wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
