
/* =========================================================
   V27.3 — Scientific departments dropdown stability
   Prevents mega menu from disappearing while moving mouse
   from the top navigation button into the dropdown.
   ========================================================= */

@media (min-width: 901px){
  .main-nav .has-dropdown{
    position:relative;
  }

  /* Keep a continuous hover hit-area between trigger and menu. */
  .main-nav .has-dropdown::after{
    content:"";
    position:absolute;
    z-index:120;
    top:calc(100% - 10px);
    right:-8px;
    width:calc(100% + 16px);
    height:28px;
    background:transparent;
    pointer-events:auto;
  }

  .main-nav .has-dropdown > .dropdown{
    top:calc(100% - 2px) !important;
    z-index:130 !important;
    margin-top:0 !important;
  }

  .main-nav .has-dropdown:hover > .dropdown,
  .main-nav .has-dropdown:focus-within > .dropdown,
  .main-nav .has-dropdown.open > .dropdown{
    display:block !important;
  }

  .main-nav .has-dropdown:hover > .departments-mega-menu,
  .main-nav .has-dropdown:focus-within > .departments-mega-menu,
  .main-nav .has-dropdown.open > .departments-mega-menu{
    display:grid !important;
  }

  .departments-mega-menu{
    min-width:680px;
    max-width:min(780px,calc(100vw - 32px));
  }

  .departments-mega-menu a{
    pointer-events:auto;
  }
}

/* Keyboard focus remains visible and menu remains accessible */
.main-nav .has-dropdown .nav-button:focus-visible{
  outline:2px solid var(--royal,#1f67d2);
  outline-offset:-4px;
}
