/* ==========================================================================
   Base — reset, typography, global element defaults
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); }
h4 { font-size: var(--text-base); font-weight: 700; }

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

small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

a {
  /* primary-700, not the brand-500 swatch: needed to clear 4.5:1 text contrast on white */
  color: var(--color-primary-700);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-800);
  text-decoration: underline;
}

ul, ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-6);
  line-height: var(--leading-relaxed);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-5) 0;
}

/* ---- Universal, visible keyboard focus ring ---- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove the default ring only when we are supplying our own focus treatment */
button, a, input, select, textarea {
  font-family: inherit;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary-500);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus-visible {
  left: 0;
}

/* ---- Selection ---- */
::selection {
  background: var(--color-primary-200);
  color: var(--color-navy-800);
}

/* ---- Scrollbar (WebKit) ---- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ---- Visually-hidden utility (screen-reader only text) ---- */
.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;
}

/* ---- Icon sizing (Heroicons outline 24×24 defaults) ---- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.2em;
}

/* Font Awesome / solid fallbacks: filled paths instead of strokes */
.icon--filled {
  fill: currentColor;
  stroke: none;
}

.icon--lg {
  width: 1.6em;
  height: 1.6em;
}
