/* ==========================================================================
   Site header — fixed, translucent, shrink-on-scroll, burger <=1080px
   ========================================================================== */

.ffb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: clamp(20px, 3vw, 40px);
  padding-block: 32px;
  background: var(--ffb-nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ffb-nav-border);
  box-shadow: none;
  transition: padding var(--ffb-t-header) var(--ffb-ease-shrink),
    box-shadow var(--ffb-t-header) ease,
    background-color var(--ffb-t-header) ease,
    border-color var(--ffb-t-header) ease;
}

/* Scrolled state, toggled with hysteresis by js/header.js. */
.ffb-header.is-shrunk {
  padding-block: 10px;
  box-shadow: var(--ffb-shadow-nav);
}

/* -------- Over a full-bleed hero --------
   Present from the server on $ffb_flush_top pages and re-added by
   js/header.js whenever the page is scrolled back to the very top: no
   surface, no blur, no rule — just inverted brand and links over the video. */

.ffb-header.home {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}

.ffb-header.home .ffb-header__wordmark,
.ffb-header.home .ffb-header__wordmark-accent,
.ffb-header.home .ffb-header__link.is-active {
  color: var(--ffb-nav-ink-invert);
  text-shadow: var(--ffb-nav-shadow-invert);
}

.ffb-header.home .ffb-header__link,
.ffb-header.home .ffb-header__powered {
  color: var(--ffb-nav-link-invert);
  text-shadow: var(--ffb-nav-shadow-invert);
}

.ffb-header.home .ffb-header__endorse {
  border-left-color: var(--ffb-nav-border-invert);
}

.ffb-header.home .ffb-header__link:hover {
  color: var(--ffb-nav-ink-invert);
}

.ffb-header.home .ffb-header__burger {
  border-color: var(--ffb-nav-border-invert);
}

.ffb-header.home .ffb-header__burger span {
  background: var(--ffb-nav-ink-invert);
}

/* -------- Brand --------
   Lockup 7b (handoff, 2026-10-27): wordmark | "Powered by" over the PVT
   logo. The gap before the divider equals the padding after it. */

.ffb-header__brand {
  --ffb-brand-gap: 30px;
  display: flex;
  align-items: center;
  gap: var(--ffb-brand-gap);
  flex: none;
  border-radius: var(--ffb-r-logo);
}

.ffb-header__endorse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-left: var(--ffb-brand-gap);
  border-left: 1.5px solid var(--ffb-outline-border);
  transition: border-color var(--ffb-t-header) ease;
}

.ffb-header__powered {
  font-family: var(--ffb-body);
  font-weight: 600;
  font-size: var(--ffb-eyebrow);
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ffb-nav-link);
  white-space: nowrap;
}

/* The colour and white logos are stacked in one grid cell and cross-faded, so
   the swap costs no layout and no second request at the moment of scroll. */
.ffb-header__mark {
  display: grid;
  flex: none;
}

.ffb-header__mark > * {
  grid-area: 1 / 1;
}

.ffb-header__logo {
  display: block;
  width: auto;
  height: 46px;
  transition: height var(--ffb-t-header) var(--ffb-ease-shrink),
    opacity var(--ffb-t-header) ease;
}

.ffb-header.is-shrunk .ffb-header__logo {
  height: 34px;
}

.ffb-header__logo--light {
  opacity: 0;
}

.ffb-header.home .ffb-header__logo--light {
  opacity: 1;
}

.ffb-header.home .ffb-header__logo:not(.ffb-header__logo--light) {
  opacity: 0;
}

.ffb-header__wordmark {
  font-family: var(--ffb-serif);
  font-weight: 700;
  font-size: var(--ffb-brand-size);
  line-height: 1;
  color: var(--ffb-navy-brand);
  white-space: nowrap;
}

.ffb-header__wordmark-accent {
  color: var(--ffb-blue);
}

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

.ffb-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ffb-header__nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.ffb-header__link {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 4px;
  font-family: var(--ffb-jakarta);
  font-weight: 600;
  font-size: var(--ffb-nav-size);
  white-space: nowrap;
  color: var(--ffb-nav-link);
  transition: color var(--ffb-t-fast) ease;
}

.ffb-header__link:hover {
  color: var(--ffb-nav-link-hover);
}

.ffb-header__link.is-active {
  color: var(--ffb-navy-brand);
  font-weight: 700;
}

.ffb-header__cta:first-of-type {
  margin-left: 32px;
}

/* -------- Burger -------- */

.ffb-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid var(--ffb-outline-border);
  border-radius: var(--ffb-r-pill);
  background: transparent;
}

.ffb-header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--ffb-navy-brand);
  transition: transform 0.3s ease, opacity var(--ffb-t-fast) ease;
}

.ffb-header__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ffb-header__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.ffb-header__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

.ffb-header__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 18px clamp(20px, 3vw, 24px) 24px;
  background: var(--ffb-menu-panel);
  border-bottom: 1px solid var(--ffb-nav-border);
  box-shadow: var(--ffb-shadow-menu);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--ffb-t-menu) ease, transform var(--ffb-t-menu) ease;
}

.ffb-header__menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.ffb-header__menu-link {
  padding: 12px 4px;
  border-radius: var(--ffb-r-logo);
  font-family: var(--ffb-jakarta);
  font-weight: 600;
  font-size: 16px;
  color: var(--ffb-nav-link);
}

.ffb-header__menu-link:hover {
  color: var(--ffb-navy-brand);
  background: #f1f5f3;
}

/* Matches .ffb-header__link.is-active above, so the panel marks the current
   page the same way the desktop row does. */
.ffb-header__menu-link.is-active {
  color: var(--ffb-navy-brand);
  font-weight: 700;
}

.ffb-header__menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ffb-header__menu-btn {
  padding: 14px 20px;
  border-radius: 4px;
  font-family: var(--ffb-jakarta);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  transition: background var(--ffb-t-ui) ease, border-color var(--ffb-t-ui) ease;
}

.ffb-header__menu-btn--outline {
  border: 2px solid var(--ffb-outline-border);
  color: var(--ffb-navy-brand);
}

.ffb-header__menu-btn--outline:hover {
  background: #ffffff;
  border-color: var(--ffb-outline-hover);
  color: var(--ffb-navy-brand);
}

.ffb-header__menu-btn--green {
  background: var(--ffb-green);
  color: var(--ffb-green-ink);
}

.ffb-header__menu-btn--green:hover {
  background: var(--ffb-green-hover);
  color: var(--ffb-green-ink);
}

/* -------- Breakpoints -------- */

/* Header collapses to the burger menu. */
@media (max-width: 1080px) {
  .ffb-header__nav,
  .ffb-header__cta {
    display: none;
  }

  .ffb-header__burger {
    display: flex;
  }

  .ffb-header__menu {
    display: flex;
  }
}

/* Permanently shrunk; smaller wordmark. */
@media (max-width: 420px) {
  .ffb-header {
    padding-block: 10px;
  }

  .ffb-header__logo {
    height: 30px;
  }

  .ffb-header__brand {
    --ffb-brand-gap: 14px;
  }

  .ffb-header__wordmark {
    font-size: var(--ffb-brand-size-tiny);
  }
  .ffb-header__burger {
    width: 38px;
    height: 38px;
  }
}

/* Endorsement hidden — wordmark only. */
@media (max-width: 375px) {
  .ffb-header__brand {
    --ffb-brand-gap: 10px;
  }

  .ffb-header__endorse {
    display: none;
  }
}
