/* ==========================================================================
   BM GENERALBAU – Reset / Basis
   Moderner, minimaler Reset. Bewusst konservativ: setzt nur zurück, was
   sonst in jedem Browser abweicht, und definiert die Grundtypografie.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky-Header-Höhe beim Ankersprung freihalten */
  scroll-padding-top: calc(var(--header-h) + var(--sp-lg));
}

body {
  margin: 0;
  background-color: var(--c-stone);
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Scroll sperren, wenn Offcanvas offen ist */
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-md);
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--c-slate-deep);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p { margin: 0 0 var(--sp-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-bronze-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--c-slate-deep); }

ul, ol { margin: 0 0 var(--sp-md); padding-left: 1.25rem; }
li { margin-bottom: var(--sp-2xs); }
li:last-child { margin-bottom: 0; }

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

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

button { cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

strong, b { font-weight: 600; }

abbr[title] { text-decoration: none; border-bottom: 1px dotted currentColor; cursor: help; }

hr {
  border: 0;
  border-top: var(--hairline) solid var(--c-border);
  margin: var(--sp-xl) 0;
}

blockquote { margin: 0 0 var(--sp-md); }

address { font-style: normal; }

/* ── Fokus: immer sichtbar, nie wegoptimiert ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}
/* Mausklicks bekommen keinen Ring, Tastatur schon */
:focus:not(:focus-visible) { outline: none; }

/* ── Nur für Screenreader ──────────────────────────────────────────────── */
.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 ─────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-md);
  z-index: var(--z-skiplink);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--c-slate-deep);
  color: var(--c-white);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  top: var(--sp-md);
  color: var(--c-white);
}

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

/* ── Druck ─────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .mobile-cta, .offcanvas, .to-top { display: none !important; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
