/* === HEADER ===
   Shared component. Transparent over the hero with a top-down gradient scrim
   (rgba(0,0,0,.45) → transparent); darkens to a solid backdrop on scroll.
   Measured: height 112px; nav text helvetica-bold 13px / letter-spacing .65px / white,
   hover+active #FF840B; JOIN US pill 2px solid #BD5117, radius 20px, transparent, 14px.
   INTERACTION (faithful to Wix scrim, scrape/header-scrim-iframe.html):
     • State2 — scroll DOWN: background animates to rgba(0,0,0,0.75) over 2s ease.
     • State1 — back at TOP: reverts to the gradient scrim INSTANTLY (0s).
   The asymmetric timing is reproduced via a per-state `transition`: the base rule uses
   0s (instant revert) and the .scrolled rule uses 2s (slow darken). */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 84px;                        /* resting: thinner bar */
  display: flex;
  align-items: center;
  background: linear-gradient(rgba(0,0,0,0.62), rgba(0,0,0,0));   /* darker resting gradient */
  transition: height 0.5s ease, background 0s ease;   /* State1: instant bg revert; height 0.5s */
}
.site-header.scrolled {
  height: 60px;                        /* pinned: shrinks to a thin dark bar */
  background: rgba(0,0,0,0.85);
  transition: height 0.5s ease, background 2s ease;   /* State2: 0.5s shrink; slow 2s darken */
}
/* logo scales to 0.9 on scroll (matches Wix timeline: logo shrinks + content nudges up) */
.header-logo img { transition: transform 0.5s ease; transform-origin: left center; }
.site-header.scrolled .header-logo img { transform: scale(0.9); }
/* When the mobile menu is open, the bar gets a solid dark backdrop so the logo + X read
   cleanly over the overlay (set after .scrolled so it wins at equal specificity). */
.site-header.menu-open { background: #0d0f16; transition: background 0.2s ease; }

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo { display: block; }
.header-logo img { width: 191px; height: 37px; }

.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav .nav-list { display: flex; align-items: center; gap: 34px; }
.nav-item { position: relative; }
.nav-link {
  display: block;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.65px;
  color: #ffffff;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-link:hover,
.nav-item:hover > .nav-link,
.nav-link.active { color: var(--orange-bright); }
/* Resources parent is a non-navigating menu label (span) — still show it as interactive */
span.nav-link { cursor: pointer; }

/* Opportunities dropdown (original shows no caret on desktop — hover-only) */
.dropdown {
  position: absolute;
  top: calc(100% + 18px);
  left: 0;
  min-width: 170px;
  background: rgba(18,21,30,0.96);
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.has-dropdown:hover > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* bridge the gap so hover doesn't drop */
.dropdown::before { content: ''; position: absolute; top: -18px; left: 0; right: 0; height: 18px; }

.dropdown-item { position: relative; }
.dropdown-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.65px;
  color: #ffffff;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-item > a:hover { background: rgba(255,255,255,0.07); color: var(--orange-bright); }
.has-flyout > a::after {
  content: '›';
  font-size: 16px;
  line-height: 1;
  opacity: 0.8;
}

/* Nested flyout (OTR / Regional → driver types) */
.flyout {
  position: absolute;
  top: -8px;
  left: 100%;
  min-width: 170px;
  background: rgba(18,21,30,0.96);
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.has-flyout:hover > .flyout { opacity: 1; visibility: visible; transform: translateX(0); }
.flyout > li > a {
  display: block;
  padding: 9px 20px;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.65px;
  color: #ffffff;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.flyout > li > a:hover { background: rgba(255,255,255,0.07); color: var(--orange-bright); }

/* JOIN US pill */
.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border: 2px solid var(--orange);
  border-radius: 20px;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.4px;
  color: #ffffff;
  transition: border-width 0.18s ease, border-color 0.18s ease;
}
/* hover: border thickens 2px → 4px (matches original), bg stays transparent */
.join-btn:hover { border-width: 4px; }

/* Mobile hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: #fff; transition: transform 0.25s ease, opacity 0.25s ease; }
/* Open state: the three bars morph into an X (bar gap is 5px + 2px height ≈ 7px between centers) */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Header responsive (tablet / mobile) --- */
@media (max-width: 1024px) {
  .header-inner { padding: 0 24px; }
  .main-nav .nav-list { gap: 22px; }
  .main-nav { gap: 22px; }
}
@media (max-width: 860px) {
  .site-header { height: 64px; }
  .header-logo img { width: 158px; height: auto; }
  .nav-toggle { display: flex; }

  /* Full-screen dark overlay (was a translucent top dropdown that let the hero + page
     bleed through). Slides down from under the fixed header and fills the viewport;
     the header keeps z-index 100 so the logo + X stay above and tappable. */
  .main-nav {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #0d0f16;
    padding: 8px 0 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-110%);
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }

  /* Top-level rows, separated by hairline dividers */
  .nav-item { border-bottom: 1px solid rgba(255,255,255,0.07); }
  .nav-link { padding: 17px 24px; font-size: 16px; letter-spacing: 0.4px; }

  /* --- Progressive disclosure -------------------------------------------------------
     Submenus start COLLAPSED; tapping a parent row expands it (JS toggles .expanded on
     the parent <li>). The grid-rows 0fr→1fr trick animates height with no JS measuring
     and nests cleanly — opening a child flyout grows its ancestor automatically. So the
     menu opens showing only HOME / Hiring Map / Opportunities / Resources, not 17 links. */
  .has-dropdown, .has-flyout {
    display: grid;
    grid-template-rows: auto 0fr;
    transition: grid-template-rows 0.3s ease;
  }
  .has-dropdown.expanded, .has-flyout.expanded { grid-template-rows: auto 1fr; }
  .dropdown, .flyout {
    position: static;
    min-height: 0; overflow: hidden;              /* required for the grid collapse */
    opacity: 1; visibility: visible; transform: none;
    background: transparent; box-shadow: none; border-radius: 0; padding: 0; min-width: 0;
  }
  .dropdown::before { display: none; }

  /* Rotating chevron on expandable parents (replaces the desktop ▾ / ›) */
  .has-dropdown > .nav-link, .has-flyout > a { position: relative; }
  .has-dropdown > .nav-link::after,
  .has-flyout > a::after {
    content: '';
    position: absolute; right: 26px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.3s ease;
    opacity: 0.65;
  }
  .has-dropdown.expanded > .nav-link::after,
  .has-flyout.expanded > a::after { transform: translateY(-35%) rotate(-135deg); }

  /* Second-level rows (OTR, Regional, Local, Driver Hub, FAQs, About Us) */
  .dropdown-item > a {
    padding: 14px 24px 14px 40px;
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  /* Third-level driver links under OTR / Regional */
  .flyout > li > a {
    padding: 12px 24px 12px 56px;
    font-size: 14px;
    color: rgba(255,255,255,0.62);
    border-top: 1px solid rgba(255,255,255,0.05);
  }

  /* JOIN US — full-width CTA at the foot of the menu */
  .join-btn { margin: 24px 24px 4px; padding: 15px; font-size: 15px; }
}
