/* ==========================================================================
   Header v2 (Phase 2 Rebrand)
   Figma: file cwxEZbhw0xAPkTtvQloQA6, node 6012-11557 (bar, desktop 1440).
   Enqueued only on pages opted in via stampli_header_v2_variant().
   Variants:
     .header-v2--light  transparent bar over a blue hero (white logo/text)
     .header-v2--dark   white bar over a white background (#1e3c74 text)
   .header-v2--scrolled (added by the inline script past 60px) makes the
   light variant adopt the dark treatment for legibility.

   NOTE ON SPECIFICITY: the site carries Customizer "Additional CSS" that
   styles the current header with !important (e.g. `body header{background:#fff
   !important}`, `#nav.navMain > ul > li > .menu-link{... !important}`). That
   CSS is printed AFTER enqueued stylesheets, so every property it contests
   must be declared here with BOTH higher specificity and !important.
   ========================================================================== */

/* Aeonik (self-hosted, copied from the Phase 2 staging uploads) */
@font-face {
  font-family: 'Aeonik';
  src: url('../fonts/aeonik-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('../fonts/aeonik-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('../fonts/aeonik-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Variant state variables.
   Light: transparent over blue hero. Dark (and light-scrolled): white bar.
   -------------------------------------------------------------------------- */
header.header-v2--light {
  --hv2-bg: transparent;
  --hv2-text: #ffffff;
  --hv2-border: rgba(192, 220, 251, 0.5);
  --hv2-contact-bg: rgba(255, 255, 255, 0.2);
  --hv2-contact-border: rgba(255, 255, 255, 0.5);
  --hv2-contact-text: #ffffff;
  /* white chevron */
  --hv2-caret-filter: brightness(0) invert(1);
  --hv2-hamburger: #ffffff;
  --hv2-burger-bg: rgba(255, 255, 255, 0.2);
  --hv2-login-arrow: #ffffff;
  --hv2-link-hover: #c0dcfb;
  --hv2-contact-hover-bg: rgba(255, 255, 255, 0.3);
  --hv2-contact-hover-border: rgba(255, 255, 255, 0.6);
}
header.header-v2--dark,
header.header-v2--light.header-v2--scrolled {
  --hv2-bg: #ffffff;
  --hv2-text: #1e3c74;
  --hv2-border: #c0dcfb;
  --hv2-contact-bg: #0088f7;
  --hv2-contact-border: #0088f7;
  --hv2-contact-text: #ffffff;
  /* #1e3c74 chevron (same filter chain the theme already uses) */
  --hv2-caret-filter: brightness(0) saturate(100%) invert(20%) sepia(10%) saturate(7295%) hue-rotate(195deg) brightness(95%) contrast(93%);
  --hv2-hamburger: #1e3c74;
  --hv2-burger-bg: #e8f2fe;
  /* Figma 5650-15999: CTA-blue arrow on the white bar */
  --hv2-login-arrow: #0088f7;
  --hv2-link-hover: #0088f7;
  --hv2-contact-hover-bg: #006fd6;
  --hv2-contact-hover-border: #006fd6;
}

/* --------------------------------------------------------------------------
   Bar (beats Customizer `body header { background/border/box-shadow !important }`)
   -------------------------------------------------------------------------- */
body header.banner.header-v2 {
  background: var(--hv2-bg) !important;
  border-bottom: 1px solid var(--hv2-border) !important;
  box-shadow: none !important;
  transition: background-color 0.25s ease, border-color 0.25s ease !important;
}
/* the theme's own .banner::after 1px line would double the border */
body header.banner.header-v2::after {
  display: none !important;
}

/* Beats Customizer `header.banner > .container { max-width/padding !important }`.
   1440 frame + 96px padding (Figma). Rails sit at max(72px, 50% - 648px), so
   the logo stays 24px inside them across the whole desktop range. */
body.header-v2-page header.banner.header-v2 > .container {
  max-width: 1440px !important;
  padding: 0 96px !important;
}
/* Tablet frame (Figma 6025-9139): logo/hamburger 32px from the edges.
   Mobile frame (Figma 6045-14150): 16px. Bar stays 76px at every width. */
@media (max-width: 1024px) {
  body.header-v2-page header.banner.header-v2 > .container {
    padding: 0 32px !important;
  }
}
@media (max-width: 767px) {
  body.header-v2-page header.banner.header-v2 > .container {
    padding: 0 16px !important;
  }
}

/* Hamburger per Figma "Component 98": 40x40 hit area, 20px three-line glyph.
   (Colors already follow --hv2-hamburger: white on light, navy on dark/scrolled.) */
header.header-v2 #mobile-toggler {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  /* Figma: glass rounded box (white 20% on light, soft blue on dark/scrolled) */
  background: var(--hv2-burger-bg) !important;
  border-radius: 10px !important;
  border: none;
  transition: background-color 0.25s ease;
}
/* display only below the desktop breakpoint — never override Tailwind's
   lg:hidden with an unscoped display value */
@media (max-width: 1024px) {
  header.header-v2 #mobile-toggler {
    display: inline-flex;
  }
}
header.header-v2 #mobile-toggler .hamburger-box {
  width: 20px;
  height: 14px;
  display: inline-block;
  position: relative;
}
header.header-v2 #mobile-toggler .hamburger-inner {
  top: 0;
  margin: 0;
}
header.header-v2 #mobile-toggler .hamburger-inner,
header.header-v2 #mobile-toggler .hamburger-inner::before,
header.header-v2 #mobile-toggler .hamburger-inner::after {
  width: 20px;
  height: 2px;
  border-radius: 1px;
}
header.header-v2 #mobile-toggler .hamburger-inner::before {
  top: 6px;
}
header.header-v2 #mobile-toggler .hamburger-inner::after {
  top: 12px;
}
/* Open state: the stock hamburger--slider X assumes 10px bar spacing — redo
   the transforms for this 6px geometry so the bars form a proper X */
header.header-v2 #mobile-toggler.is-active .hamburger-inner {
  transform: translateY(6px) rotate(45deg) !important;
}
header.header-v2 #mobile-toggler.is-active .hamburger-inner::before {
  opacity: 0 !important;
  transform: none !important;
}
header.header-v2 #mobile-toggler.is-active .hamburger-inner::after {
  transform: translateY(-12px) rotate(-90deg) !important;
}

/* The mobile nav panel is positioned for the OLD 66px header — align it (and
   its backdrop) to the 76px v2 bar (+1px border) */
body.header-v2-page .nav-mobile-wrap {
  top: 77px !important;
  height: calc(100% - 77px) !important;
  max-height: calc(100% - 77px) !important;
}
body.header-v2-page .nav-mobile-backdrop {
  top: 77px !important;
}
body.header-v2-page header.banner.header-v2 > .container > div {
  height: 76px !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Logo (108x21, white asset on light, color asset otherwise)
   -------------------------------------------------------------------------- */
header.header-v2 .header-v2__logo {
  width: 108px;
  height: 21px;
  display: none;
}
header.header-v2--dark .header-v2__logo--color,
header.header-v2--light.header-v2--scrolled .header-v2__logo--color,
header.header-v2--light:not(.header-v2--scrolled) .header-v2__logo--white {
  display: block;
}

/* --------------------------------------------------------------------------
   Top-level nav items (dropdown panels themselves stay untouched).
   Double-id path (#nav #main-nav) beats the Customizer's
   `#nav.navMain > ul > li > .menu-link { ... !important }`.
   -------------------------------------------------------------------------- */
body header.header-v2 #nav #main-nav > li > a {
  color: var(--hv2-text) !important;
  font-family: 'Aeonik', 'Lato', sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: 0.3px !important;
  line-height: 20px !important;
  transition: color 0.25s ease !important;
}
body header.header-v2 #nav #main-nav > li > a:hover {
  color: var(--hv2-link-hover) !important;
}
/* every item, including .menu-item-4 (Company) which older site CSS singles out */
body header.header-v2 #nav #main-nav > li > a::after {
  filter: var(--hv2-caret-filter) !important;
}

/* --------------------------------------------------------------------------
   Right side: "Log in ->" link + "Contact" button
   -------------------------------------------------------------------------- */
body header.header-v2 .menu-buttons.header-v2__buttons {
  display: flex;
  align-items: center;
  gap: 24px !important;
  margin: 0 !important;
  padding: 0;
  list-style: none;
}
header.header-v2 .header-v2__buttons li {
  margin: 0;
}
header.header-v2 .header-v2__login,
header.header-v2 .header-v2__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Aeonik', 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 20px;
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
header.header-v2 .header-v2__login {
  color: var(--hv2-text);
}
header.header-v2 .header-v2__login:hover {
  color: var(--hv2-link-hover);
}
header.header-v2 .header-v2__login svg {
  width: 14px;
  height: 14px;
  /* Figma: arrow points diagonally up-right */
  transform: rotate(-45deg);
  /* fill=currentColor: white over the transparent bar, CTA blue over white */
  color: var(--hv2-login-arrow, currentColor);
  transition: color 0.25s ease;
}
header.header-v2 .header-v2__contact {
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid var(--hv2-contact-border);
  background-color: var(--hv2-contact-bg);
  color: var(--hv2-contact-text);
}
header.header-v2 .header-v2__contact:hover {
  background-color: var(--hv2-contact-hover-bg);
  border-color: var(--hv2-contact-hover-border);
}

/* --------------------------------------------------------------------------
   Hamburger (mobile). Beats Customizer
   `body header #mobile-toggler .hamburger-inner { ... !important }`.
   -------------------------------------------------------------------------- */
body header.banner.header-v2 #mobile-toggler .hamburger-inner,
body header.banner.header-v2 #mobile-toggler .hamburger-inner::before,
body header.banner.header-v2 #mobile-toggler .hamburger-inner::after {
  background-color: var(--hv2-hamburger) !important;
}

/* --------------------------------------------------------------------------
   Body offset. The theme/Customizer push content below the fixed bar
   (e.g. `body:not(.home):not(.logged-in){padding-top:40px !important}`);
   `html body.x.y` outranks those :not() chains. Light = hero flows under
   the transparent bar; dark = content starts at the 76px bar edge.
   -------------------------------------------------------------------------- */
html body.header-v2-page.header-v2-page--light {
  padding-top: 0 !important;
}
html body.header-v2-page.header-v2-page--light .wrap {
  padding-top: 0 !important;
}
html body.header-v2-page.header-v2-page--dark {
  padding-top: 76px !important;
}
html body.header-v2-page.header-v2-page--dark .wrap {
  padding-top: 0 !important;
}

/* --------------------------------------------------------------------------
   Phase 2 pages are built full-bleed in Elementor; release the theme's
   content container (the site does this per-page via Elementor custom CSS
   elsewhere, e.g. post-175459.css — v2 pages get it automatically).
   -------------------------------------------------------------------------- */
body.header-v2-page .wrap.container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* --------------------------------------------------------------------------
   Phase 2 wireframe guides ("Baby blue transparent 50%" in Figma).
   Vertical rails flank the content on EVERY v2 page (Figma: x=72/x=1368 on
   the 1440 frame = 32px outside the 1232 content), spanning hero -> footer;
   the footer partial draws its own matching rails, so they read as one line.
   Horizontal separators are opt-in per Elementor container: add the CSS
   class "p2-guide-top" to draw the 1px line at the container's top edge.
   -------------------------------------------------------------------------- */
body.header-v2-page .wrap {
  position: relative;
}
body.header-v2-page .wrap::before,
body.header-v2-page .wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(192, 220, 251, 0.5);
  pointer-events: none;
  z-index: 20;
}
/* Rail spec: desktop >1024 = 72px from the edge (drifting outward past 1440
   as the grid stays capped); tablet <=1024 = 16px; mobile <768 = hidden. */
body.header-v2-page .wrap::before {
  left: max(72px, calc(50% - 648px));
}
body.header-v2-page .wrap::after {
  right: max(72px, calc(50% - 648px));
}
/* the rails are NOT part of the header: on light pages the wrap starts at the
   page top (behind the transparent bar), so start them below the 76px header */
body.header-v2-page--light .wrap::before,
body.header-v2-page--light .wrap::after {
  top: 76px;
}
body.header-v2-page .p2-guide-top {
  position: relative;
}
body.header-v2-page .p2-guide-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: max(72px, calc(50% - 648px));
  right: max(72px, calc(50% - 648px));
  height: 1px;
  background: rgba(192, 220, 251, 0.5);
  pointer-events: none;
  z-index: 20;
}
@media (max-width: 1024px) {
  body.header-v2-page .wrap::before,
  body.header-v2-page .wrap::after,
  body.header-v2-page .p2-guide-top::before {
    left: 16px;
    right: 16px;
  }
  body.header-v2-page .wrap::before {
    right: auto;
  }
  body.header-v2-page .wrap::after {
    left: auto;
  }
}
@media (max-width: 767px) {
  body.header-v2-page .wrap::before,
  body.header-v2-page .wrap::after {
    display: none;
  }
}

/* Base 24px side padding already applies at every width (grid-aligned). */
