/* ============================================================================
   base.css — reset + element defaults (no components here)
   Mobile-first. Logical properties throughout for RTL. Loaded after tokens.css.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font: var(--fs-base)/var(--lh-base) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Headings ---------------------------------------------------------------- */
h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 var(--space-4);
  font-weight: 700;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-4); }

/* Links ------------------------------------------------------------------- */
a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  text-underline-offset: 3px;
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

/* Media & forms ----------------------------------------------------------- */
img, svg, video { max-width: 100%; height: auto; display: block; }

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

ul, ol { margin: 0 0 var(--space-4); padding-inline-start: 1.4rem; }
li { margin-block: .3rem; }

hr { border: 0; border-block-start: 1px solid var(--border); margin-block: var(--space-6); }

/* Focus — visible for keyboard users, quiet for pointer users -------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link --------------------------------------------------------------- */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--pill-bg);
  color: var(--pill-text);
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Shared layout helper: centred content column ---------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--edge);
}

/* Visually-hidden (screen-reader only) ------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

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