/* ============================================================================
   RESET / NORMALISE
   ----------------------------------------------------------------------------
   A lightweight modern reset layered on top of Bootstrap. Keeps box-sizing,
   media defaults and accessible focus behaviour consistent across browsers.
   ============================================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clip horizontal overflow at the ROOT so the fixed, off-canvas mobile
     drawer (translateX(100%)) can't create a horizontal scrollbar. Fixed
     elements are positioned to the viewport and are NOT contained by body's
     overflow, so this must be on <html>. We use `clip` (not `hidden`) so we
     do NOT create a scroll container — the sticky header keeps working and the
     vertical axis is untouched. Old browsers ignore `clip` and use body's
     fallback below. */
  overflow-x: clip;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* fallback for browsers without `clip` */
  overflow-x: clip; /* preferred: clips without creating a scroll container */
}

/* Media elements scale within their container by default. */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inherit fonts for form controls. */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove default list styling where we opt out via .list-unstyled style hooks. */
ul[class],
ol[class] {
  list-style: none;
  padding: 0;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Accessible, visible focus ring for keyboard users (WCAG 2.1 AA). */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen-reader-only utility (used for accessible labels). */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard navigation. */
.skip-link {
  position: absolute;
  left: 0;
  top: -120px;
  z-index: var(--z-loader);
  padding: 12px 20px;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: var(--fw-semibold);
  border-radius: 0 0 var(--radius-button) 0;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
}
