/* ==========================================================================
   BASE — reset, global element defaults, accessibility primitives
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  color-scheme: light dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

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

img {
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5, h6 { font-size: var(--fs-base); }

p {
  color: var(--color-text-muted);
  text-wrap: pretty;
  text-align: justify;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-accent-hover);
}

/* Structural/component links (nav, buttons, cards, footer, member-card
   icons, breadcrumbs) rely on color + weight + surrounding UI to read as
   interactive, so they stay underline-free — this is what looked
   "unprofessional" with the browser default applied everywhere. */

/* Plain inline links inside flowing text still get an underline at rest,
   since color alone isn't a sufficient cue for links embedded in a
   sentence (WCAG 1.4.1) — e.g. a mailto/tel link inside a paragraph or
   contact card, or a link inside an FAQ/blog answer. */
p a,
li a,
.lede a,
#contact-info a,
.accordion-panel a,
.state-block a {
  text-decoration: underline;
}

/* ...except when that "li a" is really a structural nav/footer/card
   item — those opt back out explicitly. */
.nav-list a,
.dropdown-panel a,
.footer-links a,
.search-results-list a,
.member-list a,
.member-grid a {
  text-decoration: none;
}

ul, ol {
  list-style: none;
  padding: 0;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- Focus visibility (WCAG AA, never suppressed) ---- */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-3);
}

/* ---- 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;
}

/* ---- Selection ---- */
::selection {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}

/* ---- Scrollbar (progressive enhancement) ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) var(--scrollbar-track);
}

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.stack > * + * {
  margin-top: var(--gap, var(--space-5));
}

.section {
  padding-block: var(--space-9);
}

.section--tight {
  padding-block: var(--space-7);
}

.section-header {
  max-width: 95%;
  margin-bottom: var(--space-7);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
  display: inline-block;
}

.visually-hidden-until-focus:not(:focus) {
  clip: rect(0 0 0 0);
  position: absolute;
}

/* ---- Utility: no horizontal scroll guarantee ---- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
