/* Base layout helpers — design tokens + primitives live in fws-a11y.css */

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

.section {
  padding-block: var(--space-12);
}
.section--tint {
  background: var(--color-primary-tint);
}
.section--subtle {
  background: var(--color-bg-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-text-on-primary);
}
.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover {
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
}

/* ---------- Page layout ---------- */
.page {
  padding-block: var(--space-8);
}
.page__intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: var(--content-max);
}
.page__content {
  max-width: var(--content-max);
}

/* Page-header banner: navy strip with breadcrumbs + H1 + lede. */
.page-header {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  padding-block: var(--space-8) var(--space-8);
  border-bottom: 4px solid var(--color-accent);
}
.page-header .breadcrumbs {
  margin-bottom: var(--space-3);
}
.page-header .breadcrumbs__list,
.page-header .breadcrumbs a {
  color: var(--color-text-on-primary);
}
.page-header .breadcrumbs a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.page-header .breadcrumbs__item + .breadcrumbs__item::before {
  color: rgba(255, 255, 255, 0.7);
}
.page-header .breadcrumbs__item [aria-current='page'] {
  color: rgba(255, 255, 255, 0.85);
}
.page-header__title {
  color: var(--color-text-on-primary);
  margin: 0 0 var(--space-3);
  font-size: clamp(1.5rem, 2.4vw, 2rem); /* 24–32px */
  line-height: 1.2;
}
.page-header__intro {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  max-width: 60ch;
  margin: 0;
  line-height: 1.55;
}

/* Body content typography — readable line length, modest sizes. */
.page__content {
  max-width: 70ch;
  font-size: 1rem;
}
.page__content h2 {
  font-size: 1.25rem; /* 20px */
  margin-top: var(--space-8);
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--color-border-subtle);
}
.page__content h3 {
  font-size: 1.125rem; /* 18px */
  margin-top: var(--space-6);
}
.page__content ul,
.page__content ol {
  padding-left: var(--space-6);
}
.page__content li {
  margin-bottom: var(--space-2);
}
.page__content a {
  text-decoration: underline;
}
.page__content a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: var(--space-4);
}
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
}
.breadcrumbs__item + .breadcrumbs__item::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--color-text-muted);
}
.breadcrumbs__item [aria-current='page'] {
  color: var(--color-text-muted);
}

/* Document search + listing */
.doc-search {
  margin-top: var(--space-6);
}
.doc-search__form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.doc-search__label {
  display: block;
  width: 100%;
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.doc-search__input {
  flex: 1 1 18rem;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
}
.doc-search__count {
  font-weight: 600;
}
.doc-search__results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-link {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.doc-link__title {
  font-size: var(--text-lg);
  font-weight: 600;
}
.doc-link__meta {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}
.doc-link__desc {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
}

/* Forms */
.form {
  max-width: var(--content-max);
}
.form-field {
  margin-bottom: var(--space-4);
}
.form-field__label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.form-field__req {
  font-weight: 400;
  color: var(--color-text-muted);
}
.form-field__input {
  display: block;
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
}
.form-field__input[aria-invalid='true'] {
  border-color: var(--color-error);
}
.form-field__checkbox {
  width: 1.25rem;
  height: 1.25rem;
}
.form-field__error {
  margin: var(--space-1) 0 0;
  color: var(--color-error);
  font-weight: 600;
}
.form-error-summary {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  border: 2px solid var(--color-error);
  border-radius: var(--radius);
  background: #fdf2f4;
}
.form-error-summary h2 {
  margin-top: 0;
  color: var(--color-error);
  font-size: var(--text-xl);
}
.form-error-summary a {
  color: var(--color-error);
}
.form-confirm {
  padding: var(--space-6);
  border-left: 4px solid var(--color-success);
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
}

/* Notice / placeholder box */
.notice {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
}

/* ---------- Section primitive ---------- */
.section__title {
  margin-top: 0;
  margin-bottom: var(--space-6);
  font-size: clamp(1.375rem, 2vw, 1.75rem); /* 22–28px */
}

/* Gold accent button + ghost variant for hero CTA row */
.btn--gold {
  background: var(--color-accent);
  color: #1a1a1a; /* on #B8860B → 6.0:1 */
  border-color: var(--color-accent);
}
.btn--gold:hover {
  background: #a0750a;
  border-color: #a0750a;
  color: #1a1a1a;
}
.btn--ghost {
  background: transparent;
  color: var(--color-text-on-primary);
  border-color: var(--color-text-on-primary);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-on-primary);
}

/* ---------- Home: Hero ---------- */
.hero {
  /* Solid darker navy (#122A43, 13.6:1 white-on) — keep the depth feel but give
   * axe a single computable background. Gradient overlays defeat axe's contrast
   * calc (needsFurtherReview=true) without changing the actual on-screen ratio. */
  background: var(--color-primary-dark);
  color: var(--color-text-on-primary);
  padding-block: var(--space-16) var(--space-12);
  border-bottom: 4px solid var(--color-accent);
}
.hero__inner {
  max-width: 60rem;
}
.hero__eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* 14px text on navy needs >= 4.5:1 — use the lighter accent token (9.1:1). */
  color: var(--color-accent-on-primary);
}
.hero__title {
  margin: 0 0 var(--space-4);
  color: var(--color-text-on-primary);
  /* Smaller display headline — closer to a 32–36px ceiling for compact heros. */
  font-size: clamp(1.625rem, 2.6vw, 2.25rem);
  line-height: 1.2;
}
.hero__lede {
  margin: 0 0 var(--space-6);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.92);
  max-width: 50ch;
  line-height: 1.55;
}
.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
}

/* ---------- Home: Quick-start row (CTA + tiles side-by-side) ---------- */
.quick-start {
  background: var(--color-bg);
}
.quick-start__grid {
  display: grid;
  grid-template-columns: minmax(18rem, 22rem) 1fr;
  gap: var(--space-8);
  align-items: stretch;
}
.quick-start__cta {
  display: flex;
}
.quick-start__tiles {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.section__title--inline {
  margin: 0 0 var(--space-2);
}

@media (max-width: 900px) {
  .quick-start__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ---------- Home: Quick-service tiles ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.tile-grid--3up {
  /* Strict 3-column grid inside its column; collapses to 2 then 1 as the
   * column narrows. */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (max-width: 1100px) {
  .tile-grid--3up {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .tile-grid--3up {
    grid-template-columns: 1fr;
  }
  /* Phones only (not tablet): primary action buttons go full width so they
   * are easy thumb targets. The hero CTA pair stacks; each fills the row. */
  .hero__cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__cta-row .btn,
  .cta-search__submit,
  .form .btn,
  .form button[type='submit'] {
    width: 100%;
  }
  .btn {
    width: 100%;
  }
}
.tile {
  display: flex;
}
.tile__link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}
.tile__link:hover {
  transform: translateY(-2px);
  border-left-color: var(--color-primary);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  text-decoration: none;
}
.tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary);
}
.tile__label {
  font-weight: 700;
  font-size: 1.0625rem; /* 17px */
  color: var(--color-primary);
}
.tile__link:hover .tile__label {
  text-decoration: underline;
}
.tile__desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- Home: About + contact card ---------- */
.home-info {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: var(--space-12);
  align-items: start;
}
.home-info__main .page__content {
  background: transparent;
}
.home-info__aside {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  color: var(--color-primary);
}
.card__title--sep {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}
.card__line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}
.card__line > span:first-child {
  font-weight: 600;
}
.card__line--muted {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  justify-content: flex-start;
}
.card__addr {
  margin: 0 0 var(--space-3);
  font-style: normal;
  line-height: 1.5;
}

/* ---------- Home: News / announcements ---------- */
.news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.news-head__more {
  font-weight: 600;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-6);
}
.news-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.news-card__tag {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-text);
}
.news-card__title {
  margin: 0 0 var(--space-3);
  font-size: 1.0625rem; /* 17px */
}
.news-card__title a {
  text-decoration: none;
}
.news-card__title a:hover {
  text-decoration: underline;
}
.news-card__excerpt {
  margin: 0;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .home-info {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }
  .hero {
    padding-block: var(--space-12) var(--space-8);
  }
}

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  padding-block: var(--space-12) var(--space-6);
  margin-top: var(--space-16);
  border-top: 4px solid var(--color-accent);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-8);
}
.site-footer__col-title {
  margin: 0 0 var(--space-3);
  /* 20px bold qualifies as "large text" (3:1 threshold) and #B8860B clears that
   * at 3.1:1 — but we keep no margin there. Use the lighter accent token (9.1:1)
   * for safety + visual cohesion with the hero eyebrow. */
  color: var(--color-accent-on-primary);
  font-size: var(--text-lg);
  font-weight: 700;
}
.site-footer__addr {
  margin: 0 0 var(--space-3);
  font-style: normal;
  line-height: 1.55;
}
.site-footer__line {
  margin: 0 0 var(--space-2);
}
.site-footer__line--muted {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-sm);
}
.site-footer a {
  color: var(--color-text-on-primary);
  text-decoration: underline;
}
.site-footer a:hover {
  /* Body-size footer links on navy require >=4.5:1 — the lighter accent token. */
  color: var(--color-accent-on-primary);
}
.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__links li {
  margin-bottom: var(--space-2);
}
.site-footer__legal {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-sm);
}
.site-footer__legal p {
  margin: 0;
  max-width: 75ch;
}

/* main focus target (skip link) shouldn't render a distracting ring */
main:focus {
  outline: none;
}

/* ---------- Site header ---------- */
.site-header {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  /* Sticky on all viewports — the slim topbar scrolls away above it, the
   * main nav stays pinned. position:sticky also serves as the positioning
   * context for the absolutely-positioned full-width mega-menu. z-index sits
   * below the search modal (100) so the modal still overlays the header. */
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}
/* On mobile: brand far-left, then search icon + hamburger clustered close
 * together on the far-right (not three-evenly-spaced). The search-trigger
 * gets order:1 so it sits BEFORE the primary-nav (which contains the
 * hamburger), and margin-left:auto pushes the cluster to the edge. */
@media (max-width: 768px) {
  .site-header__inner {
    justify-content: flex-start;
    gap: var(--space-1);
  }
  .nav-search-trigger {
    order: 1;
    margin-left: auto;
    margin-right: 0;
  }
  .primary-nav {
    order: 2;
    /* On mobile the primary-nav only contains the hamburger button — kill
     * the desktop flex-grow so the cluster (search + hamburger) actually
     * sits on the right edge instead of consuming the auto space. */
    flex-grow: 0;
  }
}
.site-header__brand {
  flex-shrink: 0;
}
.site-header__brand {
  display: flex;
  flex-direction: column;
  color: var(--color-text-on-primary);
  text-decoration: none;
  line-height: 1.2;
}
/* Stop the global a:hover from flipping the brand to dark-navy on navy.
 * Keep it white; signal hover with the gold accent underline. */
.site-header__brand:hover,
.site-header__brand:focus-visible {
  color: var(--color-text-on-primary);
}
.site-header__brand:hover .site-header__title {
  text-decoration: underline;
  text-decoration-color: var(--color-accent-on-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}
.site-header__title {
  font-size: var(--text-xl);
  font-weight: 700;
}
/* Mobile-only brand shrink. Placed AFTER the unconditional rule above so
 * the cascade picks this up at ≤768px. The full name still appears as the
 * H1 on the home page when the menu is open. */
@media (max-width: 768px) {
  .site-header__title {
    font-size: 1.0625rem; /* 17px */
  }
  .site-header__subtitle {
    display: none;
  }
}
.site-header__subtitle {
  font-size: var(--text-sm);
  opacity: 0.9;
}

/* ---------- Primary nav (desktop-first, collapses at 768px) ---------- */
.primary-nav {
  display: flex;
  /* Grow to fill the space between the brand and the search trigger.
   * Combined with .nav-menu's space-around below, the 6 mega items
   * spread across roughly 70% of the header band. */
  flex-grow: 1;
  justify-content: stretch;
}
/* Mobile: kill the desktop flex-grow so the primary-nav (which contains
 * only the hamburger button on mobile) is just hamburger-wide. That lets
 * margin-left:auto on the search trigger push the [search][hamburger]
 * cluster to the right edge. Placed AFTER the unconditional rule above
 * so the cascade actually picks it up at ≤768px. */
@media (max-width: 768px) {
  .primary-nav {
    flex-grow: 0;
  }
}
.nav-hamburger {
  display: none;
}
.nav-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* Spread items across the full width of the nav so they fill the band. */
  justify-content: space-around;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.nav-item {
  position: relative;
}
.nav-item__row {
  display: flex;
  align-items: center;
}
.nav-menu a,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-2);
  color: var(--color-text-on-primary);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.nav-menu a:hover,
.nav-toggle:hover {
  background: var(--color-primary-dark);
  color: var(--color-text-on-primary);
  text-decoration: underline;
}
.nav-menu a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}
.nav-toggle--chevron {
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  padding-inline: var(--space-2);
  background: transparent;
  border: 0;
  color: var(--color-text-on-primary);
  cursor: pointer;
}
/* Desktop hides the split-button chevron — URL-items are a single link
 * target, mega-menus open on hover/focus via the JS handlers in PrimaryNav.
 * On mobile (≤768px) the chevron reappears as a touch-friendly toggle for
 * the dropdown next to the navigating label. */
@media (min-width: 769px) {
  .nav-item__row .nav-toggle--chevron {
    display: none;
  }
}

/* Submenu (desktop dropdown) */
.nav-submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 16rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 50;
}
.nav-submenu.is-open {
  display: block;
}
.nav-submenu a {
  color: var(--color-link);
  width: 100%;
}
.nav-submenu a:hover {
  background: var(--color-primary-tint);
  color: var(--color-link-hover);
}

/* ---------- Mobile (<=768px) ---------- */
@media (max-width: 768px) {
  .nav-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-target);
    height: var(--tap-target);
    color: var(--color-text-on-primary);
    background: transparent;
    border: 2px solid var(--color-text-on-primary);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .nav-hamburger__bars,
  .nav-hamburger__bars::before,
  .nav-hamburger__bars::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
  }
  .nav-hamburger__bars {
    position: relative;
    transition: background-color 0.15s ease;
  }
  .nav-hamburger__bars::before,
  .nav-hamburger__bars::after {
    position: absolute;
    left: 0;
    transition: transform 0.15s ease, top 0.15s ease;
  }
  .nav-hamburger__bars::before {
    top: -7px;
  }
  .nav-hamburger__bars::after {
    top: 7px;
  }
  /* Open state: bars morph into an X */
  .nav-hamburger__bars.is-open {
    background: transparent;
  }
  .nav-hamburger__bars.is-open::before {
    top: 0;
    transform: rotate(45deg);
  }
  .nav-hamburger__bars.is-open::after {
    top: 0;
    transform: rotate(-45deg);
  }
  .nav-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-height);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-primary);
    padding: var(--space-2);
    z-index: 60;
  }
  .nav-menu.is-open {
    display: flex;
  }
  .nav-item__row {
    justify-content: space-between;
  }
  .nav-submenu {
    position: static;
    box-shadow: none;
    border: 0;
    background: var(--color-primary-dark);
    padding-left: var(--space-4);
  }
  /* Mobile submenu sits on a dark background — links must be light. */
  .nav-submenu a,
  .nav-mega a {
    color: var(--color-text-on-primary);
  }
  .nav-menu a:hover,
  .nav-toggle:hover,
  .nav-submenu a:hover,
  .nav-mega a:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--color-text-on-primary);
    text-decoration: underline;
  }
}

/* ============================================================
 * Topbar (utility strip above the main header)
 * ============================================================ */
.topbar {
  background: var(--color-primary-dark);
  color: var(--color-text-on-primary);
  font-size: var(--text-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding-block: var(--space-2);
  min-height: 36px;
}
.topbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
}
.topbar__line {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.topbar__label {
  color: var(--color-accent-on-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}
.topbar a {
  color: var(--color-text-on-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.topbar a:hover {
  color: var(--color-accent-on-primary);
}
.topbar__right {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}
.topbar__cta {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  font-weight: 600;
  text-decoration: underline;
}
@media (max-width: 640px) {
  /* Phones: drop phone + hours entirely; keep only the bill-pay links,
   * centered across the strip. */
  .topbar__left {
    display: none;
  }
  .topbar__inner {
    justify-content: center;
  }
  .topbar__right {
    justify-content: center;
    gap: var(--space-2) var(--space-6);
  }
}

/* ============================================================
 * Mega-menu (desktop) — full-width panel anchored to .site-header.
 * `.nav-item--mega` is set to position: static so .nav-mega skips it
 * and resolves to .site-header (relative).
 * ============================================================ */
.nav-item--mega {
  position: static;
}
.nav-mega {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-top: 4px solid var(--color-accent);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 50;
  padding: var(--space-8) 0;
}
/* Constrain the columns + footer CTA to the same gutter as the container. */
.nav-mega__grid,
.nav-mega__cta {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
/* Open state: JS toggles `is-open` on the parent .nav-item (hover, focus,
 * chevron tap, Esc/outside-click all key off the li), so the panel must
 * reveal from the ancestor. The bare .nav-mega.is-open is kept as a
 * belt-and-suspenders match in case the class is ever set on the panel. */
.nav-item--has-sub.is-open .nav-mega,
.nav-mega.is-open {
  display: block;
}
/* React state is the SOLE driver of mega open/close. Hover/focus opening is
 * handled by JS in PrimaryNav so we can enforce "one open at a time", give a
 * grace period for the gap between label and panel, and close on Esc / click-
 * outside / focus-leaving-tree. Pure CSS :hover/:focus-within made multiple
 * panels stick open. */
.nav-mega__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-6);
}
.nav-mega__col-title {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-text);
  border-bottom: 2px solid var(--color-border-subtle);
  padding-bottom: var(--space-1);
}
.nav-mega__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.nav-mega__col-list a {
  display: block;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius);
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
  min-height: var(--tap-target);
  line-height: 1.4;
}
.nav-mega__col-list a:hover,
.nav-mega__col-list a:focus-visible {
  background: var(--color-primary-tint);
  color: var(--color-link-hover);
  text-decoration: underline;
}
.nav-mega__col-list a[aria-current='page'] {
  background: var(--color-primary-tint);
  font-weight: 700;
}
.nav-mega__cta {
  display: inline-block;
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary-tint);
  color: var(--color-link);
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: underline;
}
.nav-mega__cta:hover {
  background: var(--color-accent-on-primary);
  color: var(--color-primary-dark);
}

/* Full-width mega-menu replaces per-item edge alignment — every panel
 * spans the header from left:0 to right:0, so no overflow correction needed. */

/* ============================================================
 * Mobile mega-menu — collapse to a single-column accordion
 * ============================================================ */
@media (max-width: 768px) {
  .nav-mega {
    position: static;
    width: auto;
    max-width: none;
    background: var(--color-primary-dark);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: var(--space-2) var(--space-4);
  }
  .nav-mega__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .nav-mega__col-title {
    color: var(--color-accent-on-primary);
    border-bottom-color: rgba(255, 255, 255, 0.18);
  }
  .nav-mega__col-list a {
    color: var(--color-text-on-primary);
  }
  .nav-mega__cta {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-text-on-primary);
  }
}

/* ============================================================
 * "Are You Looking for Something Specific?" CTA panel.
 * Now rendered inline inside the .quick-start grid (no overlap).
 * The card scales to fill its column.
 * ============================================================ */
.cta-search {
  /* No more negative margin / z-index overlap — sits in normal flow. */
}
.cta-search__container,
.cta-search > .container {
  /* Inside .quick-start the outer wrapper is unnecessary; the panel itself
   * carries the orange treatment. */
  display: contents;
}
.cta-search__panel {
  /* Hex-direct so axe's color-contrast walker has zero ambiguity. */
  background-color: #a0421a;
  color: #ffffff;
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-lg);
  /* No box-shadow — axe sometimes treats shadowed elements as ambiguous.
   * Block layout (not flex) — axe's contrast walker reads block ancestors
   * cleanly; flex column + gap was triggering needsFurtherReview. */
  width: 100%;
  height: 100%;
}
/* Background lives on the panel only — adding it to the text blocks made
 * them their own stacking context and axe got more confused, not less. */
.cta-search__eyebrow {
  margin: 0 0 var(--space-3);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}
.cta-search__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
}
.cta-search__subtitle {
  margin: 0 0 var(--space-6);
  font-size: 1.125rem;
  font-weight: 400;
  color: #fff7f0; /* ~10:1 on #a0421a */
  font-style: italic;
}
.cta-search__hint {
  margin: 0 0 var(--space-4);
  font-size: 0.875rem;
  color: #fff2e8; /* ~9.5:1 on #a0421a */
  line-height: 1.55;
}
.cta-search__form {
  display: flex;
  align-items: stretch;
  background: var(--color-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
}
.cta-search__form:focus-within {
  border-color: var(--color-accent-on-primary);
}
.cta-search__icon {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2) 0 var(--space-3);
  color: var(--color-text-muted);
}
.cta-search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-2);
  font: inherit;
  font-size: 1rem;
  border: 0;
  background: transparent;
  color: var(--color-text);
  outline: none;
}
.cta-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  padding: 0 var(--space-3);
  background: var(--color-cta);
  color: var(--color-text-on-primary);
  border: 0;
  cursor: pointer;
}
.cta-search__submit:hover {
  background: var(--color-cta-dark);
}

/* CTA panel already sized by its column in .quick-start; nothing special at
 * the 900px breakpoint. */

/* ============================================================
 * Home: hero carousel (image-left / text-right) — uses tokens
 * ============================================================ */
.hero-carousel {
  position: relative;
  background: var(--color-primary-dark);
  color: var(--color-text-on-primary);
  border-bottom: 4px solid var(--color-accent);
  overflow: hidden;
  /* Taller hero so it isn't shallow. 70vh with a sensible floor/ceiling. */
  min-height: clamp(28rem, 70vh, 44rem);
}
.hero-slide {
  display: none;
  align-items: stretch;
  min-height: clamp(28rem, 70vh, 44rem);
}
.hero-slide.is-active {
  display: flex;
}
.hero-slide__media {
  flex: 1 1 50%;
  background: linear-gradient(135deg, #1B3A5B 0%, #122A43 60%, #B8860B 200%);
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-slide__media--placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 40%,
    rgba(255, 228, 153, 0.28) 0%,
    rgba(255, 228, 153, 0) 50%
  );
}
.hero-slide__body {
  flex: 1 1 50%;
  background: var(--color-primary-dark);
  display: flex;
  align-items: center;
  /* Bleed to the viewport's right edge but inset the content so its right
   * edge meets the page container's right edge. padding-left clears the
   * absolutely-positioned control rail: rail margin-left (space-6) + rail
   * width (32px) + breathing gap (space-6) = ~5rem from the seam. */
  padding-block: var(--space-12);
  padding-left: 5rem;
  padding-right: max(var(--space-6), calc((100vw - var(--container-max)) / 2 + var(--space-4)));
}
.hero-slide__body-inner {
  width: 100%;
  /* Width caps at half the container, so the text column visually mirrors
   * the media half. */
  max-width: calc(var(--container-max) / 2 - var(--space-10));
}
.hero-carousel .hero__eyebrow {
  color: var(--color-accent-on-primary);
}
.hero-carousel .hero__title {
  font-size: clamp(1.625rem, 2.6vw, 2.25rem); /* 26–36px */
  margin: 0 0 var(--space-4);
  line-height: 1.2;
}
.hero-carousel .hero__lede {
  margin: 0 0 var(--space-6);
}

/* Vertical control rail — sits INSIDE the navy body panel, just to the right
 * of the seam (matches the WordBench reference). No pill / no background —
 * outlined chevrons and dots float directly on the dark panel. */
.hero-carousel__controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%);
  margin-left: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
  z-index: 5;
}
.hero-carousel__dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
}
/* Dots — small filled circles for inactive slides; active dot gets an
 * outlined ring around it. All white on the dark navy panel. */
.hero-carousel__dot {
  /* 24×24 hit area (WCAG 2.5.8 target), smaller visual marker centered inside. */
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.hero-carousel__dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  transform: translate(-50%, -50%);
  transition: background-color 0.12s ease;
}
.hero-carousel__dot:hover::after,
.hero-carousel__dot:focus-visible::after {
  background: #ffffff;
}
/* Active dot: outlined ring around it + brighter center. */
.hero-carousel__dot[aria-current='true']::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  transform: translate(-50%, -50%);
}
.hero-carousel__dot[aria-current='true']::after {
  background: #ffffff;
}
/* Up / down chevron + pause buttons. Outlined white circles on the navy
 * panel — no pill background. SVG icon inherits currentColor (white). */
.hero-carousel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font: inherit;
  cursor: pointer;
}
.hero-carousel__btn:hover,
.hero-carousel__btn:focus-visible {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
.hero-carousel__btn[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
}
.hero-carousel__sr {
  position: absolute;
  inset: auto auto 0 0;
}

@media (max-width: 900px) {
  .hero-slide {
    flex-direction: column;
  }
  .hero-slide__media {
    min-height: 12rem;
  }
  .hero-slide__body {
    /* Drop bottom padding on mobile — the carousel controls sit directly
     * below the body in normal flow and supply their own equal margin-block. */
    padding: var(--space-8) var(--space-6) 0;
    max-width: none;
  }
  /* Position the controls in normal document flow below the body so they
   * have EQUAL vertical padding (margin-block) above and below themselves —
   * no longer overlapping content. The body's own bottom padding is removed
   * on mobile to keep the spacing symmetric. */
  .hero-carousel__controls {
    position: static;
    transform: none;
    margin-block: var(--space-6);
    flex-direction: row;
    /* Center the whole control group horizontally in the slide. */
    justify-content: center;
    gap: var(--space-3);
  }
  /* Chevron buttons rotate so up→LEFT and down→RIGHT on mobile (matching
   * the horizontal row). The pause/play icon must stay upright. */
  .hero-carousel__btn:not(.hero-carousel__btn--pause) svg {
    transform: rotate(-90deg);
  }
  .hero-carousel__dots {
    flex-direction: row;
    gap: var(--space-2);
    padding: 0;
  }
}

/* ============================================================
 * Scope radio group on the /search refine form
 * ============================================================ */
.scope-radios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
}
.scope-radios__opt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-target);
  padding: 0 var(--space-2);
  font-weight: 500;
}

/* ============================================================
 * Search results list (shared by /documents + /search results)
 * ============================================================ */
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-result {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.search-result__kind {
  display: inline-block;
  margin-right: var(--space-2);
  padding: 0 var(--space-2);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.search-result__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 var(--space-1);
}
.search-result__excerpt {
  margin: 0;
  color: var(--color-text-muted);
}

/* ============================================================
 * Nav search trigger (magnifier icon) + Search modal
 * ============================================================ */
/* Match the hamburger's visual weight: 44×44, 2px solid white border,
 * 4px radius (var(--radius)). Same size, same treatment so the two icons
 * sit as a matched pair on the right of the header. */
.nav-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  margin-left: var(--space-2);
  color: var(--color-text-on-primary);
  background: transparent;
  border: 2px solid var(--color-text-on-primary);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-search-trigger:hover,
.nav-search-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}
/* Mobile: push the search + hamburger cluster to the right of the header.
 * Placed AFTER the unconditional .nav-search-trigger rule above so the
 * cascade picks this margin-left:auto up at ≤768px. */
@media (max-width: 768px) {
  .nav-search-trigger {
    margin-left: auto;
  }
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 42, 67, 0.78); /* navy scrim */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-12) var(--space-4) var(--space-4);
  overflow-y: auto;
}
.search-modal__panel {
  width: 100%;
  max-width: 36rem;
  background: var(--color-bg);
  color: var(--color-text);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: var(--space-6);
}
.search-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.search-modal__title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-primary);
}
.search-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
}
.search-modal__close:hover {
  background: var(--color-primary-tint);
}
.search-modal__form {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-modal__form:focus-within {
  border-color: var(--color-primary);
}
.search-modal__icon {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2) 0 var(--space-3);
  color: var(--color-text-muted);
}
.search-modal__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: var(--space-2);
  font: inherit;
  font-size: 1.0625rem;
  border: 0;
  background: transparent;
  color: var(--color-text);
  outline: none;
}
.search-modal__submit {
  border-radius: 0;
  border: 0;
  padding-inline: var(--space-6);
}
.search-modal__scopes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  border: 0;
  padding: var(--space-4) 0 0;
  margin: 0;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-subtle);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.search-chip input {
  /* The radio itself is hidden visually but available to the a11y tree;
   * the label provides the visible affordance. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  margin: -1px;
}
.search-chip:hover {
  border-color: var(--color-primary);
}
.search-chip:has(input:checked),
.search-chip input:checked ~ span {
  /* Selected state */
}
.search-chip:has(input:checked) {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border-color: var(--color-primary);
}
.search-chip input:focus-visible + span {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  border-radius: 2px;
}
.search-modal__hint {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.search-modal__hint kbd {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

@media (max-width: 480px) {
  .search-modal__form {
    flex-wrap: wrap;
  }
  .search-modal__input {
    width: 100%;
    flex-basis: 100%;
  }
  .search-modal__submit {
    width: 100%;
    border-top: 1px solid var(--color-border);
  }
}


/* ---------- WP-port additions ---------- */
/* The modal markup is always in the DOM here (the React version conditionally
 * rendered it) — the [hidden] attribute must beat the stylesheet display. */
.search-modal[hidden] {
  display: none;
}
