/*
 * WFP Header Module
 * Two-bar header: ink black top bar + red section bar below.
 *
 * Behavior:
 *   Desktop — static, scrolls with page
 *   Mobile  — sticky, stays at top
 *
 * Structure:
 *   .wfp-header                    — outer wrapper, ink bg, full bleed
 *     .wfp-header__inner           — wfp-container, top bar content
 *       .wfp-header__brand         — logo placeholder + site name
 *         .wfp-header__logo-slot   — icon placeholder
 *         .wfp-header__site-name   — Fraunces wordmark
 *       .wfp-header__nav           — primary nav menu
 *       .wfp-header__mobile-toggle — hamburger, mobile only
 *   .wfp-header__section-bar       — red bar, full bleed
 *     .wfp-header__section-inner   — wfp-container, section links
 */

/* =============================================================================
   OUTER WRAPPER
   ============================================================================= */

.wfp-header {
  background: var(--wfp-header-parchment);
  color: var(--base-2);
  position: static;
  z-index: 200;
  width: 100%;
}

/* Static desktop, sticky mobile */
@media (max-width: 782px) {
  .wfp-header {
    position: sticky;
    top: 0;
  }
}

/* =============================================================================
   TOP BAR INNER
   ============================================================================= */

.wfp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 68px;
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

/* =============================================================================
   BRAND — logo slot + site name
   ============================================================================= */

.wfp-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  flex-shrink: 0;
  text-decoration: none;
}

.wfp-header__brand:hover {
  text-decoration: none;
}

/* Logo placeholder — 40x40 square, press red accent
   Replace with <img> when logo is ready */
.wfp-header__logo-slot {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  color: #fff;
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.02em;
  /* Remove this block entirely when real logo is added */
}

.wfp-header__site-name {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  color: var(--contrast-2);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 72;
  text-decoration: none;
}

/* =============================================================================
   PRIMARY NAV
   ============================================================================= */

.wfp-header__nav {
  display: flex;
  align-items: center;
}

.wfp-header__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}

.wfp-header__nav a {
  display: block;
  padding: var(--space-2xs) var(--space-xs);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--contrast-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  border-radius: 4px;
  white-space: nowrap;
  transition: background var(--transition-2), color var(--transition-2);
}

.wfp-header__nav a:hover,
.wfp-header__nav .current-menu-item > a,
.wfp-header__nav .current-menu-ancestor > a {
  color: var(--contrast);
  background: hsl(0 0% 0% / 0.06);
}

/* =============================================================================
   MOBILE TOGGLE
   ============================================================================= */

.wfp-header__mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  transition: background var(--transition-2);
  flex-shrink: 0;
}

.wfp-header__mobile-toggle:hover {
  background: hsl(0 0% 100% / 0.1);
}

/* Hamburger icon via CSS */
.wfp-header__mobile-toggle span,
.wfp-header__mobile-toggle span::before,
.wfp-header__mobile-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  transition: transform var(--transition-2);
}

.wfp-header__mobile-toggle span::before,
.wfp-header__mobile-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}

.wfp-header__mobile-toggle span::before { top: -7px; }
.wfp-header__mobile-toggle span::after  { top: 7px; }

/* Open state */
.wfp-header__mobile-toggle[aria-expanded="true"] span {
  background: transparent;
}

.wfp-header__mobile-toggle[aria-expanded="true"] span::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.wfp-header__mobile-toggle[aria-expanded="true"] span::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* =============================================================================
   MOBILE NAV DRAWER
   ============================================================================= */

@media (max-width: 782px) {
  .wfp-header__mobile-toggle {
    display: flex;
  }

  .wfp-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--contrast);
    padding: var(--space-xs) var(--wfp-gutter) var(--space-m);
    border-top: 1px solid hsl(0 0% 100% / 0.08);
    z-index: 300;
  }

  .wfp-header__nav.is-open {
    display: block;
  }

  .wfp-header__nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .wfp-header__nav a {
    font-size: var(--step-0);
    padding: var(--space-xs) var(--space-s);
    border-radius: 4px;
  }
}

/* =============================================================================
   RED SECTION BAR
   ============================================================================= */

.wfp-header__section-bar {
  background: var(--accent);
  width: 100%;
  overflow: hidden;
}

.wfp-header__section-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wfp-header__section-inner::-webkit-scrollbar {
  display: none;
}

/* Strip default list styles from wp_nav_menu output */
.wfp-header__section-bar ul,
.wfp-header__section-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
}

.wfp-header__section-bar li {
  display: block;
}

/* Strip list styles from primary nav too */
.wfp-header__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3xs);
}

.wfp-header__nav li {
  display: block;
}

.wfp-header__section-bar a {
  display: block;
  padding: var(--space-2xs) var(--space-s);
  font-family: var(--font-ui);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(0 0% 100% / 0.9);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-2), border-color var(--transition-2), background var(--transition-2);
}

.wfp-header__section-bar a:hover,
.wfp-header__section-bar .current-menu-item > a {
  color: #fff;
  border-bottom-color: #fff;
  background: hsl(0 0% 0% / 0.08);
}

/* Hide section bar on mobile — nav drawer handles sections */
@media (max-width: 782px) {
  .wfp-header__section-bar {
    display: none;
  }
}

/* =============================================================================
   OVERRIDE base.css .site-header sticky
   GP's default header may still render — suppress it if present
   ============================================================================= */

.site-header {
  position: static;
}