/* ═══════════════════════════════════════════════
   SHARED.CSS — Tokens, Reset, Skip-Link, Focus-Visible, Back-to-Top
   Eingebunden auf: index.html
   ═══════════════════════════════════════════════ */

/* ── WEBFONTS ────────────────────────────────── */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/open-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/merriweather.woff2') format('woff2');
}

/* ── TOKENS ──────────────────────────────────── */
:root {
  /* Konventionsnamen (siehe static-site-pattern) */
  --primary:        #2D7A2D;  /* Hauptfarbe (CTAs, Links) */
  --primary-dark:   #1A5E1A;  /* Hover-Zustand, dunkler Akzent */
  --primary-mid:    #5BAB5A;  /* Mittlerer Akzent */
  --primary-light:  #D8EDDA;
  --primary-pale:   #EEF7EE;
  --accent:         #BD3A6A;  /* Sekundär-CTA + Fokus-Outline (pink) */
  --text:           #1C2B1C;
  --text-muted:     #4A6B4A;
  --bg:             #F9F6F0;  /* cream */
  --white:          #FFFFFF;

  /* Aliase, die das alte CSS noch verwendet (Rückwärtskompat ohne weiteren Refactor) */
  --green-dark:     var(--primary-dark);
  --green-main:     var(--primary);
  --green-mid:      var(--primary-mid);
  --green-light:    var(--primary-light);
  --green-pale:     var(--primary-pale);
  --pink:           var(--accent);
  --cream:          var(--bg);
  --text-mid:       var(--text-muted);
  --muted:          var(--text-muted);

  --shadow:         0 4px 24px rgba(45,122,45,0.12);
  --shadow-lg:      0 12px 48px rgba(45,122,45,0.18);
  --radius:         14px;
  --radius-sm:      8px;

  font-size: 16px;
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
}

/* ── TYPOGRAPHY (Headings) ───────────────────── */
h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--primary-dark);
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { color: var(--text-muted); line-height: 1.75; }

/* ── SKIP LINK (WCAG 2.4.1) ──────────────────── */
.skip-link {
  position: absolute;
  top: 0; left: 0;
  background: var(--primary);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

/* ── FOCUS VISIBLE (WCAG 2.4.7) ──────────────── */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ── BACK TO TOP (UX) ────────────────────────── */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 999;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover   { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top svg     { width: 24px; height: 24px; display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .back-to-top         { transition: opacity .15s; }
  .back-to-top:hover   { transform: none; }
}
