/* Base styles: light reset, type roles, links, layout, header, menu, footer, buttons, dark and orange bands,
   and reusable patterns (cards, logo row, stat list, tile grid, accordion). Colors only via tokens.css. */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keeps anchors and focused items from hiding under the sticky header. */
  scroll-padding-top: calc(var(--header-height) + 2 * var(--space-1) + var(--space-2));
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--size-body);
  line-height: var(--leading-body);
  color: var(--gray);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

/* width/height attributes only reserve space; the real size comes from CSS. */
img {
  height: auto;
}

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

p,
h1,
h2,
h3,
h4,
h5 {
  overflow-wrap: break-word;
}

strong,
b {
  font-weight: 600;
}

/* ---------- Type roles ---------- */
h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
.eyebrow {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--charcoal);
  text-transform: uppercase;
}

h1, .h1 { font-size: var(--size-h1); line-height: var(--leading-h1); }
h2, .h2 { font-size: var(--size-h2); line-height: var(--leading-h2); }
h3, .h3 { font-size: var(--size-h3); line-height: var(--leading-h3); }
h4, .h4 { font-size: var(--size-h4); line-height: var(--leading-h4); }
h5, .h5 {
  font-size: var(--size-h5);
  line-height: var(--leading-h5);
  letter-spacing: var(--tracking-h5);
}

.eyebrow {
  font-size: var(--size-h4);
  line-height: var(--leading-h4);
}

.lead {
  font-size: var(--size-lead);
  line-height: var(--leading-lead);
}

.body {
  font-size: var(--size-body);
  line-height: var(--leading-body);
}

.label {
  font-weight: 600;
  font-size: var(--size-label);
  line-height: var(--leading-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.small {
  font-size: var(--size-small);
  line-height: var(--leading-small);
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--size-nav);
  line-height: var(--leading-nav);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
}

.chip {
  font-weight: 600;
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  background-color: var(--stone);
  color: var(--charcoal);
  font-size: var(--size-chip);
  line-height: var(--leading-chip);
  letter-spacing: var(--tracking-chip);
  text-transform: uppercase;
}

p,
li {
  max-width: var(--measure);
}

/* ---------- Links ---------- */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Focus (light sections by default) ---------- */
:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--white {
  background-color: var(--white);
}

.section--offwhite {
  background-color: var(--offwhite);
}

@media (width < 1025px) {
  .section {
    padding-block: var(--space-3);
  }
}

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

.stack-lg > * + * {
  margin-top: var(--space-3);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-small);
  background-color: var(--charcoal);
  color: var(--white);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  outline-color: var(--orange);
}

/* ---------- Buttons (text only, never icons) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--size-button);
  font-weight: 600;
  line-height: var(--leading-button);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Primary */
.btn--primary {
  background-color: var(--orange);
  border-color: var(--orange);
  color: var(--charcoal);
}

.btn--primary:hover {
  background-color: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--orange);
}

/* Secondary (outline) */
.btn--secondary {
  background-color: transparent;
  border-color: var(--charcoal);
  color: var(--charcoal);
}

.btn--secondary:hover {
  background-color: var(--charcoal);
  color: var(--white);
}

/* ---------- Dark band ---------- */
.band-dark {
  background-color: var(--charcoal);
  color: var(--white);
}

.band-dark :is(h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5) {
  color: var(--white);
}

.band-dark .eyebrow {
  color: var(--orange);
}

.band-dark :focus-visible {
  outline-color: var(--orange);
}

.band-dark .btn--primary:hover {
  background-color: var(--white);
  border-color: var(--white);
  color: var(--charcoal);
}

.band-dark .btn--secondary {
  border-color: var(--white);
  color: var(--white);
}

.band-dark .btn--secondary:hover {
  background-color: var(--white);
  color: var(--charcoal);
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: var(--space-1);
  transition: margin-bottom 0.2s ease;
}

/* Slimmer after scrolling (class set by js/site.js). The margin makes up the lost
   height, so the page below doesn't move. */
.site-header.is-scrolled {
  margin-bottom: calc(var(--header-height) - var(--header-height-slim));
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--header-height);
  transition: min-height 0.2s ease;
}

.site-header.is-scrolled .site-header__bar {
  min-height: var(--header-height-slim);
}

.site-header__logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 44px;
}

.site-header__logo img {
  width: auto;
  height: 40px;
  transition: height 0.2s ease;
}

.site-header.is-scrolled .site-header__logo img {
  height: 32px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.site-nav__link[aria-current="page"] {
  font-weight: 600;
  text-decoration-color: var(--orange);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding-inline: var(--space-1);
  border: 0;
  border-radius: var(--radius-small);
  background-color: transparent;
  color: var(--white);
  cursor: pointer;
}

@media (width < 1025px) {
  /* The menu moves behind the Menu button only when JavaScript runs. */
  .js .site-nav {
    display: none;
  }

  .js .menu-toggle {
    display: inline-flex;
  }

  /* The wide logo is smaller on phones and tablets, leaving room for the Menu button. */
  .site-header__logo img,
  .site-header.is-scrolled .site-header__logo img {
    height: 32px;
  }

  /* Without JavaScript the links wrap under the logo, so the header doesn't stick. */
  html:not(.js) .site-header {
    position: static;
  }

  html:not(.js) .site-header__bar {
    flex-wrap: wrap;
  }

  html:not(.js) .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
  }
}

/* ---------- Phone/tablet menu panel ---------- */
.menu-panel {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0 0 var(--space-4);
  border: 0;
  overflow-y: auto;
  background-color: var(--charcoal);
  color: var(--white);
}

.menu-panel::backdrop {
  background-color: var(--charcoal);
}

html.menu-open {
  overflow: hidden;
}

.menu-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: calc(var(--header-height) + 2 * var(--space-1));
}

.menu-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background-color: transparent;
  color: var(--white);
  cursor: pointer;
}

.menu-panel__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding-top: var(--space-3);
}

.menu-panel__list {
  display: grid;
  gap: var(--space-1);
  padding: 0;
  list-style: none;
}

.menu-panel__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.menu-panel__link:hover,
.menu-panel__link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.menu-panel__link[aria-current="page"] {
  font-weight: 600;
  text-decoration-color: var(--orange);
}

/* ---------- Site footer ---------- */
.site-footer {
  padding-block: var(--space-4) var(--space-3);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
  align-items: center;
  gap: var(--space-4);
}

.footer-cta {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.footer-cta__tagline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-cta__tagline img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.footer-cta__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.site-footer .footer-cta__display {
  color: var(--orange);
}

.footer-contact,
.footer-nav ul,
.footer-legal {
  padding: 0;
  list-style: none;
}

.footer-nav li + li {
  border-top: 1px solid var(--orange);
}

.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--space-1);
  color: var(--white);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav a[aria-current="page"] {
  font-weight: 600;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--white);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
}

.footer-contact a,
.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (width < 1025px) {
  .site-footer__main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
}

/* ---------- Text helpers ---------- */
/* Text only screen readers hear (for example "about" in front of "~600"). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-center > *,
p.text-center {
  margin-inline: auto;
}

/* Orange words are only allowed on charcoal. */
.band-dark .accent {
  color: var(--orange);
}

/* FAQ question role: SemiBold at the lead size, normal case. */
.faq-question {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--size-lead);
  line-height: var(--leading-lead);
  color: var(--charcoal);
}

/* ---------- Icons (inlined SVG, color from the text color) ---------- */
.icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

/* ---------- Orange band ---------- */
/* Everything on orange is charcoal: white on orange fails contrast. */
.band-orange {
  background-color: var(--orange);
  color: var(--charcoal);
}

.band-orange :focus-visible {
  outline-color: var(--charcoal);
}

/* Dark button: for the orange band. */
.btn--dark {
  background-color: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--white);
}

.btn--dark:hover {
  background-color: var(--white);
  border-color: var(--white);
  color: var(--charcoal);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-4) var(--space-5);
}

@media (width < 1025px) {
  .hero {
    padding-block: var(--space-3) var(--space-4);
  }
}

/* ---------- Row with a button on one side and a note on the other ---------- */
.split-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.split-row__aside {
  max-width: 28rem;
  text-align: right;
}

@media (width < 640px) {
  .split-row__aside {
    text-align: left;
  }
}

/* ---------- Cards: chip, title link and photo; the whole card is clickable ---------- */
/* Sizes measured from the Duda draft: 10px card padding, chip and title 16px further in,
   photo 385px tall at every width. 4 across from 1025px, one per row below. */
.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: max(var(--space-2), 2.3vw);
  padding: 0;
  list-style: none;
}

@media (width >= 1025px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  max-width: none;
  padding: 10px;
  border-radius: var(--radius-card);
  background-color: var(--stone);
}

.card .chip,
.card__title {
  margin-inline: var(--space-2);
}

.card .chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: var(--space-2);
  background-color: var(--white);
}

/* The title grows so the photos line up along the bottom of every card. */
.card__title {
  flex-grow: 1;
  padding-bottom: var(--space-2);
}

.card__link {
  text-decoration: none;
}

/* Stretches the title link over the whole card. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}

.card__link:focus-visible {
  outline: none;
}

.card__link:focus-visible::after {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}

.card picture {
  width: 100%;
}

.card__media {
  width: 100%;
  height: 385px;
  object-fit: cover;
  border-radius: var(--radius-small);
}

/* ---------- Logo row: wrapping row of logos ---------- */
/* Each logo's height comes from the data (--logo-h, set in the template), chosen so the
   logos look the same size. Phones use 0.75 of it. */
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding: 0;
  list-style: none;
}

.logo-row img {
  width: auto;
  height: var(--logo-h, 40px);
}

.logo-row--large {
  justify-content: space-around;
}

/* Below desktop the member logos sit in a 2 × 2 grid, so four logos never wrap 3 + 1. */
@media (width < 1025px) {
  .logo-row--large {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: space-around;
    justify-items: center;
  }
}

@media (width < 640px) {
  .logo-row {
    justify-content: center;
    gap: var(--space-3);
  }

  .logo-row img {
    height: calc(var(--logo-h, 40px) * 0.75);
  }
}

/* ---------- National reach: map card beside the stats ---------- */
.reach {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: var(--space-4);
}

@media (width < 1025px) {
  .reach {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
}

/* The map panel runs to the card's left, right and bottom edges; only the heading
   and the orange line keep the card's padding. */
.reach__card {
  overflow: hidden;
  border-radius: var(--radius-card);
}

.reach__intro {
  padding: var(--space-3);
}

.reach__map {
  padding: var(--space-2);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background-color: var(--offwhite);
  color: var(--charcoal);
}

.reach__map :focus-visible {
  outline-color: var(--charcoal);
}

/* Standalone panel (Our Network hero): rounded on all four corners. */
.reach__map--rounded {
  border-radius: var(--radius-card);
}

.reach__map img {
  width: 100%;
  height: auto;
}

.reach__action {
  text-align: right;
}

@media (width < 640px) {
  .reach__intro {
    padding: var(--space-2);
  }

  .reach__action {
    text-align: left;
  }
}

/* ---------- Stat list: check icon + number and label, with dividers ---------- */
.stat-list {
  padding: 0;
  list-style: none;
}

/* Desktop: rows about 112px apart, as in the draft. */
.stat-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: none;
  padding-block: 32px;
  border-bottom: 1px solid currentColor;
}

.stat-list .icon {
  width: 35px;
  height: 35px;
}

@media (width < 1025px) {
  .stat-list__item {
    gap: 20px;
    padding-block: var(--space-2);
  }

  .stat-list .icon {
    width: 33px;
    height: 33px;
  }
}

/* ---------- Tile grid: icon + short label; 4 + 3 centered on desktop, 2 per row below ---------- */
.tile-grid {
  --tile-gap: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--tile-gap);
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex: 0 0 calc((100% - 3 * var(--tile-gap)) / 4);
  flex-direction: column;
  align-items: center;
  gap: 21px;
  max-width: none;
  color: var(--charcoal);
  text-align: center;
}

.tile .icon {
  width: 134px;
  height: 134px;
}

@media (width < 1025px) {
  .tile-grid {
    --tile-gap: var(--space-2);
    row-gap: var(--space-3);
  }

  .tile {
    flex-basis: calc((100% - var(--tile-gap)) / 2);
    gap: 14px;
  }

  .tile .icon {
    width: 88px;
    height: 88px;
  }
}

/* ---------- Accordion (<details>/<summary>) ---------- */
.accordion {
  max-width: 48rem;
  margin-inline: auto;
  border-top: 1px solid var(--gray);
}

.accordion__item {
  border-bottom: 1px solid var(--gray);
}

.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 44px;
  padding-block: var(--space-2);
  list-style: none;
  cursor: pointer;
}

.accordion__summary::-webkit-details-marker {
  display: none;
}

.accordion__summary:hover .faq-question {
  text-decoration: underline;
}

.accordion__icon {
  display: inline-flex;
  color: var(--charcoal);
  transition: transform 0.2s ease;
}

/* The plus turns into an × when open. */
.accordion__item[open] .accordion__icon {
  transform: rotate(45deg);
}

.accordion__panel {
  padding-bottom: var(--space-2);
}

/* On the charcoal band (Our Network location list): same accordion, light colors. */
.band-dark .accordion,
.band-dark .accordion__item {
  border-color: var(--gray);
}

.band-dark .faq-question,
.band-dark .accordion__icon {
  color: var(--white);
}

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

  .site-header,
  .site-header__bar,
  .site-header__logo img,
  .accordion__icon {
    transition: none;
  }
}
