/* IFJA navigation layout fixes.
 * Loaded after style.css to stabilize the legacy fixed menu.
 */

.navContainer {
  background: #fff;
  z-index: 700 !important;
}

.Vscroll .navContainer {
  min-height: 2rem;
  background: #fff;
}

#navElements {
  z-index: 710;
}

/* The legacy SCSS used #navzone, but the HTML id is #navZone.
 * Keep the active hotspot aligned with the real DOM node.
 */
#navZone {
  pointer-events: auto;
}

/* Social share icons and the duplicate submenu logo are not part of the
 * primary navigation. They were leaking into the top fixed bar on scroll.
 */
#subNav .post-share,
#subNav .subNavLogo {
  display: none !important;
}

/* Keep the submenu outside the document flow in every scroll mode. */
#subNav {
  position: fixed;
  top: 2rem;
  right: 0;
  bottom: auto;
  left: 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  z-index: 690;
}

/* Prevent hidden submenu content from affecting layout or leaking visually. */
#subNav:not(.show) {
  height: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transform: translateY(-100%) !important;
}

#subNav:not(.show) .subNavDiv,
#subNav:not(.show) .subNavLogo {
  display: none !important;
}

#subNav.show {
  bottom: 0;
  height: calc(100vh - 2rem);
  visibility: visible !important;
  opacity: 1 !important;
  overflow-y: auto;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

#subNav .subNavDiv {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100%;
  margin: 0 auto !important;
  padding: 4rem 1rem 2rem !important;
  transform: none !important;
}

/* Keep the fixed menu as a compact row. */
.Vscroll .navList {
  line-height: 1;
  background: #fff;
}

.Vscroll .navList a,
.Vscroll .navList .mainnav-link,
.Vscroll .navList .subNavArticle {
  color: #000;
  font-size: 1rem !important;
  line-height: 1.15 !important;
  text-decoration: none;
}

.Vscroll .navHome a {
  font-weight: 700;
}

/* Keep the hero logo below the fixed navigation layer during scroll. */
.site-header {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .Vscroll .navContainer {
    height: auto;
    min-height: 2.25rem;
  }

  #subNav {
    top: 2.25rem;
  }

  #subNav.show {
    height: calc(100vh - 2.25rem);
  }

  .Vscroll .navList {
    padding: 0.5rem 0.75rem !important;
  }

  .Vscroll .navList.toTypes {
    max-width: calc(100vw - 6.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .Vscroll .navList.toTypes li {
    display: inline-block;
  }

  .Vscroll .navList.toTypes li:not(:last-child) {
    margin-right: 0.45rem;
  }
}
