/* ==========================================================================
   mueller-wohnart.de — base.css
   Reset, Design-Tokens, Typografie, Utilities
   Quelle der Wahrheit für das Design: ../../DESIGN.md
   ====================================================================== */

/* --------------------------------------------------------------------------
   1. Design-Tokens (DESIGN.md §1, 1:1 übernommen)
   -------------------------------------------------------------------------- */
:root {
  /* Farben (DESIGN.md §1.1) */
  --color-primary: #13401a;        /* dunkles Waldgrün: Buttons, Akzente */
  --color-primary-hover: #21391e;
  --color-wood: #a67658;           /* warme Holz-Akzente */
  --color-wood-deep: #7c4f35;     /* 10.2: kleine Text-Akzente auf hellem Grund (≥4.5:1) */
  --color-wood-light: #e9d6c5;    /* 10.2: kleine Text-Akzente auf --color-footer (≥4.5:1) */
  --color-text: #444444;
  --color-text-inverse: #ffffff;
  --color-bg: #ffffff;
  --color-bg-muted: #f5f5f5;
  --color-footer: #13401a;

  /* Typografie (DESIGN.md §1.2) */
  --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; /* keine Webfonts */
  --font-size-body: 13px;
  --lh-body: 1.65em;
  --font-size-h1-hero: 50px;
  --font-size-hero-sub: 20px;
  --font-size-h2-section: 40px;    /* mobile: 0.8em (siehe Media Query unten) */
  --font-size-tag: 25px;
  --font-size-subheading: 15px;
  --heading-weight: 600;           /* DESIGN.md §1.2: 400–700 */

  /* Shape & Bilder (DESIGN.md §1.3) */
  --radius: 0;                     /* alle Kanten rechtwinklig */
  --section-pad: 50px;
  --img-shadow: none;

  /* Motion (DESIGN.md §1.4) */
  --transition: all 0.4s ease-in-out;
  --hero-anim: slide_up;
  --hero-interval: 8s;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 20px;
}

/* --------------------------------------------------------------------------
   2. Moderner CSS-Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

img,
picture,
video,
svg {
  max-width: 100%;
  display: block;
  box-shadow: var(--img-shadow);
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  border-radius: 0; /* Constraint DESIGN.md §7: keine abgerundeten Kanten */
}

button {
  cursor: pointer;
}

/* Barrierefreiheit: sichtbarer Focus (DESIGN.md §7: WCAG-AA) */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Globale Typografie (mobile-first)
   -------------------------------------------------------------------------- */
body {
  /* 16px anstatt des DESIGN-Tokens (13px) für Lesbarkeit moderner Sites –
     Tokens in :root bleiben unverändert. */
  font-family: var(--font-family);
  font-size: max(var(--font-size-body), 16px);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-family);
  font-weight: var(--heading-weight);
  line-height: 1.2;
  color: var(--color-text);
}

/* Sektions-Headline nach DESIGN.md: 40px Desktop, 0.8em mobil */
h2,
.h2-section {
  font-size: calc(var(--font-size-h2-section) * 0.8); /* mobile-first */
}

h3 {
  font-size: 22px;
}

h4 {
  font-size: var(--font-size-subheading);
}

/* Sektions-Tag/Label oberhalb der Headline (DESIGN.md §1.2) */
.tag {
  font-size: var(--font-size-tag);
  font-weight: 400;
  color: var(--color-wood);
}

p {
  margin-block: 0.75em 0;
}

/* --------------------------------------------------------------------------
   4. Utilities
   -------------------------------------------------------------------------- */

/* .container – zentrierter, begrenzter Inhalt */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* .section – luftige vertikale Rhythmisierung */
.section {
  padding-block: var(--section-pad);
}

.section-muted {
  background: var(--color-bg-muted);
}

/* .btn – flach, rechtwinklig, min. 44×44px Touch-Target (DESIGN.md §3.1, §7) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-width: 44px;
  min-height: 44px;
  padding: 0.6em 1.6em;
  font-family: var(--font-family);
  font-size: var(--font-size-subheading);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* .divider – warmer Holz-Akzent als Trennlinie (DESIGN.md §1.1) */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-wood);
  border: none;
  margin-block: 0.5em 1.5em;
  border-radius: var(--radius);
}

/* Grid-/Flex-Grundlagen (DESIGN.md §3.3: mobile 1 Spalte, mobile-first) */
.grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 30px;
}

.flex {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
}

/* Screen-reader-only (Barrierefreiheit) */
.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;
}

/* --------------------------------------------------------------------------
   5. Breitenbasierte Media Queries (mobile-first, ab hier Desktop-Korrektur)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  h2,
  .h2-section {
    font-size: var(--font-size-h2-section);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
