/* ═══════════════════════════════════════════════════
   InvestPNG — Sovereign Mega Menu
   Tier: Goldman / EDB Singapore
   ═══════════════════════════════════════════════════ */

/* ── Desktop nav bar layout ──────────────────────── */
.mega-nav-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mega-nav {
  display: flex;
  gap: 20px;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.mega-nav > li > a,
.mega-nav > li > .mega-trigger {
  color: var(--navy);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
  padding: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.mega-nav > li > a:hover,
.mega-nav > li > .mega-trigger:hover,
.mega-nav > li.is-current > a,
.mega-nav > li.is-current > .mega-trigger {
  color: var(--gold);
}

/* Trigger arrows and underlines removed — institutional clean style */

/* Auth button in nav */
.mega-nav-auth {
  margin-left: 8px;
  flex-shrink: 0;
}

/* ── Mega Panel ──────────────────────────────────── */
.has-mega {
  position: static; /* panel positions relative to .nav */
}

/* Full-bleed sheet — background spans entire viewport */
.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08),
              0 2px 12px rgba(0, 0, 0, 0.03);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
}

.has-mega.is-open > .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Inner content grid — centered within full-bleed panel */
.mega-panel-inner {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 56px;
  display: flex;
  gap: 48px;
}

/* ── Columns container ───────────────────────────── */
.mega-columns {
  display: flex;
  flex: 1;
  gap: 40px;
  min-width: 0;
}

/* ── Individual group ────────────────────────────── */
.mega-group {
  flex: 1;
  min-width: 0;
}

.mega-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
}

.mega-heading a {
  color: inherit;
  text-decoration: none;
}

.mega-heading a:hover {
  color: var(--navy);
}

/* ── Links list ──────────────────────────────────── */
.mega-group-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-link {
  display: block;
  padding: 9px 0;
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 0.15s;
}

.mega-link:hover,
.mega-link:focus {
  color: var(--gold);
}

/* ── Context pane (feature panel) ────────────────── */
.mega-context {
  flex: 0 0 320px;
  padding-left: 40px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
}

/* Feature image placeholder */
.mega-context-image {
  width: 100%;
  height: 140px;
  background: var(--stone, #f5f5f0);
  border-radius: 3px;
  margin: 0 0 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.mega-context-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder state — subtle pattern when no image */
.mega-context-image--placeholder {
  background: linear-gradient(135deg, var(--stone, #f5f5f0) 0%, #ece9e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mega-context-image--placeholder::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 2px solid var(--border, #ddd);
  border-radius: 2px;
  opacity: 0.35;
}

.mega-context-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
  line-height: 1.3;
  transition: opacity 0.15s;
}

.mega-context-desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.65;
  margin: 0 0 20px;
  transition: opacity 0.15s;
}

.mega-context-cta {
  display: inline-block;
  padding: 10px 22px;
  background: var(--gold);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.2s;
  align-self: flex-start;
}

.mega-context-cta:hover {
  background: var(--gold-dark);
  color: var(--white);
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mega-panel,
  .mega-trigger-arrow,
  .mega-link,
  .mega-context-title,
  .mega-context-desc {
    transition: none;
  }
}


/* ═══════════════════════════════════════════════════
   Mobile Mega Menu
   ═══════════════════════════════════════════════════ */

.mega-mobile {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 99;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
}

/* Offset below nav (logo row 60px) */
@media (max-width: 1200px) {
  .mega-mobile { top: 60px; }
  .admin-bar .mega-mobile { top: 92px; }  /* 32px admin bar + 60px nav */
}
@media screen and (max-width: 782px) {
  .admin-bar .mega-mobile { top: 106px; } /* 46px mobile admin bar + 60px nav */
}

.mega-mobile.is-open {
  transform: translateX(0);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.mega-mobile-nav {
  list-style: none;
  margin: 0;
  padding: 8px 0 100px; /* bottom padding for safe area */
}

/* Simple links (depth 0 without children) */
.mega-mobile-nav > li > a {
  display: block;
  padding: 14px 32px;
  color: var(--navy);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--stone-mid);
  transition: color 0.15s, background 0.15s;
}

.mega-mobile-nav > li > a:hover,
.mega-mobile-nav > li > a.active {
  color: var(--gold);
  background: var(--stone);
}

/* Accordion toggle */
.mega-mob-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 32px;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--stone-mid);
  font-family: var(--font);
  text-align: left;
  transition: color 0.15s, background 0.15s;
}

.mega-mob-toggle:hover,
.mega-mob-toggle.is-open {
  color: var(--gold);
  background: var(--stone);
}

.mega-mob-arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mega-mob-toggle.is-open .mega-mob-arrow {
  transform: rotate(180deg);
}

/* Accordion panel */
.mega-mob-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  background: var(--stone);
}

.mega-mob-panel.is-open {
  max-height: 2000px; /* generous max */
}

/* Group heading inside panel */
.mega-mob-group {
  padding: 0;
}

.mega-mob-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 14px 32px 6px;
  margin: 0;
}

/* Links inside groups */
.mega-mob-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-mob-links a {
  display: block;
  padding: 10px 32px 10px 48px;
  color: var(--slate);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.mega-mob-links li:last-child a {
  border-bottom: none;
}

.mega-mob-links a:hover {
  color: var(--gold);
}

/* Mobile auth links */
.mega-mobile-auth {
  padding: 8px 0;
  border-top: 1px solid var(--stone-mid);
}

.mega-mobile-auth a {
  display: block;
  padding: 14px 32px;
  color: var(--navy);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--stone-mid);
  transition: color 0.15s, background 0.15s;
}

.mega-mobile-auth a:last-child {
  border-bottom: none;
}

.mega-mobile-auth a:hover {
  color: var(--gold);
  background: var(--stone);
}

.mega-mobile-auth .ip-btn--auth {
  margin: 12px 32px;
  display: block;
  text-align: center;
}

/* ── Responsive breakpoint ───────────────────────── */
@media (max-width: 1200px) {
  /* Hide the entire desktop mega menu — mobile drawer handles navigation */
  .mega-nav-wrap {
    display: none !important;
  }
}

@media (min-width: 1201px) {
  .mega-mobile {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mega-mobile,
  .mega-mob-panel,
  .mega-mob-arrow,
  .mega-mob-toggle {
    transition: none;
  }
}
