/* ==========================================================================
   Rechtstexte und Fehlerseite (impressum.html, datenschutz.html, 404.html)
   Eigenes, kleines Stylesheet – die Seiten brauchen weder Animationen noch
   das volle css/style.css. Tokens, Header, Footer und Button entsprechen
   css/style.css.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F7F5F0;
  --ink: #1F2A33;
  --line: #2F5573;
  --line-strong: #24445C;
  --muted: #646A70;
  --hairline: #DAD5CC;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.851rem + 0.11vw, 0.9375rem);  /* 14 → 15 */
  --step-0:  clamp(1.0625rem, 1.038rem + 0.11vw, 1.125rem);  /* 17 → 18 */
  --step-2:  clamp(1.3125rem, 1.19rem + 0.54vw, 1.625rem);   /* 21 → 26 */
  --step-3:  clamp(1.875rem, 1.435rem + 1.96vw, 3rem);       /* 30 → 48 */

  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: clamp(1.25rem, 1.103rem + 0.65vw, 1.625rem);    /* 20 → 26 */
  --space-l: clamp(2rem, 1.707rem + 1.3vw, 2.75rem);         /* 32 → 44 */
  --space-xl: clamp(3rem, 2.511rem + 2.17vw, 4.25rem);       /* 48 → 68 */
  --section-gap: clamp(4.5rem, 3.326rem + 5.22vw, 7.5rem);  /* 72 → 120 */

  --gutter: clamp(1.25rem, 0.565rem + 3.04vw, 3rem);         /* 20 → 48 */
  --max: 75rem;
  --measure: 36rem;                                          /* ca. 65–70 Zeichen je Zeile */
  --header-h: 3.75rem;

  --rule: 1px;
  --radius-pill: 999px;
}

@media (min-width: 56.25em) {
  :root {
    --header-h: 4.5rem;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}

h1,
h2,
p,
li {
  /* Keine automatische Silbentrennung (wie auf der Startseite); lange Wörter
     brechen im Notfall trotzdem um, statt über den Rand zu laufen. */
  overflow-wrap: break-word;
}

p,
ul {
  margin: 0;
}

p,
li {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

a {
  color: var(--line);
  text-decoration-thickness: var(--rule);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--line-strong);
}

:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

::selection {
  background: var(--line);
  color: var(--paper);
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nowrap {
  white-space: nowrap;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--gutter);
  z-index: 100;
  padding: var(--space-2xs) var(--space-s);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   Header: Name wie auf der Startseite, rechts Pillen-Link zurück
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: var(--rule) solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  height: var(--header-h);
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  line-height: 1.15;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 500;
}

.brand__role {
  color: var(--muted);
  font-size: 0.8125rem;
}

.back {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding-inline: 0.875rem 1.125rem;
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--line);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

/* Trefferfläche ≥ 44px */
.back::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
}

.back:hover {
  background: color-mix(in srgb, var(--line) 7%, transparent);
  color: var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .back {
    transition: background-color 0.2s ease;
  }
}

/* --------------------------------------------------------------------------
   Text: eine Spalte mit angenehmer Zeilenlänge, Abschnitte durch feine Linien
   -------------------------------------------------------------------------- */
.legal {
  padding-block: var(--space-xl) var(--section-gap);
}

.legal__text {
  max-width: var(--measure);
}

.legal h1 {
  margin-bottom: var(--space-l);
  font-size: var(--step-3);
}

.legal__section {
  padding-top: var(--space-m);
  border-top: var(--rule) solid var(--hairline);
}

.legal__section + .legal__section {
  margin-top: var(--space-l);
}

.legal h2 {
  margin-bottom: var(--space-xs);
  font-size: var(--step-2);
}

.legal p + p,
.legal p + ul,
.legal ul + p {
  margin-top: var(--space-s);
}

.legal ul {
  padding-left: 1.25em;
}

.legal li + li {
  margin-top: var(--space-2xs);
}

.legal li::marker {
  color: var(--line);
}

/* Lange URLs dürfen an jeder Stelle umbrechen */
.legal__url {
  overflow-wrap: anywhere;
}

.legal__date {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: var(--rule) solid var(--hairline);
  color: var(--muted);
  font-size: var(--step--1);
}

/* --------------------------------------------------------------------------
   Fehlerseite (404.html) – Button wie .btn--primary auf der Startseite
   -------------------------------------------------------------------------- */
.notfound__code {
  margin-bottom: var(--space-s);
  color: var(--line);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.legal p.notfound__actions {
  margin-top: var(--space-l);
  padding-top: var(--space-l);
  border-top: var(--rule) solid var(--hairline);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--line);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--line-strong);
  border-color: var(--line-strong);
  color: var(--paper);
}

@media (min-width: 37.5em) {
  .btn {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
}

/* --------------------------------------------------------------------------
   Footer (wie auf der Startseite)
   -------------------------------------------------------------------------- */
.site-footer {
  padding-block: var(--space-l);
  border-top: var(--rule) solid var(--hairline);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--line);
}

/* Mobil: Copyright und Rechtslinks in zwei Zeilen, ab Tablet in einer */
.site-footer__copy,
.site-footer__links {
  display: block;
}

.site-footer__sep {
  display: none;
}

@media (min-width: 37.5em) {
  .site-footer__copy,
  .site-footer__links,
  .site-footer__sep {
    display: inline;
  }
}
