/* v6 navigation — MGM blend.
   Loaded after style.css. Overrides only header / nav / mobile-menu rules.
   MGM cue (mgmschool.co.in): bold dark-navy links, generous spacing, hover
   is a plain colour change to blue — NO underline, NO background pill,
   NO dropdown. Active page: blue text + a 2-3px blue underline offset
   below. On scroll the header gains a faint hairline divider.
   Jayant's order kept: sticky header that compacts on scroll, smooth
   animated mobile menu, focus-visible states, reduced-motion support.
   (oil-ui / frontend-design / design-taste-frontend / ui-ux-pro-max) */

/* ---------- Sticky header: compacts + gains hairline on scroll ---------- */

.site-header {
  transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.header-inner {
  transition: height 0.32s var(--ease-out);
}
.brand-crest {
  transition: width 0.32s var(--ease-out), height 0.32s var(--ease-out);
}
.site-header.scrolled {
  --header-h: 58px;
  box-shadow: 0 1px 2px rgba(18, 30, 42, 0.05), 0 8px 24px rgba(18, 30, 42, 0.08);
  border-bottom: 1px solid var(--line); /* faint hairline divider, MGM cue */
}
.site-header.scrolled .brand-crest {
  width: 38px;
  height: 38px;
}
.brand { transition: opacity 0.2s var(--ease-out); }
.brand:hover { opacity: 0.85; }

/* ---------- Desktop nav: colour change only, no pill ---------- */

.main-nav { position: relative; }
/* The nav list is a horizontal flex row — the global li bottom margin
   (style.css) would centre the last item 4px lower than its siblings. */
.main-nav li { margin-bottom: 0; }
.main-nav a {
  position: relative;
  padding: 11px 8px; /* 44px+ touch target; 8px sides keep the 10-link row
    + brand + CTA inside the viewport at 1366px (measured v7) */
  color: var(--ink);
  font-weight: 600;
  transition: color 0.25s var(--ease-out);
}
/* The underline lives on every link, drawn in on hover and on the active
   page. Hover: text turns blue + the same 3px underline draws in. */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -3px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
  pointer-events: none;
}
.main-nav a:hover::after { transform: scaleX(1); }
/* Hover: text turns blue. No background pill — MGM cue. */
.main-nav a:hover {
  background: transparent;
  color: var(--blue);
}
/* Active page: blue text + a 3px blue underline offset below the link.
   The underline draws in once on page load — the nav's one quiet moment. */
.main-nav a[aria-current="page"] {
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}
.main-nav a[aria-current="page"]::after {
  animation: nav-underline-in 0.45s var(--ease-out) 0.15s forwards;
}
@keyframes nav-underline-in {
  to { transform: scaleX(1); }
}

/* ---------- Header CTA + toggle: press feedback ---------- */

.menu-toggle {
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    transform 0.15s var(--ease-out);
}
.menu-toggle:active { transform: scale(0.94); }
.menu-close {
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    transform 0.25s var(--ease-out);
}
.menu-close:hover { transform: rotate(90deg); }

/* ---------- Mobile menu: staged entrance, prompt close ---------- */

.mobile-menu {
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out),
    visibility 0s linear 0.3s;
}
.mobile-menu.open {
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
/* Links, top bar and CTA enter one after another, top to bottom. */
.mobile-menu-top,
.mobile-menu nav li,
.mobile-menu .btn {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.mobile-menu.open .mobile-menu-top {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}
.mobile-menu.open nav li {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.open nav li:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.open nav li:nth-child(2) { transition-delay: 0.11s; }
.mobile-menu.open nav li:nth-child(3) { transition-delay: 0.14s; }
.mobile-menu.open nav li:nth-child(4) { transition-delay: 0.17s; }
.mobile-menu.open nav li:nth-child(5) { transition-delay: 0.20s; }
.mobile-menu.open nav li:nth-child(6) { transition-delay: 0.23s; }
.mobile-menu.open nav li:nth-child(7) { transition-delay: 0.26s; }
.mobile-menu.open nav li:nth-child(8) { transition-delay: 0.29s; }
.mobile-menu.open nav li:nth-child(9) { transition-delay: 0.32s; }
.mobile-menu.open nav li:nth-child(10) { transition-delay: 0.35s; }
.mobile-menu.open nav li:nth-child(11) { transition-delay: 0.38s; }
.mobile-menu.open nav li:nth-child(12) { transition-delay: 0.41s; }
.mobile-menu.open .btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.42s;
}
/* Closing is prompt: no stagger on the way out. */
.mobile-menu:not(.open) .mobile-menu-top,
.mobile-menu:not(.open) nav li,
.mobile-menu:not(.open) .btn { transition-delay: 0s; }

/* ---------- Breakpoint: measured v17 — the header row is ~1420px wide
   (brand 219 + 11 links ~837 + CTA 216 + gaps 28) inside a 1180px container.
   The CTA keeps ≥24px from the viewport edge down to ~1470px; below that
   the hamburger takes over. style.css no longer hides the nav — this
   media query is the single source of truth. (v16 regression: adding Videos
   as the 11th link widened the row ~69px and clipped the CTA at 1366px.) */
@media (max-width: 1470px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-cta { display: none; }
}

/* ---------- Focus: clear rings on every nav control ---------- */

.main-nav a:focus-visible,
.brand:focus-visible,
.menu-toggle:focus-visible,
.menu-close:focus-visible,
.mobile-menu nav a:focus-visible { outline-offset: 3px; }

/* ---------- Reduced motion: everything rests, nothing hides ---------- */

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .header-inner,
  .brand-crest,
  .brand,
  .main-nav a,
  .mobile-menu,
  .mobile-menu-top,
  .mobile-menu nav li,
  .mobile-menu .btn,
  .menu-toggle,
  .menu-close { transition: none !important; }
  .main-nav a[aria-current="page"]::after {
    animation: none;
    transform: none;
  }
  .mobile-menu.open .mobile-menu-top,
  .mobile-menu.open nav li,
  .mobile-menu.open .btn { transition-delay: 0s; }
}
