/*
 * Firefighter Pfister — site chrome (Nav, Footer, Wordmark)
 *
 * Nav and Footer carry data-theme="dark" on the element itself rather than
 * inheriting the page theme, which is what lets them run dark inside an
 * otherwise-light page.
 */

/* ---------------------------------------------------------------- *
 * Wordmark
 * ---------------------------------------------------------------- */

.wordmark {
  display: block;
  /* 58px in the mobile nav, 96px on desktop — both from the Figma variants. */
  width: 58px;
  height: auto;
  flex-shrink: 0;
  /* Artwork is fixed; colour is the only permitted change. */
  color: var(--accent-solid);
}

@media (min-width: 1000px) {
  .wordmark {
    width: 96px;
  }
}

.wordmark--bone {
  color: var(--bone-100);
}

.wordmark svg {
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------- *
 * Nav
 * ---------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 64px;
  padding-inline: var(--layout-gutter);
  background: color-mix(in srgb, var(--bg-page) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 7px rgb(0 0 0 / 0.18);
  color: var(--text-primary);
}

@media (min-width: 1000px) {
  .nav {
    height: 103px;
    padding-inline: var(--space-xl);
  }
}

/* Browsers without backdrop-filter get an opaque bar instead of a milky one. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--bg-page);
  }
}

.nav__middle {
  display: none;
}

/*
 * The right cell is an empty spacer on desktop, sized to match the wordmark so
 * the centre cell centres against the bar rather than against the wordmark.
 */
.nav__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (min-width: 1000px) {
  .nav__middle {
    display: flex;
    flex: 1 0 0;
    min-width: 0;
    align-items: center;
    justify-content: center;
  }

  .nav__right {
    width: 96px;
  }
}

.nav__items {
  display: flex;
  align-items: center;
  gap: 44px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-item::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: transparent;
  transition: background-color 150ms ease;
}

.nav-item:hover::after {
  background: var(--border-strong);
}

.nav-item[aria-current="page"] {
  color: var(--text-accent);
}

.nav-item[aria-current="page"]::after {
  background: var(--accent-solid);
}

@media (prefers-reduced-motion: reduce) {
  .nav-item::after {
    transition: none;
  }
}

/* ---- Mobile menu ------------------------------------------------ */

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

@media (min-width: 1000px) {
  .nav__toggle {
    display: none;
  }
}

/*
 * Icon is 20x16 per Figma; the button around it stays 44x44 so the touch
 * target clears the minimum.
 */
.nav__toggle svg {
  width: 20px;
  height: 16px;
}

.nav__toggle .icon-close,
.nav__toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav__toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/*
 * The panel is fixed and overlays the page — the brief is explicit that the
 * expanded menu must cover content rather than push it down.
 */
.nav__panel {
  position: fixed;
  inset: 64px 0 auto 0;
  display: none;
  flex-direction: column;
  padding: 0 var(--layout-gutter) var(--space-lg);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.24);
}

.nav__panel[data-open="true"] {
  display: flex;
}

@media (min-width: 1000px) {
  .nav__panel {
    display: none;
  }
}

.nav__panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__panel a {
  display: block;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: var(--lh-nav);
  letter-spacing: var(--tr-nav);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-primary);
}

.nav__panel a[aria-current="page"] {
  color: var(--text-accent);
}

.nav__panel li:last-child a {
  border-bottom: 0;
}

/* ---------------------------------------------------------------- *
 * Footer
 * ---------------------------------------------------------------- */

.footer {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--layout-gutter);
  background: var(--bg-page);
  color: var(--text-primary);
}

@media (min-width: 1000px) {
  .footer {
    padding-inline: var(--space-xl);
  }
}
