/* Keep Salient's native header/footer markup and navigation, while presenting
 * it in the same visual language as the supplied HTML header/footer. */
#header-outer {
  background: #f4faff !important;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #0397d2, #1249d2, #694af0) 1;
  box-shadow: 0 8px 24px rgba(3, 87, 124, .06) !important;
}

body #header-outer.transparent {
  background: #f4faff !important;
  border-bottom-color: transparent !important;
}

#header-secondary-outer {
  display: block !important;
  background: linear-gradient(90deg, #003b50, #005a78 48%, #0397d2) !important;
  color: #fff !important;
}

#header-secondary-outer a,
#header-secondary-outer li,
#header-secondary-outer .nectar-center-text {
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* Salient's secondary menu normally floats its list.  Use the same stable
 * left-aligned contact layout as the reference HTML top bar. */
#header-secondary-outer .container {
  /* Match the navigation container, so the first contact item starts exactly
   * above the logo rather than from an independent, narrower grid. */
  width: min(1320px, calc(100% - 48px)) !important;
  max-width: 1320px !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
}

#header-secondary-outer nav,
#header-secondary-outer nav > ul.sf-menu {
  display: flex !important;
  align-items: center !important;
  float: none !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#header-secondary-outer nav > ul.sf-menu > li {
  display: block !important;
  float: none !important;
  margin: 0 28px 0 0 !important;
  line-height: 40px !important;
}

#header-secondary-outer nav > ul.sf-menu > li > a {
  display: inline-flex !important;
  align-items: center !important;
  height: 40px !important;
  line-height: 1 !important;
}

#header-outer #top {
  background: #f4faff !important;
  min-height: 88px !important;
}

#header-outer #top .container {
  width: min(1320px, calc(100% - 48px)) !important;
  max-width: 1320px !important;
  min-height: 88px !important;
}

#header-outer #logo img {
  /* Match the compact logo scale from the supplied HTML navigation. */
  width: 128px !important;
  height: auto !important;
  max-height: 42px !important;
}

#header-outer #top nav > ul > li > a {
  color: #434d53 !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

/* Reset Salient's floated grid just for the desktop masthead.  Its default
 * column widths were making labels wrap and leaving an empty lower half. */
@media (min-width: 1000px) {
  /* Use one clear, consistent chevron for every top-level dropdown. Salient's
   * icon markup differs by menu item and was leaving a broken glyph beside
   * certain labels. */
  #header-outer #top nav > ul > li.menu-item-has-children > a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > a .sf-sub-indicator {
    display: none !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > a::after {
    content: '' !important;
    display: inline-block !important;
    width: 6px !important;
    height: 6px !important;
    margin: -3px 0 0 1px !important;
    border-right: 1.75px solid currentColor !important;
    border-bottom: 1.75px solid currentColor !important;
    transform: rotate(45deg) !important;
    transition: transform .2s ease !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children:hover > a::after,
  #header-outer #top nav > ul > li.menu-item-has-children.sfHover > a::after {
    transform: rotate(225deg) translate(-2px, -2px) !important;
  }

  /* A Salient submenu is normally positioned from its individual menu item.
   * Keep the large card panels centred in the viewport instead. */
  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu {
    position: fixed !important;
    /* Salient adds its own 30px dropdown offset; compensate so the panel
     * begins directly below the visible navigation row. */
    top: calc(var(--header-height, 130px) + var(--wp-admin--admin-bar--height, 0px) - 30px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-height: calc(100vh - var(--header-height, 130px) - var(--wp-admin--admin-bar--height, 0px) - 20px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin !important;
    scrollbar-color: #0397d2 rgba(3, 151, 210, .1) !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu::-webkit-scrollbar {
    width: 9px;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu::-webkit-scrollbar-track {
    background: rgba(3, 151, 210, .08);
    border-radius: 99px;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu::-webkit-scrollbar-thumb {
    background: #0397d2;
    border: 2px solid #fff;
    border-radius: 99px;
  }

  #header-outer #top > .container > .row {
    display: flex !important;
    align-items: center !important;
    min-height: 88px !important;
    padding: 0 !important;
  }

  #header-outer #top > .container > .row > .span_3 {
    float: none !important;
    width: 150px !important;
    margin: 0 !important;
    flex: 0 0 150px !important;
    display: flex !important;
    align-items: center !important;
  }

  #header-outer #top > .container > .row > .span_9 {
    float: none !important;
    width: auto !important;
    margin: 0 0 0 auto !important;
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  #header-outer #top > .container > .row > .span_9 nav,
  #header-outer #top > .container > .row > .span_9 nav > ul {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 88px !important;
  }

  #header-outer #top > .container > .row > .span_9 nav > ul > li {
    float: none !important;
  }
}

/* The Salient header is fixed; reserve the reference design's two-row height
 * before the homepage scene, then lower its internal artwork clear of it. */
body.home {
  /* The native Salient chrome is 130px tall (top contact row + navigation).
   * The homepage laptop scene also uses this variable for its sticky stage. */
  --header-height: 130px;

  /* Salient applies `overflow: hidden` to the body. That turns the body into
   * the sticky-stage scroll container and offsets the laptop scene by another
   * header-height. Keep the browser document as the scroll container, just as
   * in the reference homepage. */
  overflow: visible !important;
}

body.home .ajax-content-wrap {
  padding-top: 0 !important;
}

body.home #laptop-experience #experience {
  padding-top: 0;
}

/* Salient's transparent-header preset has a more specific white-link rule. */
html body #header-outer#header-outer.transparent #top#top nav > ul > li > a,
html body #header-outer#header-outer.transparent #top#top nav > ul > li > a .menu-title-text {
  color: #434d53 !important;
  opacity: 1 !important;
}

body #header-outer.transparent #top #logo img {
  filter: brightness(.38) saturate(1.25);
}

#header-outer #top nav > ul > li > a:hover,
#header-outer #top nav > ul > li.current-menu-item > a,
#header-outer #top nav > ul > li.current-menu-ancestor > a {
  color: #0397d2 !important;
}

#header-outer #top nav > ul > li ul,
#header-outer #top nav > ul > li .sub-menu {
  border: 1px solid rgba(3, 151, 210, .14) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 38px rgba(3, 87, 124, .16) !important;
}

/* Dynamic Salient submenus use the same card treatment as the supplied HTML
 * mega menu.  This changes presentation only: every menu item's WP URL and
 * hierarchy remain intact. */
@media (min-width: 1000px) {
  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu {
    padding: 22px !important;
    background: rgba(255, 255, 255, .98) !important;
  }

  /* Services and small dropdowns: direct children become a responsive grid. */
  #header-outer #top nav > ul > li:not(.megamenu) > ul.sub-menu {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(210px, 1fr)) !important;
    gap: 14px !important;
    min-width: min(1080px, calc(100vw - 48px)) !important;
  }

  #header-outer #top nav > ul > li:not(.megamenu) > ul.sub-menu > li {
    width: auto !important;
    margin: 0 !important;
  }

  /* Large native mega menus keep their configured columns, while each leaf
   * becomes a distinct card instead of a plain text row. */
  #header-outer #top nav > ul > li.megamenu > ul.sub-menu {
    /* Salient writes a narrow inline width for this menu.  Give the four
     * resource columns the full centred dropdown area instead. */
    width: min(1428px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    padding: 22px !important;
    background: rgba(255, 255, 255, .98) !important;
  }

  #header-outer #top nav > ul > li.megamenu > ul.sub-menu > li {
    box-sizing: border-box !important;
    float: none !important;
    width: 25% !important;
    min-width: 0 !important;
    padding: 0 7px !important;
  }

  #header-outer #top nav > ul > li.megamenu > ul.sub-menu > li > a {
    display: none !important;
  }

  #header-outer #top nav > ul > li.megamenu > ul.sub-menu > li > ul.sub-menu {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 12px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu a {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 72px !important;
    padding: 14px 18px 14px 60px !important;
    border: 1px solid rgba(3, 151, 210, .16) !important;
    border-radius: 16px !important;
    background: #fff !important;
    color: #073e58 !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    line-height: 1.35 !important;
    text-align: left !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 8px 20px rgba(3, 87, 124, .07) !important;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, color .22s ease !important;
  }

  /* The visible label is a nested span in Salient.  It needs its own flex
   * constraints, otherwise a long fourth-column label can paint over the
   * edge of its card even though the anchor itself is clipped. */
  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu a > .menu-title-text {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu a::before {
    content: '›' !important;
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    display: grid !important;
    width: 34px !important;
    height: 34px !important;
    place-items: center !important;
    border-radius: 11px !important;
    background: linear-gradient(135deg, rgba(3, 151, 210, .16), rgba(0, 180, 234, .08)) !important;
    color: #0397d2 !important;
    font-size: 25px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transform: translateY(-50%) !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu a:hover,
  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu li.sfHover > a {
    border-color: #0397d2 !important;
    color: #0397d2 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 16px 30px rgba(3, 151, 210, .17) !important;
  }

  /* Category wrappers in Salient's mega-menu are structural headings, not
   * destinations; only their actual child links receive a card. */
  #header-outer #top nav > ul > li.megamenu > ul.sub-menu > li > a {
    display: none !important;
  }
}

#footer-outer {
  position: relative;
  overflow: hidden;
  background: #001f2c !important;
  color: #c7d8df !important;
}

#footer-outer::before {
  content: '';
  display: block;
  height: 34px;
  margin-bottom: 24px;
  background: linear-gradient(172deg, transparent 48%, rgba(3, 151, 210, .2) 49%, rgba(3, 151, 210, .2) 66%, transparent 67%);
}

#footer-outer h1, #footer-outer h2, #footer-outer h3, #footer-outer h4,
#footer-outer .widgettitle { color: #fff !important; }

#footer-outer a { color: #c7d8df !important; }
#footer-outer a:hover { color: #0397d2 !important; }

@media (max-width: 999px) {
  #header-secondary-outer { display: none !important; }
  #header-outer #top,
  #header-outer #top .container,
  #header-outer #top .container > .row {
    min-height: 76px !important;
  }

  #header-outer #top .container {
    width: calc(100% - 28px) !important;
  }

  /* Salient prints a second, text-only mobile header beside its hamburger.
   * That is the faint “Custom Apps” label in the mobile capture. The real
   * navigation belongs in #mobile-menu, so keep only the logo and toggle. */
  #header-outer #top .nectar-mobile-only.mobile-header {
    display: none !important;
  }

  #header-outer #top > .container > .row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  #header-outer #top > .container > .row > .span_3 {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    margin: 0 auto 0 0 !important;
  }

  #header-outer #top > .container > .row > .span_9 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    margin: 0 !important;
    float: none !important;
  }

  #header-outer #logo img { width: 145px !important; }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon {
    display: block !important;
    float: none !important;
    margin: 0 !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon a {
    display: grid !important;
    width: 44px !important;
    height: 44px !important;
    place-items: center !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines::before,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines::after {
    background-color: #073e58 !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines::before,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines::after {
    width: 24px !important;
    height: 2px !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button {
    position: relative !important;
    display: block !important;
    width: 24px !important;
    height: 18px !important;
    transform: none !important;
  }

  /* Salient's “x2” animation can collapse these lines to one faint stroke
   * on narrow screens. Keep an always-visible, standard hamburger icon. */
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines::before,
  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines::after {
    position: absolute !important;
    left: 0 !important;
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    content: '' !important;
    background: #073e58 !important;
    border-radius: 99px !important;
    opacity: 1 !important;
    transform: none !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines {
    top: 8px !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines::before {
    top: -7px !important;
  }

  #header-outer #top .slide-out-widget-area-toggle.mobile-icon .lines-button .lines::after {
    top: 7px !important;
  }

  /* Keep the native mobile dropdown usable on long menus. */
  html body #mobile-menu,
  html body #mobile-menu .inner,
  html body #mobile-menu .inner > ul,
  html body #mobile-menu .inner > ul > li {
    background: #fff !important;
  }

  html body #mobile-menu {
    box-shadow: 0 16px 36px rgba(3, 87, 124, .16) !important;
    max-height: calc(100dvh - 76px) !important;
    overflow-y: auto !important;
    border: 0 !important;
  }

  html body #header-outer #mobile-menu::before,
  html body #header-outer #mobile-menu::after {
    display: none !important;
  }

  #header-outer #mobile-menu .inner {
    padding: 14px 22px 22px !important;
  }

  html body #mobile-menu ul li a {
    color: #073e58 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    padding: 12px 38px 12px 0 !important;
  }

  /* This intentionally repeats the IDs to outrank Salient's late mobile
   * stylesheet, which otherwise forces nested labels to white. */
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li > a,
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li > a .menu-title-text,
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li > a .sf-sub-indicator,
  html body #header-outer#header-outer #mobile-menu#mobile-menu .menu-item .below-menu-items-wrap {
    color: #073e58 !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }

  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li.current-menu-item > a,
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li.current-menu-ancestor > a,
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li.current-menu-item > a .menu-title-text,
  html body #header-outer#header-outer #mobile-menu#mobile-menu ul li.current-menu-ancestor > a .menu-title-text {
    color: #0397d2 !important;
  }

  /* Salient adds/removes .visible when the small submenu arrow is tapped.
   * Never leave large mega-menu children expanded by default on a phone. */
  html body #mobile-menu ul ul {
    display: none !important;
    margin: 0 0 4px 14px !important;
    padding-left: 14px !important;
    border-left: 2px solid rgba(3, 151, 210, .2) !important;
    background: #f7fbfe !important;
  }

  /* Salient uses a more-specific white-link rule for nested mobile items.
   * Restore the reference menu's readable dark text for every nested link. */
  html body #header-outer #mobile-menu .inner ul ul li a {
    display: block !important;
    color: #073e58 !important;
    background: #f7fbfe !important;
    border-bottom: 1px solid rgba(3, 87, 124, .1) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  html body #header-outer #mobile-menu .inner ul ul li a span,
  html body #header-outer #mobile-menu .inner ul ul li a .menu-title-text {
    display: inline !important;
    color: #073e58 !important;
    background: transparent !important;
    border: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  html body #header-outer #mobile-menu .inner ul ul li a:hover,
  html body #header-outer #mobile-menu .inner ul ul li a:hover span,
  html body #header-outer #mobile-menu .inner ul ul li.current-menu-item > a,
  html body #header-outer #mobile-menu .inner ul ul li.current-menu-item > a span {
    color: #0397d2 !important;
    background: #edf9ff !important;
  }

  html body #mobile-menu ul li.visible > ul,
  html body #mobile-menu ul li.sfHover > ul {
    display: block !important;
  }

  html body #mobile-menu ul li.menu-item-has-children > a {
    position: relative !important;
  }

  html body #mobile-menu ul li.menu-item-has-children > a .sf-sub-indicator {
    color: #0397d2 !important;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > ul.sub-menu {
    max-height: min(58vh, 440px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #header-outer #top nav > ul > li.menu-item-has-children > a .sf-sub-indicator {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    margin-left: 8px !important;
    color: #0397d2 !important;
  }

  body.home { --header-height: 76px; }
}
