/* ============================================================
   02-BASE.CSS
   Reset + globale Defaults
   ------------------------------------------------------------
   Modernes, schlankes Reset basierend auf den Best Practices
   von Andy Bell ("Modern CSS Reset") und Josh Comeau.
   ============================================================ */


/* ────────────────────────────────────────────────────────────
   1. Box-Model: alle Elemente nutzen border-box
   ──────────────────────────────────────────────────────────── */

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


/* ────────────────────────────────────────────────────────────
   2. Standard-Margins entfernen
   ──────────────────────────────────────────────────────────── */

html,
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}


/* ────────────────────────────────────────────────────────────
   3. HTML & Body — Grundlage für alles
   ──────────────────────────────────────────────────────────── */

html {
    scroll-behavior: smooth;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--cd-font-family);
    font-weight: var(--cd-fw-medium);
    font-size: var(--cd-fs-body);
    line-height: var(--cd-lh-normal);
    color: var(--cd-color-text);
    background-color: var(--cd-color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}


/* ────────────────────────────────────────────────────────────
   4. Bilder & Medien responsive by default
   ──────────────────────────────────────────────────────────── */

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


/* ────────────────────────────────────────────────────────────
   5. Form-Elemente erben die Body-Schrift
   ──────────────────────────────────────────────────────────── */

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


/* ────────────────────────────────────────────────────────────
   6. Lesbarkeit verbessern für Headlines
   ──────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}


/* ────────────────────────────────────────────────────────────
   7. Reduzierte Animationen respektieren
   ──────────────────────────────────────────────────────────── */

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


/* ────────────────────────────────────────────────────────────
   8. Container-Helfer
   ──────────────────────────────────────────────────────────── */

.cd-container {
    width: 100%;
    max-width: var(--cd-container-max);
    margin-inline: auto;
    padding-inline: var(--cd-container-padding);
}


/* ────────────────────────────────────────────────────────────
   9. Selektion (markierter Text)
   ──────────────────────────────────────────────────────────── */

::selection {
    background-color: var(--cd-color-primary);
    color: var(--cd-color-text-on-primary);
}
