/* =============================================================================
   BASE — modern reset, document defaults, typography and accessibility helpers
   -----------------------------------------------------------------------------
   Only element-level styling belongs here. Reusable UI pieces live in
   components.css, page structure lives in layout.css.
============================================================================= */

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

* {
  margin: 0;
}

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

  /* Anchor targets are offset by the sticky header height */
  scroll-padding-top: calc(var(--header-height) + var(--space-sm));
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  min-height: 100svh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

/* --- Typography ------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-lg);
}

p,
li {
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-sm);
}

strong {
  font-weight: 650;
  color: var(--color-heading);
}

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

a {
  color: var(--color-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-teal);
}

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

address {
  font-style: normal;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* --- Accessibility --------------------------------------------------------- */

/* Visible, high-contrast focus indicator for keyboard users (WCAG 2.4.7) */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Content that must be available to assistive technology only */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keyboard shortcut to jump straight to the main content */
.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--space-2xs);
  z-index: calc(var(--z-consent) + 10);
  transform: translateY(-200%);
  background-color: var(--brand-teal);
  color: var(--color-text-invert);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-text-invert);
}

/* Respect the operating system "reduce motion" preference (WCAG 2.3.3) */
@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;
  }
}

/* Support Windows High Contrast Mode */
@media (forced-colors: active) {
  .btn,
  .card,
  .accordion__item {
    border: 1px solid ButtonBorder;
  }
}

/* --- Print ----------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer__bottom,
  .consent-banner,
  .to-top,
  .hero__actions {
    display: none !important;
  }

  body {
    font-size: 11pt;
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
}
