/* Grundlagen: Design-Tokens, Reset, Typografie, Fokus, Hilfsklassen */

:root {
  /* Farben */
  --c-forest: #2f4a36;
  --c-forest-deep: #1f3325;
  --c-sage: #6f8b6a;
  --c-sage-300: #b9cbb2;
  --c-sage-200: #dbe5d6;
  --c-sage-100: #eef3ea;
  --c-bg: #f6f1e6;
  --c-surface: #fffcf5;
  --c-cream: #fbf6ea;
  --c-sand: #ece2cd;
  --c-sand-300: #d8c7a5;
  --c-wood: #7f5631;
  --c-text: #2a2a24;
  --c-muted: #57534a;
  --c-border: #ddd2bb;
  --c-focus: #b0501a;
  --c-danger: #9b2c1f;
  --c-danger-bg: #fbe9e5;
  --c-warning: #7a4f0a;
  --c-warning-bg: #fbf0d6;
  --c-warning-border: #d6a444;
  --c-success: #2f6b3a;
  --c-on-dark: #fffcf5;

  /* Schrift */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --fs-body: clamp(1rem, 0.973rem + 0.119vw, 1.0625rem);
  --fs-small: clamp(0.875rem, 0.848rem + 0.119vw, 0.9375rem);
  --fs-h1: clamp(1.75rem, 1.321rem + 1.905vw, 2.75rem);
  --fs-h2: clamp(1.375rem, 1.161rem + 0.952vw, 1.875rem);
  --fs-h3: clamp(1.125rem, 1.018rem + 0.476vw, 1.375rem);
  --fs-cook: clamp(1.375rem, 1rem + 1.667vw, 2.25rem);
  --lh-body: 1.55;
  --lh-tight: 1.2;

  /* Abstände (fließend) */
  --space-2xs: clamp(0.25rem, 0.196rem + 0.238vw, 0.375rem);
  --space-xs: clamp(0.5rem, 0.393rem + 0.476vw, 0.75rem);
  --space-s: clamp(0.75rem, 0.643rem + 0.476vw, 1rem);
  --space-m: clamp(1rem, 0.786rem + 0.952vw, 1.5rem);
  --space-l: clamp(1.5rem, 1.071rem + 1.905vw, 2.5rem);
  --space-xl: clamp(2rem, 1.143rem + 3.81vw, 4rem);
  --page-padding-x: clamp(1rem, 0.357rem + 2.857vw, 2.5rem);
  --gap-columns: clamp(1rem, 0.571rem + 1.905vw, 2rem);

  /* Formen */
  --radius-s: 0.375rem;
  --radius: 0.75rem;
  --radius-l: 1.25rem;
  --shadow: 0 1px 2px rgb(47 74 54 / 0.08), 0 4px 14px rgb(47 74 54 / 0.07);
  --content-max: 76rem;
  --nav-height: 4.25rem;
  --tap: 2.75rem;
}

/* Kontrastmodus */
:root[data-kontrast="hoch"] {
  --c-forest: #10261a;
  --c-forest-deep: #000;
  --c-sage: #1f4a2a;
  --c-sage-300: #4d6b52;
  --c-sage-200: #e4ece0;
  --c-sage-100: #f3f7f1;
  --c-bg: #fff;
  --c-surface: #fff;
  --c-cream: #fff;
  --c-sand: #f1eadb;
  --c-sand-300: #6b5a3a;
  --c-wood: #4f3216;
  --c-text: #000;
  --c-muted: #1f1f1f;
  --c-border: #3a3a3a;
  --c-focus: #b33c00;
  --shadow: none;
}

/* Schriftgröße */
:root[data-schrift="gross"] { font-size: 112.5%; }
:root[data-schrift="sehr-gross"] { font-size: 125%; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block: var(--space-l);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

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

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

p, ul, ol { margin-block: 0 1em; }

h1, h2, h3, h4 {
  margin-block: 0 0.6em;
  line-height: var(--lh-tight);
  color: var(--c-forest);
  text-wrap: balance;
}

h1 { font-family: var(--font-serif); font-size: var(--fs-h1); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-family: var(--font-serif); font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 650; }

a { color: var(--c-forest); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--c-forest-deep); text-decoration-thickness: 0.14em; }

strong { font-weight: 650; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

/* Fokus */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

/* Überschriften und Bereiche, die per Skript den Fokus erhalten, ohne Rahmen */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

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

.skip-link {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--c-forest);
  color: var(--c-on-dark);
  border-radius: var(--radius-s);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--c-on-dark); }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.small-print { font-size: var(--fs-small); color: var(--c-muted); }

.plain-list { list-style: none; padding: 0; }
.plain-list > li + li { margin-block-start: 0.5em; }

@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;
  }
}
