/*
 * 5UWebsite.com — Base CSS
 * Modern reset + element defaults + utility classes.
 * Depends on: tokens.css
 * IMMUTABLE for Phase C.
 *
 * The reset is a trimmed Andy Bell + a few legacy compatibility tweaks.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

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

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

ul, ol { padding-left: 0; list-style: none; } /* SPPB articles render as flat lists; reset and re-add inside content blocks */

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

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

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

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover, a:focus-visible { color: var(--color-brand-hover); }

/* When an element is focused via keyboard, give a visible ring (subtle). */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ===== Typography defaults ===== */
h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-h1);
  font-family: var(--font-sans);
  margin-bottom: var(--space-h1-bottom);
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-h2);
  font-family: var(--font-sans);
  margin-bottom: var(--space-h2-bottom);
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-h3);
  font-family: var(--font-sans);
  margin-bottom: var(--space-h3-bottom);
}
h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--fw-h4);
  font-family: var(--font-display);
  margin-top: 10px;
}
p {
  line-height: var(--lh-body);
}

@media (max-width: 767.98px) {
  h1 { font-size: var(--fs-h1-m); line-height: var(--lh-h1-m); margin-bottom: 30px; }
  h2 { font-size: var(--fs-h2-m); line-height: var(--lh-h2-m); margin-bottom: 20px; }
  h3 { font-size: var(--fs-h3-m); line-height: var(--lh-h3-m); margin-bottom: 10px; }
}

/* ===== Layout utilities ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 26px;
  border-radius: var(--radius-pill-lg);
  border: 2px solid var(--color-brand);
  background: var(--color-brand);
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background var(--transition-med), color var(--transition-med),
    border-color var(--transition-med);
  text-align: center;
}
.btn:hover, .btn:focus-visible {
  background: var(--color-brand-active);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-brand);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--color-brand);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-ghost:hover {
  background: #fff;
  color: var(--color-brand);
}

.btn-sm { padding: 8px 32px; font-size: var(--fs-body); }
.btn-lg { padding: 15px 80px; font-weight: 600; }

/* ===== Accessibility utilities ===== */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-main link (shown on focus) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-brand);
  color: #fff;
  padding: 8px 16px;
  z-index: var(--z-modal);
}
.skip-link:focus { top: 0; }

/* ===== Lazy-load image hint (works without JS) =====
   Page templates should just use <img loading="lazy">. Below-the-fold
   <picture> blocks should also include `decoding="async"`. */
img[loading="lazy"] { content-visibility: auto; }
