/* ==========================================================================
   layout.css: header, navigation, mobile overlay, footer, grid primitives
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
              height 0.35s var(--ease);
}

/* Solid state: scrolled, or any page that isn't hero-over-header */
.site-header.is-solid,
.site-header--solid {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--hairline);
}

.site-header.is-solid { height: 72px; }

.site-header__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  margin-right: auto;
}

.logo__mark { flex: none; }
.logo__mark .mark-bg { fill: var(--papaya); transition: fill 0.35s var(--ease); }
.logo__mark .mark-fg { fill: var(--carbon); }

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.35s var(--ease);
}

.logo__sub {
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver);
  margin-top: 5px;
  transition: color 0.35s var(--ease);
}

.site-header.is-solid .logo__name,
.site-header--solid .logo__name { color: var(--carbon); }
.site-header.is-solid .logo__sub,
.site-header--solid .logo__sub { color: var(--graphite); }

@media (max-width: 420px) {
  .logo__sub { display: none; }
  .logo__name { font-size: 0.9375rem; }
}

/* --------------------------------------------------------------------------
   2. Desktop navigation
   -------------------------------------------------------------------------- */
.nav { display: none; }

@media (min-width: 1080px) {
  .nav { display: block; }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__item { position: relative; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.25s var(--ease);
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 2px;
  height: 2px;
  background: var(--papaya);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav__link:hover::after,
.nav__item:focus-within > .nav__link::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav__link:hover { color: var(--white); }
.nav__link[aria-current="page"] { color: var(--white); }

.site-header.is-solid .nav__link,
.site-header--solid .nav__link { color: var(--graphite); }
.site-header.is-solid .nav__link:hover,
.site-header--solid .nav__link:hover,
.site-header.is-solid .nav__link[aria-current="page"],
.site-header--solid .nav__link[aria-current="page"] { color: var(--carbon); }

.nav__chev { transition: transform 0.3s var(--ease); }
.nav__item:hover .nav__chev,
.nav__item:focus-within .nav__chev { transform: rotate(180deg); }

/* Dropdown */
.nav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 10px);
  min-width: 640px;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--papaya);
  padding: 32px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease-out), visibility 0.3s;
}

/* Hover bridge.
   The nav item is 41px tall inside an 84px header and the panel is offset a
   further 10px, leaving a measured 20px dead zone between them. Dragging the
   pointer down towards the panel crossed header space belonging to neither
   element, so mouseleave fired on .nav__item and the panel closed before it
   could be reached. This pseudo-element spans that gap. It belongs to the panel,
   which is a descendant of .nav__item, so hovering it keeps :hover on the item
   and never fires mouseleave. It is only hit-testable while the panel is open,
   because the closed panel is pointer-events: none.
   `bottom` resolves against the padding box, so the panel's 3px top border has
   to be added back or a 1px seam is left exactly on the item's bottom edge.
   Height covers the 10px open-state gap plus 2px of overlap. */
.nav__panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 3px);
  height: 12px;
}

.nav__item:hover > .nav__panel,
.nav__item:focus-within > .nav__panel,
.nav__panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav__panel--right { left: auto; right: 0; transform: translate(0, 10px); min-width: 380px; }
/* The shared open rule applies translate(-50%, 0), which is only correct for the
   centred panel. The two hover/focus selectors below out-specify it, but
   .nav__panel.is-open does not, so the keyboard path (site.js setOpen, which
   toggles .is-open) was shifting this panel half its width to the left. */
.nav__item:hover > .nav__panel--right,
.nav__item:focus-within > .nav__panel--right,
.nav__panel--right.is-open { transform: translate(0, 0); }

.nav__panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
}
.nav__panel--right .nav__panel-grid { grid-template-columns: 1fr; }

.nav__panel-link {
  display: block;
  padding: 13px 14px;
  border-left: 2px solid transparent;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav__panel-link:hover { background: var(--bone); border-left-color: var(--papaya); }

.nav__panel-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--carbon);
  line-height: 1.3;
}

.nav__panel-desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--graphite);
  margin-top: 4px;
}

.nav__panel-foot {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

/* Header actions */
.header__actions {
  display: none;
  align-items: center;
  gap: 20px;
  flex: none;
}
@media (min-width: 1080px) { .header__actions { display: flex; } }

.header__phone {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white);
  white-space: nowrap;
  transition: color 0.35s var(--ease);
}
.header__phone:hover { color: var(--papaya); }
.site-header.is-solid .header__phone,
.site-header--solid .header__phone { color: var(--carbon); }

@media (max-width: 1240px) { .header__phone { display: none; } }

/* --------------------------------------------------------------------------
   3. Mobile menu
   -------------------------------------------------------------------------- */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  align-items: flex-end;
  margin-left: auto;
  flex: none;
  z-index: 210;
}
@media (min-width: 1080px) { .menu-toggle { display: none; } }

.menu-toggle span {
  display: block;
  height: 2px;
  width: 26px;
  background: var(--white);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease), width 0.35s var(--ease), background 0.35s var(--ease);
}
.menu-toggle span:nth-child(2) { width: 18px; }

.site-header.is-solid .menu-toggle span,
.site-header--solid .menu-toggle span { background: var(--carbon); }

.menu-toggle[aria-expanded="true"] span { background: var(--white); width: 26px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--carbon);
  padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease-out), visibility 0.4s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }

body.menu-open { overflow: hidden; }

.mobile-menu__list { border-top: 1px solid var(--hairline-dk); }

.mobile-menu__item { border-bottom: 1px solid var(--hairline-dk); }

.mobile-menu__link,
.mobile-menu__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 22px 2px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
  text-align: left;
}

.mobile-menu__btn .nav__chev { transition: transform 0.3s var(--ease); color: var(--papaya); }
.mobile-menu__btn[aria-expanded="true"] .nav__chev { transform: rotate(180deg); }

.mobile-menu__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-out);
}
.mobile-menu__sub > div { overflow: hidden; }
.mobile-menu__btn[aria-expanded="true"] + .mobile-menu__sub { grid-template-rows: 1fr; }

.mobile-menu__sublink {
  display: block;
  padding: 13px 0 13px 18px;
  border-left: 2px solid var(--hairline-dk);
  font-size: 0.9375rem;
  color: var(--silver);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.mobile-menu__sublink:hover { color: var(--white); border-left-color: var(--papaya); }
.mobile-menu__sub > div > :last-child { margin-bottom: 20px; }

.mobile-menu__foot { margin-top: 40px; display: grid; gap: 18px; }
.mobile-menu__contact {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
}
.mobile-menu__contact a { color: var(--papaya); }

/* --------------------------------------------------------------------------
   4. Grid primitives
   -------------------------------------------------------------------------- */
/* Grid items default to min-width:auto, which lets a wide max-width or a wide
   descendant (a table, a long token) inflate the track past the viewport.
   Every grid container in this site opts its children out. */
.grid > *,
.article-layout > *,
.hero__grid > *,
.hero__aside > *,
.page-hero__grid > *,
.section-head--split > *,
.cta-band__inner > *,
.footer__top > *,
.author-box > *,
.form__row > *,
.inclusions > *,
.statband > *,
.postnav > *,
.timeline__item > * { min-width: 0; }

.grid { display: grid; gap: var(--grid-gap); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.grid--split { grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) {
  .grid--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 6vw, 96px); }
}

/* --------------------------------------------------------------------------
   5. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--carbon);
  color: var(--silver);
  padding-top: clamp(64px, 8vw, 112px);
  border-top: 3px solid var(--papaya);
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-bottom: clamp(48px, 6vw, 80px);
}

@media (min-width: 720px) {
  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .footer__top { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--grid-gap); }
}

.footer__brand .logo { margin-right: 0; }
.footer__brand .logo__name { color: var(--white); }
.footer__brand .logo__sub { color: var(--silver); }

.footer__blurb {
  margin-top: 24px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--silver);
  max-width: 38ch;
}

.footer__social { display: flex; gap: 10px; margin-top: 28px; }

.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--hairline-dk);
  color: var(--silver);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer__social a:hover { background: var(--papaya); color: var(--carbon); border-color: var(--papaya); }

.footer__heading {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 22px;
}

.footer__list { display: grid; gap: 6px; }

/* Measured 20px tall before the min-height; navigation links are not "inline in
   a sentence", so they owe the 24x24 minimum. */
.footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-size: var(--fs-sm);
  color: var(--silver);
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.footer__list a:hover { color: var(--papaya); padding-left: 5px; }

.footer__contact { display: grid; gap: 20px; font-size: var(--fs-sm); }

.footer__contact-row { display: flex; gap: 13px; align-items: flex-start; }
.footer__contact-row svg { flex: none; align-self: flex-start; margin-top: 5px; color: var(--papaya); }
.footer__contact-row a { color: var(--silver); transition: color 0.25s var(--ease); }
.footer__contact-row a:hover { color: var(--papaya); }
.footer__contact-row address { font-style: normal; line-height: 1.65; }

.footer__disclaimer {
  border-top: 1px solid var(--hairline-dk);
  padding-block: 32px;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: #7C8287;
  max-width: 100ch;
}

.footer__bottom {
  border-top: 1px solid var(--hairline-dk);
  padding-block: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: #7C8287;
}

.footer__legal { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  transition: color 0.25s var(--ease);
}
.footer__legal a:hover { color: var(--papaya); }

/* --------------------------------------------------------------------------
   6. Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
}
.breadcrumb li { display: flex; align-items: center; gap: 10px; }
.breadcrumb li + li::before { content: "/"; color: var(--papaya); }
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--silver);
  transition: color 0.25s var(--ease);
}
.breadcrumb a:hover { color: var(--white); }
.breadcrumb [aria-current] { color: var(--white); }

.breadcrumb--light a { color: var(--graphite); }
.breadcrumb--light a:hover { color: var(--carbon); }
.breadcrumb--light [aria-current] { color: var(--carbon); }
