/* ============================================================================
   Solutions mega menu
   ----------------------------------------------------------------------------
   Desktop only. Under 1001px the nav collapses to the burger and this panel
   falls back to the plain stacked list the mobile nav already draws, so none
   of the rules below apply there.

   The panel is positioned against .nav rather than the dropdown, because it
   has to span the bar rather than hang off one item. .nav is position: sticky,
   which is enough to make it the containing block; .nav-drop-mega goes static
   so it stops being one itself.

   Opening it also turns the bar solid white, so the bar and the panel read as
   one container the way the reference does. That has to beat the dark-hero
   treatment on /platform and /ai-agents, hence the body.hero-dark selectors.
   ========================================================================== */

/* The item's own structure, at every width. Only the panel around it is a
   desktop device; the title and its line of detail stack on a phone too, and
   leaving these inside the desktop query ran them together as inline spans. */
.nav-menu.nav-mega a.mega-item { display: block; text-decoration: none; }
.nav-menu.nav-mega a.mega-item .t {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px; font-weight: 500; color: #181D27; letter-spacing: -.01em;
  transition: color .15s ease;
}
.nav-menu.nav-mega a.mega-item .d {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 12px; font-weight: 400; color: #5D6470; line-height: 1.5;
  margin-top: 3px;
}

@media (min-width: 1001px) {

  /* .nav-drop { position: relative } lives in each page's own style block,
     which loads after this file, so this needs the extra class to win. */
  .nav .nav-drop-mega { position: static; }

  .nav-menu.nav-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-6px);
    width: min(980px, calc(100vw - 48px));
    min-width: 0;
    padding: 0;
    border: 1px solid #E8E3DD;
    border-top: 0;
    border-radius: 0 0 18px 18px;
    background: #FFFFFF;
    box-shadow: 0 26px 54px -26px rgba(16, 24, 40, .22), 0 2px 8px rgba(16, 24, 40, .05);
    overflow: hidden;
  }
  .nav-drop.open .nav-menu.nav-mega { transform: translateX(-50%) translateY(0); }

  .mega-in {
    display: grid;
    grid-template-columns: 1fr 1fr 272px;
    gap: 0 28px;
    padding: 28px 28px 30px;
    align-items: start;
  }

  .mega-h {
    font-family: 'Manrope', sans-serif;
    font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase;
    color: #5D6470;
    padding: 0 12px 10px;
  }
  .mega-col { min-width: 0; }

  .nav-menu.nav-mega a.mega-item {
    padding: 11px 12px;
    border-radius: 10px;
    transition: background .15s ease;
  }
  .nav-menu.nav-mega a.mega-item:hover,
  .nav-menu.nav-mega a.mega-item:focus-visible { background: #FBF8F5; }
  .nav-menu.nav-mega a.mega-item:hover .t,
  .nav-menu.nav-mega a.mega-item:focus-visible .t { color: #FF6200; }

  /* the case studies panel on the right.
     Three frames offset against each other rather than one flat tile. The
     photos are decoration only: they do not move and they are not clickable.
     The pill sitting over them is the one link, and the only thing that
     reacts to the pointer. */
  .mega-side {
    position: relative;
    display: block;
    aspect-ratio: 272 / 214;
    text-decoration: none;
  }
  .mega-side .ph {
    position: absolute;
    border-radius: 10px;
    overflow: hidden;
    background: #E8E3DD;
    box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .35);
  }
  .mega-side .ph img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  .mega-side .ph-a { left: 0;  top: 17%;    width: 50%; height: 58%; z-index: 2; }
  .mega-side .ph-b { right: 0; top: 0;      width: 54%; height: 47%; z-index: 1; }
  .mega-side .ph-c { right: 0; bottom: 0;   width: 54%; height: 47%; z-index: 1; }

  .mega-side .cap {
    position: absolute; left: 50%; top: 50%;
    text-decoration: none;
    transform: translate(-50%, -50%);
    z-index: 3;
    white-space: nowrap;
    background: #FFFFFF;
    border-radius: 999px;
    padding: 9px 17px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px; font-weight: 600; color: #181D27; letter-spacing: -.01em;
    box-shadow: 0 6px 18px -6px rgba(16, 24, 40, .34), 0 1px 2px rgba(16, 24, 40, .12);
    transition: background .15s ease, color .15s ease;
  }
  .mega-side .cap:hover,
  .mega-side .cap:focus-visible { background: #FF6200; color: #FFFFFF; }

  /* ---- the bar while the panel is open ---- */
  .nav.mega-open::before {
    background: #FFFFFF !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }
  .nav.mega-open::after { background: none !important; }
  body.hero-dark .nav.mega-open text,
  .nav.mega-open text { fill: #FF6200; }
  body.hero-dark .nav.mega-open .nav-link,
  body.hero-dark .nav.mega-open .nav-drop-btn,
  .nav.mega-open .nav-link,
  .nav.mega-open .nav-drop-btn { color: #414651; }
  body.hero-dark .nav.mega-open .nav-link:hover,
  body.hero-dark .nav.mega-open .nav-drop-btn:hover,
  .nav.mega-open .nav-link:hover,
  .nav.mega-open .nav-drop-btn:hover { color: #FF6200; }
  .nav.mega-open .nav-drop-btn[aria-expanded="true"] { color: #FF6200; }
}

/* Phones keep the stacked list the mobile nav already draws. The side panel is
   a desktop device, so it is left out rather than squeezed in. */
@media (max-width: 1000px) {
  .mega-h { display: none !important; }
  .mega-side { display: none !important; }
  .mega-in { display: block; padding: 0; }
  .nav-menu.nav-mega a.mega-item { padding: 11px 0; }

  /* The open menu is a cream panel on a phone, and both dark-bar treatments
     paint their links white, which left the top of the menu blank. Those are
     rules for a bar sitting over a photograph, not for this panel. */
  body.home .nav-links .nav-link,
  body.home .nav-links .nav-drop-btn,
  body.hero-dark .nav-links .nav-link,
  body.hero-dark .nav-links .nav-drop-btn { color: #414651 !important; }
  body.home .nav-links .nav-link:hover,
  body.hero-dark .nav-links .nav-link:hover { color: #FF6200 !important; }
}
