/* ==========================================================================
   MakerToolHub – Basis: Reset, Typografie, Fokus, Reduced Motion
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollen sperren, solange der Branchen-Dialog offen ist */
body:has(dialog[open]) {
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  color: var(--green-900);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); letter-spacing: -0.025em; line-height: 1.08; }
h2 { font-size: var(--text-h2); letter-spacing: -0.02em; }
h3 { font-size: var(--text-h3); }

p {
  margin: 0 0 var(--space-4);
}

ul, ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--green-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-900);
}

img, svg, video {
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

figure {
  margin: 0;
}

blockquote {
  margin: 0;
}

dl, dd {
  margin: 0;
}

small {
  font-size: var(--text-xs);
}

[hidden] {
  display: none !important;
}

/* Sichtbarer Fokus für Tastaturbedienung */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip-Link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--green-800);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--white);
}

/* Nur für Screenreader sichtbar */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Weniger Bewegung */
@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;
  }
}