/* Viewport cap for mega max-height (theme: calc(var(--body-height, 600px) - 76px)). JS also sets --body-height. */
html {
  --body-height: 100vh;
  --body-height: 100dvh;
}

/* Fix mega-menu chevrons: snapshot CSS points at /wp-content/... which 404s on localhost. */
.mega-indicator {
  background-image: url("../icons/chevron-down.svg") !important;
}

@media screen and (max-width: 1261.98px) {
  .mega-indicator {
    background-image: url("../icons/chevron-right.svg") !important;
  }
}

/* Desktop: .header__overlay height uses var(--submenu-height) — set by nodemaven-mirror-mega-menu.js
   (do not force full viewport height here; that paints a white strip down the entire page). */

/* Let the primary nav span the flex gap before languages/CTAs; grow Resources so it fills that strip. */
@media screen and (min-width: 1262px) {
  /* Avoid always-reserving scrollbar gutter when content fits (theme sets stable). */
  ul.mega-menu > .mega-menu-item-has-children > .mega-sub-menu {
    scrollbar-gutter: auto;
  }

  .header-menu {
    flex: 1 1 auto;
    min-width: 0;
    /* Theme uses margin-right:auto here, which keeps the menu shrink-wrapped and eats space in the margin. */
    margin-right: 0;
  }

  .header-menu > nav.mega-menu-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  #mega-menu-max_mega_menu_1.mega-menu {
    width: 100%;
  }

  #mega-menu-item-35112 {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
  }

  #mega-menu-item-35112 > a.mega-menu-link {
    flex: 1 1 auto;
    justify-content: flex-start;
    align-items: center;
  }

  /* Resources mega: dense layout so the panel stays within max-height without inner scroll on typical viewports. */
  #mega-sub-menu-35112 .mega-menu-link--grouping {
    padding-bottom: 10px;
    font-size: 14px;
  }

  #mega-sub-menu-35112 .menu-item__description {
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 2px;
    line-height: 1.35;
  }

  #mega-sub-menu-35112 .section-menu-documentation__icon {
    margin-bottom: 8px;
  }

  #mega-sub-menu-35112 .section-menu-documentation__icon img {
    width: 48px;
    height: auto;
  }

  #mega-sub-menu-35112 .section-menu-documentation__button {
    margin-top: 8px;
  }

  #mega-sub-menu-35112 .section-menu-documentation__links {
    margin-top: 12px !important;
  }

  #mega-sub-menu-35112 .section-menu-community__item {
    min-height: 92px;
  }

  #mega-sub-menu-35112 .section-menu-community__icon img {
    width: 56px;
    height: 56px;
  }

  #mega-sub-menu-35112 .section-menu-community__container.swiper {
    padding-bottom: 4px;
  }
}
