/* =====================================================================
   HEADER ENHANCEMENTS  (loads after style.css / responsive.css)
   1) AI search: panel slides down from just below the header (full window)
   2) Mobile menu: sub-menus open as a new screen (  >  to go in,  <  to go back)
   Desktop navigation is not touched.
   ===================================================================== */

:root {
  /* Direction of the sub-menu screen on mobile.
     100%  = comes in from the right (standard)   |  -100% = comes in from the left */
  --dnx-drill-from: 100%;
  /* how far the main list moves away while a sub-menu screen is open */
  --dnx-drill-shift: -18%;
  --dnx-ease: cubic-bezier(.22, .8, .2, 1);
}

/* ---------------------------------------------------------------------
   1) SEARCH PANEL
   --dnx-header-bottom is set by js/header-enhance.js (bottom edge of the header)
   --------------------------------------------------------------------- */
#searchOverlay.search-overlay {
  position: fixed !important;
  display: flex !important; /* style.css uses display:none -> would block the slide animation */
  top: var(--dnx-header-bottom, 76px) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  -webkit-clip-path: inset(0 0 100% 0);
  clip-path: inset(0 0 100% 0);
  transition:
    -webkit-clip-path .55s var(--dnx-ease),
    clip-path .55s var(--dnx-ease),
    visibility 0s linear .55s !important;
}

#searchOverlay.search-overlay.active {
  visibility: visible !important;
  pointer-events: auto !important;
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
  transition:
    -webkit-clip-path .55s var(--dnx-ease),
    clip-path .55s var(--dnx-ease),
    visibility 0s linear 0s !important;
}

/* content glides down together with the reveal (uses the separate `translate`
   property, so it never fights with any existing `transform`) */
#searchOverlay .search-container {
  translate: 0 -42px;
  opacity: 0;
  transition:
    translate .6s var(--dnx-ease) .06s,
    opacity .4s ease .1s !important;
}
#searchOverlay.active .search-container {
  translate: 0 0;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #searchOverlay.search-overlay,
  #searchOverlay.search-overlay.active,
  #searchOverlay .search-container {
    transition-duration: .01s !important;
    transition-delay: 0s !important;
  }
}

/* ---------------------------------------------------------------------
   2) MOBILE MENU: drill-down screens
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {

  /* arrow points right ( > ) instead of down / up */
  .NRj_interactive_header__has-dropdown > .NRj_interactive_header__link > i,
  .NRj_interactive_header__has-mega > .NRj_interactive_header__link > i {
    transform: rotate(-90deg) !important;
  }

  /* while a sub-menu screen is open */
  .NRj_interactive_header__nav.dnx-drill-open {
    overflow: hidden !important;
  }
  .NRj_interactive_header__nav > .NRj_mobile_nav_inner {
    transition: translate .42s var(--dnx-ease), opacity .3s ease;
  }
  .NRj_interactive_header__nav.dnx-drill-open > .NRj_mobile_nav_inner {
    translate: var(--dnx-drill-shift) 0;
    opacity: .25;
    pointer-events: none;
  }

  /* the sub-menu screen */
  .dnx-drill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background-color: var(--dnx-drill-bg, #fff);
    background-image: var(--dnx-drill-bg-image, none);
    background-size: cover;
    background-position: center;
    color: var(--dnx-drill-color, #111827);
    font-family: var(--dnx-drill-font, inherit);
    line-height: 1.35;
    transform: translateX(var(--dnx-drill-from));
    visibility: hidden;
    transition: transform .42s var(--dnx-ease), visibility 0s linear .42s;
  }
  .dnx-drill.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .42s var(--dnx-ease), visibility 0s linear 0s;
  }
  .dnx-drill.no-anim,
  .dnx-drill.no-anim + .dnx-drill,
  .NRj_interactive_header__nav.dnx-no-anim > .NRj_mobile_nav_inner {
    transition: none !important;
  }

  .dnx-drill__bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background-color: var(--dnx-drill-bg, #fff);
    background-image: var(--dnx-drill-bg-image, none);
    background-size: cover;
    background-position: center top;
    border-bottom: 1px solid var(--dnx-drill-line, rgba(128, 128, 128, .28));
  }
  .dnx-drill__back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--dnx-drill-line, rgba(128, 128, 128, .35));
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dnx-drill__back:focus-visible,
  .dnx-drill a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }
  .dnx-drill__title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: inherit;
  }

  .dnx-drill__group-title {
    margin: 0;
    padding: 18px 22px 6px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    opacity: .6;
    color: inherit;
  }
  .dnx-drill__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
  }
  .dnx-drill__list li {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .dnx-drill__list a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 22px;
    color: inherit;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--dnx-drill-line, rgba(128, 128, 128, .18));
  }
  .dnx-drill__list a:active {
    background: var(--dnx-drill-line, rgba(128, 128, 128, .15));
  }
  .dnx-drill__ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--dnx-drill-line, rgba(128, 128, 128, .15));
    font-size: 15px;
  }
  .dnx-drill__label {
    flex: 1 1 auto;
    min-width: 0;
  }
  .dnx-drill__go {
    flex: 0 0 auto;
    font-size: 12px;
    opacity: .55;
  }
  .dnx-drill__foot {
    padding: 18px 22px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .dnx-drill__foot a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 18px;
    border: 1px solid var(--dnx-drill-line, rgba(128, 128, 128, .4));
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
  }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .dnx-drill,
  .dnx-drill.is-open,
  .NRj_interactive_header__nav > .NRj_mobile_nav_inner {
    transition-duration: .01s !important;
    transition-delay: 0s !important;
  }
}

/* never show the screens on desktop */
@media (min-width: 1025px) {
  .dnx-drill { display: none !important; }
}
