/**
 * base.css — Design-Tokens, Reset und globale Typografie
 *
 * Alle CSS Custom Properties (Variablen) sind hier zentral definiert.
 * Das macht es einfach, das gesamte Design durch Änderung weniger Werte
 * anzupassen (z.B. Markenfarben, Abstände, Schriften).
 *
 * Struktur:
 * 1. CSS Custom Properties (Design-Tokens)
 * 2. Moderner CSS-Reset
 * 3. Basis-Typografie
 * 4. Hilfswerkzeuge / Utilities
 */

/* ============================================================
   1. DESIGN-TOKENS — Alle Designvariablen zentral an einem Ort
   ============================================================ */
:root {
    /* --- Farben: Markenidentität --- */
    --color-primary:        #2D7A4F;   /* Hauptgrün — Wachstum, Natur */
    --color-primary-dark:   #1E5C3A;   /* Dunkleres Grün für Hover-Zustände */
    --color-primary-light:  #4CAF75;   /* Helles Grün für Akzente */
    --color-accent:         #7BC67E;   /* Sanftes Grün für Hintergründe */

    --color-secondary:      #1A2E1A;   /* Fast Schwarz-Grün für Texte */
    --color-text:           #2C3E2D;   /* Standard-Textfarbe */
    --color-text-muted:     #6B7F6C;   /* Abgedunkelter Text für Untertitel */
    --color-text-light:     #A8B8A9;   /* Heller Text auf dunklen Flächen */

    --color-bg:             #FFFFFF;   /* Seitenhintergrund */
    --color-bg-subtle:      #F4F8F4;   /* Leicht getönter Hintergrund für Sektionen */
    --color-bg-dark:        #1A2E1A;   /* Dunkler Hintergrund (Footer, Hero) */

    --color-border:         #D4E6D4;   /* Rahmenfarbe */
    --color-border-strong:  #A8C8A8;   /* Starke Rahmenfarbe */

    --color-success:        #28A745;
    --color-warning:        #FFC107;
    --color-error:          #DC3545;

    /* --- Typografie --- */
    --font-heading: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Schriftgrößen — skalierend mit clamp() für responsive Typografie */
    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  clamp(1.75rem, 3vw, 2rem);
    --text-4xl:  clamp(2rem, 4vw, 2.75rem);
    --text-5xl:  clamp(2.5rem, 5vw, 3.5rem);
    --text-hero: clamp(2.75rem, 6vw, 4.5rem);

    /* Zeilenhöhen */
    --leading-tight:  1.2;
    --leading-snug:   1.35;
    --leading-normal: 1.6;
    --leading-loose:  1.8;

    /* Schriftstärken */
    --weight-regular: 400;
    --weight-medium:  500;
    --weight-semibold:600;
    --weight-bold:    700;
    --weight-black:   900;

    /* --- Abstände (8-Punkte-Rastersystem) --- */
    --space-1:   0.25rem;   /* 4px */
    --space-2:   0.5rem;    /* 8px */
    --space-3:   0.75rem;   /* 12px */
    --space-4:   1rem;      /* 16px */
    --space-5:   1.25rem;   /* 20px */
    --space-6:   1.5rem;    /* 24px */
    --space-8:   2rem;      /* 32px */
    --space-10:  2.5rem;    /* 40px */
    --space-12:  3rem;      /* 48px */
    --space-16:  4rem;      /* 64px */
    --space-20:  5rem;      /* 80px */
    --space-24:  6rem;      /* 96px */
    --space-32:  8rem;      /* 128px */

    /* --- Layout --- */
    --container-sm:  640px;
    --container-md:  768px;
    --container-lg:  1024px;
    --container-xl:  1280px;
    --container-2xl: 1440px;
    --container-pad: clamp(1rem, 5vw, 2rem);   /* Seitenabstand */

    /* --- Eckenradius --- */
    --radius-sm:   0.25rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-2xl:  1.5rem;
    --radius-full: 9999px;

    /* --- Schatten --- */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-xl:  0 20px 50px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
    --shadow-glow:0 0 30px rgba(45, 122, 79, 0.25);

    /* --- Übergänge / Animationen --- */
    --transition-fast:   150ms ease;
    --transition-base:   250ms ease;
    --transition-slow:   400ms ease;
    --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Navigation --- */
    --nav-height: 72px;
}


/* ============================================================
   2. CSS-RESET — Browserunterschiede normalisieren
   ============================================================ */

/* Box-Sizing global setzen: padding/border werden in die Breite eingerechnet */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* HTML & Body: Basisschrift, Rendering-Optimierungen */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;  /* Verhindert ungewollte Textvergrößerung auf iOS */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;  /* Verhindert horizontales Scrollen durch Overflow */
}

/* Listen ohne Styling (werden meist per Klasse gestylt) */
ul, ol {
    list-style: none;
}

/* Bilder und Medien: responsive by default */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* Formulare: Schrift aus dem Elternelement übernehmen */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

/* Absätze und Überschriften: keine unnötigen Margins */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;  /* Verhindert Überlauf bei langen Wörtern */
}

/* Links: kein Standard-Underline, Farbe übernehmen */
a {
    color: inherit;
    text-decoration: none;
}

/* Buttons: reset */
button {
    cursor: pointer;
    background: none;
    border: none;
}


/* ============================================================
   3. BASIS-TYPOGRAFIE — Globale Textstile
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--color-secondary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    line-height: var(--leading-normal);
    color: var(--color-text);
}

/* Basis-Link-Stil (mit Farbe, wenn im Fließtext) */
.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}
.prose a:hover {
    color: var(--color-primary-dark);
}


/* ============================================================
   4. UTILITIES — Wiederverwendbare Hilfsklassen
   ============================================================ */

/* Screenreader-only: sichtbar nur für Hilfstechnologien */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Textausrichtung */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* Textfarben */
.text-muted   { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-light   { color: var(--color-text-light); }

/* Fettschrift-Abstufungen */
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

/* Display-Wechsel */
.hidden  { display: none; }
.block   { display: block; }
.flex    { display: flex; }

/* Abstands-Utilities */
.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }
