/**
 * SBS Base — font faces, reset and element defaults.
 * Depends on tokens.css.
 */

/* ------------------------------------------------------------------
 * Font faces
 *
 * Both families are under the SIL Open Font License and are self-hosted.
 * Nothing is loaded from the Google Fonts CDN: a German court (LG München I,
 * 2022) held that embedding Google Fonts remotely transmits visitor IPs to a
 * third country without consent. Self-hosting avoids the question entirely.
 *
 * Jost replaces Futura as the display face — Futura is a commercial typeface
 * whose licence does not cover public self-hosting. Jost is a geometric sans
 * drawn in the same tradition and is the closest free substitute.
 * ---------------------------------------------------------------- */
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Jost — variable weight axis, one file covers 400 through 700.
 * Split by unicode-range so most visitors only download the latin subset. */
@font-face {
  font-family: 'Jost';
  src: url('../fonts/Jost-Variable-latin.woff2') format('woff2-variations'),
    url('../fonts/Jost-Variable-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: 'Jost';
  src: url('../fonts/Jost-Variable-latin-ext.woff2') format('woff2-variations'),
    url('../fonts/Jost-Variable-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keep anchor targets clear of the sticky header */
  scroll-padding-top: calc(var(--sbs-header-h) + var(--sbs-space-4));
}

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

body {
  background-color: var(--sbs-background);
  color: var(--sbs-foreground);
  font-family: var(--sbs-font-body);
  font-size: var(--sbs-text-base);
  font-weight: var(--sbs-weight-normal);
  line-height: var(--sbs-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ------------------------------------------------------------------
 * Typography defaults
 * ---------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--sbs-font-display);
  font-weight: var(--sbs-weight-display);
  line-height: var(--sbs-leading-tight);
  letter-spacing: var(--sbs-tracking-tight);
  color: var(--sbs-foreground);
  text-wrap: balance;
}

h1 {
  font-size: var(--sbs-text-4xl);
}
h2 {
  font-size: var(--sbs-text-3xl);
}
h3 {
  font-size: var(--sbs-text-2xl);
}
h4 {
  font-size: var(--sbs-text-xl);
}
h5 {
  font-size: var(--sbs-text-lg);
}
h6 {
  font-size: var(--sbs-text-base);
  letter-spacing: var(--sbs-tracking-wide);
  text-transform: uppercase;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--sbs-gold-dark);
  text-decoration-color: rgb(var(--sbs-gold-rgb) / 0.4);
  text-underline-offset: 0.2em;
  transition: color var(--sbs-transition), text-decoration-color var(--sbs-transition);
}

a:hover {
  color: var(--sbs-gold);
  text-decoration-color: currentColor;
}

strong,
b {
  font-weight: var(--sbs-weight-bold);
}

small {
  font-size: var(--sbs-text-sm);
}

blockquote {
  border-left: 3px solid var(--sbs-gold);
  padding: var(--sbs-space-2) 0 var(--sbs-space-2) var(--sbs-space-6);
  font-size: var(--sbs-text-lg);
  font-style: italic;
  color: var(--sbs-muted-foreground);
}

hr {
  border: 0;
  border-top: 1px solid var(--sbs-border);
  margin-block: var(--sbs-space-10);
}

code,
pre,
kbd {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
}

code {
  background: var(--sbs-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--sbs-radius-sm);
}

pre {
  background: var(--sbs-muted);
  padding: var(--sbs-space-4);
  border-radius: var(--sbs-radius);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sbs-text-sm);
}

th,
td {
  text-align: left;
  padding: var(--sbs-space-3);
  border-bottom: 1px solid var(--sbs-border);
}

th {
  font-family: var(--sbs-font-display);
  font-weight: var(--sbs-weight-bold);
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--sbs-text-sm);
  color: var(--sbs-muted-foreground);
  padding-top: var(--sbs-space-2);
}

/* ------------------------------------------------------------------
 * Focus — visible and on-brand, never removed
 * ---------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--sbs-ring);
  outline-offset: 2px;
  border-radius: var(--sbs-radius-sm);
}

::selection {
  background: rgb(var(--sbs-gold-rgb) / 0.28);
  color: var(--sbs-foreground);
}

/* ------------------------------------------------------------------
 * Accessibility helpers (WordPress conventions)
 * ---------------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--sbs-background);
  clip-path: none;
  color: var(--sbs-gold-dark);
  display: block;
  font-size: var(--sbs-text-sm);
  font-weight: var(--sbs-weight-bold);
  height: auto;
  left: var(--sbs-space-4);
  padding: var(--sbs-space-3) var(--sbs-space-5);
  top: var(--sbs-space-4);
  text-decoration: none;
  width: auto;
  z-index: 100000;
  border-radius: var(--sbs-radius);
  box-shadow: var(--sbs-shadow-lg);
}

.skip-link {
  position: absolute;
}
