/* ==========================================================================
   Basis — Reset, Schriften, Grundtypografie, Fokus
   Kaskadenordnung wird in der Seite deklariert:
   @layer reset, base, layout, components, utilities;
   ========================================================================== */

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

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

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

  ul[class], ol[class] { list-style: none; padding: 0; }

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

  img, video { height: auto; }

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

  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  :target { scroll-margin-top: calc(var(--header-h) + var(--sp-sm)); }
}

@layer base {
  /* --- Schriften, self-hosted (kein Request an Dritte) ------------------ */
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/barlow-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/barlow-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
      U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-600-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
      U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-700-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
      U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-800-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-800-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
      U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--sp-sm));
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }

  body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* clip statt hidden: sticky bleibt funktionsfaehig */
    overflow-x: clip;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
  }

  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }

  h4 {
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
  }

  p { text-wrap: pretty; }

  a { color: var(--green); }

  a:hover { color: var(--green-dark); }

  strong, b { font-weight: var(--fw-semi); }

  /* Sichtbarer Fokus auf allen bedienbaren Elementen */
  :focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
    border-radius: 2px;
  }

  ::selection {
    background: var(--lime);
    color: var(--ink);
  }
}

@layer utilities {
  .visually-hidden:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Sprungmarke zum Inhalt */
  .skip-link {
    position: absolute;
    inset-inline-start: var(--sp-sm);
    inset-block-start: var(--sp-sm);
    z-index: 100;
    padding: var(--sp-2xs) var(--sp-sm);
    background: var(--paper);
    border: 2px solid var(--green);
    border-radius: var(--radius-sm);
    font-weight: var(--fw-semi);
    text-decoration: none;
    transform: translateY(-200%);
  }

  .skip-link:focus { transform: none; }

  .container {
    width: min(100% - 2 * var(--container-pad), var(--container));
    margin-inline: auto;
  }

  .measure { max-width: var(--measure); }
}
