/*
 * Services mega menu: a menu item with its own pop-out list (desktop only).
 *
 * Used by "Affiliate Universities" in assets/templates/section-header.php, which opens
 * "For Saudi Applicants" / "For GCC Applicants" to its right on hover or keyboard focus.
 * Scoped to .main-menu (the desktop nav). The mobile panel shows the same links indented
 * under their parent instead; see assets/css/mobile-nav.css.
 */

.main-menu .tp-mega-flyout {
  position: relative;
}

/* small chevron after the parent link */
.main-menu .tp-mega-flyout-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-start: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  vertical-align: middle;
}

.main-menu .tp-mega-flyout-menu {
  position: absolute;
  z-index: 2;
  left: 100%;
  bottom: -14px; /* opens upwards from the row, so it stays inside the mega menu box */
  min-width: 230px;
  margin: 0;
  padding: 14px 22px;
  background: var(--tp-common-white);
  border: 1px solid rgba(48, 48, 47, 0.1);
  border-radius: 8px;
  box-shadow: 0px 6px 18px rgba(3, 11, 30, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

/* invisible bridge so the pointer can travel from the parent link into the pop-out */
.main-menu .tp-mega-flyout-menu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 24px;
}

.main-menu .tp-mega-flyout:hover > .tp-mega-flyout-menu,
.main-menu .tp-mega-flyout:focus-within > .tp-mega-flyout-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.main-menu .tp-mega-flyout:hover > a,
.main-menu .tp-mega-flyout:focus-within > a {
  color: var(--tp-theme-4);
}
