/*
 * Reset and document-level base styles.
 * Loaded after tokens.css, before components.css.
 */

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

html {
  /* stylelint-disable-next-line property-no-vendor-prefix -- iOS Safari only
     honours the prefixed form; without it, landscape rotation inflates text. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

/*
 * Wrapped in :where() so the reset carries zero specificity — otherwise
 * ul[class] (0,1,1) outranks component classes like .isi__list (0,1,0)
 * and silently strips list markers a component asked for.
 */
:where(ul[class], ol[class]) {
  padding: 0;
  list-style: none;
}

body {
  min-block-size: 100dvh;
  background-color: var(--color-surface);
  color: var(--color-text-body);
  font-family: var(--font-support);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--color-text-heading);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);

  /* At a large user font-size a single long word can be wider than its column
     and force horizontal scroll — a WCAG 1.4.4 reflow failure. Break only
     when a word genuinely cannot fit. */
  overflow-wrap: break-word;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-link);
}

img,
svg,
picture {
  display: block;
  max-inline-size: 100%;
}

/*
 * Reference markers. Every superscript is 0.645 of its parent's size — the
 * same ratio the footnote token carries — against the UA default of `smaller`
 * (~0.83), which reads as oversized. Zero line-height so the raised glyph
 * cannot inflate its line box; the marker shares its parent's leading.
 */
sup {
  font-size: 0.645em;
  line-height: 0;
  vertical-align: super;
}

/*
 * Journal titles in the references (ISI and FAQ) are set in an italic face.
 * Declared rather than left to the UA default so the intent survives any
 * future reset — the same gap `sup` above closes.
 */
cite {
  font-style: italic;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/*
 * Two-ring focus indicator. A single `currentcolor` outline is invisible
 * wherever a control's own color matches its surface, so the white inner ring
 * carries the indicator on dark surfaces and the navy outer ring on light
 * ones — one of the two always contrasts. No border-radius override: outline
 * and box-shadow both follow the element's own radius, which pill buttons
 * rely on.
 */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--color-white);
}

/* box-shadow is dropped in forced-colors mode, so lean on the system color. */
@media (forced-colors: active) {
  :where(a, button, summary, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
}

/* ---------------------------------------------------------------
 * Layout primitives
 * ------------------------------------------------------------- */

.container {
  inline-size: 100%;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-margin);
}

/* ---------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------- */

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 100;
  padding: var(--space-s) var(--space-m);
  background-color: var(--color-white);
  color: var(--color-brand-primary);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  translate: 0 -100%;
}

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

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