/* ---- Desktop: full-width dropdown panel ------------------------------- */
@media (min-width: 992px) {

  .og-navbar .mega-menu-item {
    position: relative;
  }

  .og-navbar .dropdown-menu.mega-menu {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: min(860px, 92vw);
    max-width: 860px;
    background: var(--navy-950);
    border: 1px solid var(--line-on-navy);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-hover);
    padding: 1.75rem;
    margin-top: 0.65rem;

    /* Bootstrap toggles .show on the parent .dropdown-menu already;
       we just add a subtle entrance transition on top of that */
    opacity: 0;
    visibility: hidden;
    display: block;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  .og-navbar .dropdown-menu.mega-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .og-navbar .mega-menu__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) minmax(220px, 260px);
    gap: 1.75rem 2rem;
    align-items: start;
  }
}

/* ---- Columns ------------------------------------------------------------ */
.mega-menu__col {
  min-width: 0;
}

.mega-menu__heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line-on-navy);
}

.mega-menu__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #e7e9f7;
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.3;
  padding: 0.5rem 0.55rem;
  border-radius: 6px;
  white-space: normal;
}

.mega-menu__link:hover,
.mega-menu__link:focus {
  background: var(--navy-800);
  color: var(--gold-300);
}

.mega-menu__icon {
  flex: 0 0 auto;
  width: 1.1rem;
  text-align: center;
  color: var(--gold-500);
  font-size: 0.82rem;
}

.mega-menu__link:hover .mega-menu__icon,
.mega-menu__link:focus .mega-menu__icon {
  color: var(--gold-300);
}

/* ---- Right-hand highlight / CTA panel ----------------------------------- */
.mega-menu__cta {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-700));
  border: 1px solid var(--line-on-navy);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.1rem 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mega-menu__cta-title {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.mega-menu__cta-text {
  font-family: var(--font-body);
  color: var(--slate-on-navy);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1 1 auto;
}

.mega-menu__cta-btn {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 0.55rem 1.1rem !important;
}

/* ---- Mobile / tablet: collapse into stacked accordion-style groups ----- */
@media (max-width: 991.98px) {

  .og-navbar .dropdown-menu.mega-menu {
    position: static;
    width: 100%;
    max-width: none;
    transform: none;
    background: var(--navy-800);
    border: 1px solid var(--line-on-navy);
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0.75rem;
    margin-top: 0.35rem;
  }

  .og-navbar .mega-menu__inner {
    display: block;
  }

  .mega-menu__col {
    margin-bottom: 1rem;
  }

  .mega-menu__col:last-of-type {
    margin-bottom: 0.75rem;
  }

  .mega-menu__cta {
    margin-top: 0.25rem;
  }
}
 
/* ---- E-Portal split button (label | divider | caret) -------------------
   Gold theme; the caret is drawn from currentColor so it always matches
   the label text (navy) instead of the gold the generic
   `.og-navbar .dropdown-toggle::after` rule would give it. ------------- */
.og-navbar .og-eportal .btn-gold {
  padding: 0.62rem 1.15rem;
}
 
.og-navbar .og-eportal .og-eportal__toggle {
  padding: 0.62rem 0.8rem;
  border-left: 1px solid rgba(5, 11, 136, 0.28);
}
 
.og-navbar .og-eportal .og-eportal__toggle::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin: -0.25em 0 0;
  vertical-align: middle;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
 
.og-navbar .og-eportal .og-eportal__toggle.show::after {
  transform: rotate(-135deg);
  margin-top: 0.1em;
}
 
@media (max-width: 991.98px) {
  .og-navbar .og-eportal { margin-top: 0.5rem; }
}

/* ---- Social icons (mega-menu CTA box): 3 per row, 2 rows ---- */
.mega-menu__social {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.mega-menu__social a {
  height: 3.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-500);
  border-radius: 14px;
  color: var(--gold-300);
  font-size: 1.5rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.mega-menu__social a:hover,
.mega-menu__social a:focus-visible {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--navy-950);
  transform: translateY(-2px);
}

/* ---- Scrollable mega-menu panels -------------------------------------- */
@media (min-width: 992px) {
  .og-navbar .dropdown-menu.mega-menu {
    max-height: calc(100vh - 100px);   /* 100px ≈ navbar height; adjust if needed */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;      /* scrolling the menu doesn't scroll the page behind it */
    scrollbar-width: thin;
    scrollbar-color: var(--gold-500) transparent;
  }
  .og-navbar .dropdown-menu.mega-menu::-webkit-scrollbar { width: 8px; }
  .og-navbar .dropdown-menu.mega-menu::-webkit-scrollbar-track { background: transparent; }
  .og-navbar .dropdown-menu.mega-menu::-webkit-scrollbar-thumb { background: var(--gold-500); border-radius: 8px; }
}

/* Phones and tablets: the whole opened menu scrolls */
@media (max-width: 991.98px) {
  .og-navbar .navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Phones and tablets: the opened menu scrolls inside the screen */
@media (max-width: 991.98px) {
  .og-navbar {
    max-height: 100vh;
    max-height: 100dvh;                 /* accounts for the phone's address bar */
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;       /* scrolling the menu doesn't move the page behind it */
    -webkit-overflow-scrolling: touch;
  }
  .og-navbar .navbar-collapse {
    max-height: none !important;        /* only the navbar scrolls, no nested scroll area */
    overflow: visible !important;
  }
  .og-navbar .dropdown-menu.mega-menu {
    max-height: none !important;        /* the desktop panel limit must not apply here */
    overflow: visible !important;
  }
}


/* ---- Mobile hamburger: dark glass button, gold inner border, soft gold outer ring; gold bars become an X when open ---- */
.navbar-toggler {
  width: 2.6rem; height: 2.6rem; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid #e4be52; border-radius: 11px;
  background: rgba(24, 24, 96, .78);
  box-shadow: 0 0 0 3px rgba(228, 190, 82, .35), 0 6px 16px rgba(0, 0, 0, .3);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.navbar-toggler:hover { background: rgba(40, 40, 120, .9); box-shadow: 0 0 0 4px rgba(228, 190, 82, .5), 0 6px 16px rgba(0, 0, 0, .3); }
.navbar-toggler:active { transform: scale(.95); }
.navbar-toggler:focus, .navbar-toggler:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(228, 190, 82, .55), 0 6px 16px rgba(0, 0, 0, .3); }
.navbar-toggler .navbar-toggler-icon {
  width: 1.35rem; height: 1.35rem; background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e4be52' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3 6h18M7 12h14M12 18h9'/%3E%3C/svg%3E");
}
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e4be52' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
}