/*
 * Firefighter Pfister — base layer
 *
 * Element defaults and the named type styles from the design system. Every
 * type style maps to a row of the brief's typography table; sizes come from
 * the fluid tokens so they ride the ramp rather than stepping at breakpoints.
 */

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

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/*
 * The `hidden` attribute is only a UA-stylesheet `display: none`, so any class
 * that sets display beats it — `.form { display: flex }` left a "hidden" form
 * fully visible. Make the attribute mean what it says.
 */
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-solid);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/*
 * Visually hidden but still announced. Used where an icon carries meaning that
 * needs spelling out for screen readers — the MA badge, for instance.
 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first tab stop, visually hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-solid);
  color: var(--ash-900);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}

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

/* ---------------------------------------------------------------- *
 * Type styles
 * ---------------------------------------------------------------- */

.t-h1,
.t-h2,
.t-h3,
.t-h4,
.t-h5,
.t-h6 {
  font-family: var(--font-display);
}

.t-h1 {
  font-size: var(--type-h1);
  font-weight: 900;
  line-height: var(--lh-h1);
  letter-spacing: var(--tr-h1);
}

.t-h2 {
  font-size: var(--type-h2);
  font-weight: 700;
  line-height: var(--lh-h2);
  letter-spacing: var(--tr-h2);
}

.t-h3 {
  font-size: var(--type-h3);
  font-weight: 700;
  line-height: var(--lh-h3);
  letter-spacing: var(--tr-h3);
}

.t-h4 {
  font-size: var(--type-h4);
  font-weight: 600;
  line-height: var(--lh-h4);
  letter-spacing: var(--tr-h4);
}

.t-h5 {
  font-size: var(--type-h5);
  font-weight: 600;
  line-height: var(--lh-h5);
}

.t-h6 {
  font-size: var(--type-h6);
  font-weight: 600;
  line-height: var(--lh-h6);
}

.t-body {
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

.t-lead {
  font-family: var(--font-display);
  font-size: var(--type-lead);
  font-weight: 400;
  line-height: var(--lh-lead);
}

.t-small {
  font-family: var(--font-body);
  font-size: var(--type-small);
  font-weight: 400;
  line-height: var(--lh-small);
}

/*
 * Nav and Eyebrow weights follow the Figma file (Onest Bold 700 / Black 900),
 * which disagrees with the brief's table (500 / 700). See FINDINGS.md.
 */
.t-nav {
  font-family: var(--font-display);
  font-size: var(--type-nav);
  font-weight: 700;
  line-height: var(--lh-nav);
  letter-spacing: var(--tr-nav);
  text-transform: uppercase;
}

/*
 * Eyebrow carries its own colour token: at 13px it needs 4.5:1, and ember on
 * a light ground only reaches 2.87:1. Smoke/500 on light, ember on dark.
 */
.t-eyebrow {
  font-family: var(--font-display);
  font-size: var(--type-eyebrow);
  font-weight: 900;
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--text-eyebrow);
}

.t-caption {
  font-family: var(--font-display);
  font-size: var(--type-small);
  font-weight: 400;
  line-height: var(--lh-caption);
}
