/* ============================================================
   MTG Technical Services — navbar.css
   Header, top strip, nav links, mega-menu, mobile drawer, footer.
   Loaded on every page (header/footer are injected by header.js).
   ============================================================ */

/* ---- Sticky header ---- */
header.site{
  transition:top .35s ease, background-color .35s ease, backdrop-filter .35s ease, box-shadow .35s ease, border-color .35s ease;
  border-bottom:1px solid transparent;
}
header.site.scrolled{
  top:0 !important;
  background:rgba(255,255,255,0.82);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  box-shadow:0 1px 0 rgba(10,53,117,0.06), 0 10px 30px -18px rgba(10,53,117,0.25);
  border-bottom-color:rgba(10,53,117,0.06);
}
header.site.scrolled .nav-link{ color:#0d1b32; }
header.site.scrolled .nav-link:hover{ color:var(--ink); }
header.site #brandLogo{
  filter:brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.25));
  transition:filter .35s ease;
}
header.site.scrolled #brandLogo{ filter:none; }
header.site.scrolled .ghost-btn{ color:var(--ink); border-color:rgba(10,53,117,0.18); background:rgba(10,53,117,0.04); }
header.site.scrolled .ghost-btn:hover{ background:rgba(10,53,117,0.08); }

/* Logo text fallback (shown if mtg-logo.png is missing) */
.logo-fallback{
  font-family:'Sora','Manrope',sans-serif; font-weight:800; font-size:20px;
  letter-spacing:-0.01em; line-height:1; color:#fff; white-space:nowrap;
}
.logo-fallback b{ color:#5BA0FF; }
header.site.scrolled .logo-fallback,
body[data-nav-theme="light"] header.site .logo-fallback{ color:var(--ink); }

/* ---- Nav links ---- */
.nav-link{
  position:relative; padding:22px 2px; color:#ffffff;
  font-weight:600; font-size:14.5px; letter-spacing:-0.005em;
  background:none; border:none; cursor:pointer;
  transition:color .25s ease;
}
.nav-link::after{
  content:''; position:absolute; left:50%; right:50%; bottom:14px; height:2px;
  background:linear-gradient(90deg, var(--azure), #5BA0FF);
  border-radius:2px; opacity:0; transition:all .35s cubic-bezier(.2,.7,.2,1);
}
.nav-link:hover::after, .nav-link.is-open::after{ left:0; right:0; opacity:1; }
.nav-link .chev{ transition:transform .35s cubic-bezier(.2,.7,.2,1); display:inline-block; }
.nav-link.is-open .chev{ transform:rotate(180deg); }

/* Light-hero pages: dark nav text by default */
body[data-nav-theme="light"] header.site .nav-link{ color:#0d1b32; }
body[data-nav-theme="light"] header.site .nav-link:hover{ color:var(--ink); }
body[data-nav-theme="light"] header.site #brandLogo{ filter:none; }
body[data-nav-theme="light"] header.site .ghost-btn{
  color:var(--ink); border-color:rgba(10,53,117,0.18); background:rgba(10,53,117,0.04);
}

/* ---- Mega menu ---- */
.mega-wrap{
  position:fixed; left:50%; transform:translateX(-50%) translateY(-8px);
  top:calc(36px + 72px);
  width:min(1180px, calc(100vw - 32px));
  padding-top:12px;
  opacity:0; visibility:hidden;
  transition:opacity .3s ease, transform .35s cubic-bezier(.2,.7,.2,1), visibility .3s, top .35s ease;
  pointer-events:none; z-index:60;
}
header.site.scrolled .mega-wrap{ top:72px; }
.mega-wrap.is-open{
  opacity:1; visibility:visible; transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}
.mega-card{
  background:rgba(255,255,255,0.98);
  -webkit-backdrop-filter:saturate(180%) blur(24px);
  backdrop-filter:saturate(180%) blur(24px);
  border:1px solid rgba(10,53,117,0.08);
  border-radius:24px;
  box-shadow:0 40px 90px -24px rgba(10,53,117,0.35), 0 12px 28px -10px rgba(29,111,232,0.12);
  overflow:hidden;
}

.mega-tab{
  display:flex; align-items:center; gap:14px;
  padding:16px 18px; border-radius:14px; cursor:pointer;
  color:#0d1b32; transition:all .25s ease; position:relative;
  border:1px solid transparent;
}
.mega-tab:hover{ background:#F5F7FA; }
.mega-tab.active{
  background:linear-gradient(135deg, #0A3575 0%, #1D6FE8 100%);
  color:#fff; box-shadow:0 14px 30px -12px rgba(29,111,232,0.55);
}
.mega-tab .tab-ico{
  width:42px; height:42px; border-radius:12px;
  background:#EAF1FE; color:#1D6FE8;
  display:grid; place-items:center; flex-shrink:0; transition:all .3s ease;
}
.mega-tab.active .tab-ico{
  background:rgba(255,255,255,0.18); color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.25);
}
.mega-tab .tab-meta{ flex:1; min-width:0; }
.mega-tab .tab-title{ font-weight:700; font-size:14.5px; line-height:1.2; }
.mega-tab .tab-sub{ font-size:11.5px; font-weight:500; opacity:.7; margin-top:2px; line-height:1.3; }
.mega-tab .tab-arrow{ opacity:0; transition:all .25s ease; }
.mega-tab.active .tab-arrow{ opacity:1; }

.mega-panel{ display:none; }
.mega-panel.active{ display:grid; animation:fadeUp .35s ease both; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:translateY(0); } }

.mega-backdrop{
  position:fixed; inset:0; pointer-events:none; z-index:30;
  background:rgba(10,20,40,0.0); backdrop-filter:blur(0px);
  transition:background-color .35s ease, backdrop-filter .35s ease;
}
.mega-backdrop.on{
  background:rgba(10,20,40,0.18);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
}
.mega-col-title{
  font-family:'Sora', sans-serif; font-size:11px; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--azure); font-weight:700;
}
.mega-link{
  display:flex; align-items:flex-start; gap:14px; padding:14px;
  border-radius:14px; color:#0d1b32; transition:all .25s ease;
  position:relative; border:1px solid transparent; text-decoration:none;
}
.mega-link .ico{
  width:46px; height:46px; border-radius:12px;
  display:grid; place-items:center;
  background:linear-gradient(135deg, #EAF1FE 0%, #F5F7FA 100%);
  border:1px solid rgba(29,111,232,0.10); transition:all .3s ease; flex-shrink:0;
}
.mega-link .ico img{ width:24px; height:24px; object-fit:contain; transition:filter .3s ease; }
.mega-link .link-body{ flex:1; min-width:0; }
.mega-link .link-title{ font-weight:700; font-size:14px; color:var(--ink); line-height:1.2; }
.mega-link .link-sub{ font-size:12px; color:#6b7894; font-weight:500; margin-top:3px; line-height:1.4; }
.mega-link:hover{
  background:#fff; border-color:rgba(29,111,232,0.18);
  box-shadow:0 14px 30px -16px rgba(29,111,232,0.30); transform:translateY(-1px);
}
.mega-link:hover .ico{
  background:linear-gradient(135deg, var(--azure), var(--ink));
  box-shadow:0 10px 20px -6px rgba(29,111,232,0.55); border-color:transparent;
}
.mega-link:hover .ico img{ filter:brightness(0) invert(1); }

.promo-panel{
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,0.18), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(93,154,255,0.45), transparent 60%),
    linear-gradient(135deg, #0A3575 0%, #1D6FE8 100%);
  color:#fff; border-radius:18px; padding:22px; position:relative; overflow:hidden;
}
.promo-panel::before{
  content:''; position:absolute; inset:0;
  background:radial-gradient(800px 200px at 100% -20%, rgba(255,255,255,0.20), transparent 60%);
  pointer-events:none;
}

.loader-line{
  height:2px; background:linear-gradient(90deg, #1D6FE8, #5BA0FF, #1D6FE8);
  background-size:200% 100%; animation:shimmer 1.6s linear infinite;
}
@keyframes shimmer{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }

/* ---- Mobile menu (hamburger) button ---- */
/* Default: white icon for the dark hero at top of page */
.burger-btn{
  color:#ffffff;
  background:rgba(255,255,255,0.10);
  border:1px solid rgba(255,255,255,0.30);
  transition:color .35s ease, background-color .35s ease, border-color .35s ease;
}
/* When header turns light (scrolled) OR on light-theme pages: navy icon */
header.site.scrolled .burger-btn,
body[data-nav-theme="light"] header.site .burger-btn{
  color:#0A3575;
  background:#ffffff;
  border-color:rgba(10,53,117,0.18);
}

/* ---- Mobile drawer ---- */
.drawer{ position:fixed; inset:0; z-index:80; pointer-events:none; overflow:hidden; }
.drawer .backdrop{ position:absolute; inset:0; background:rgba(6,18,46,0.45); opacity:0; transition:opacity .3s ease; }
.drawer .panel{
  position:absolute; top:0; right:0; bottom:0; width:min(420px, 92vw);
  background:#fff; transform:translateX(100%);
  transition:transform .4s cubic-bezier(.2,.7,.2,1);
  box-shadow:-20px 0 60px -20px rgba(10,53,117,0.30);
  display:flex; flex-direction:column;
}
.drawer.on{ pointer-events:auto; }
.drawer.on .backdrop{ opacity:1; }
.drawer.on .panel{ transform:translateX(0); }

.acc-trigger{
  display:flex; align-items:center; justify-content:space-between; width:100%;
  padding:16px 0; border-bottom:1px solid var(--line);
  font-weight:600; font-size:16px; color:var(--ink);
  background:none; border-left:none; border-right:none; border-top:none;
  text-decoration:none; cursor:pointer;
}
.acc-trigger .chev{ transition:transform .3s ease; color:var(--azure); }
.acc-trigger.open .chev{ transform:rotate(180deg); }
.acc-body{ max-height:0; overflow:hidden; transition:max-height .45s cubic-bezier(.2,.7,.2,1); }
.acc-body.open{ max-height:1200px; }

/* ---- Footer ---- */
footer.site{
  background:linear-gradient(180deg, #061A40 0%, #04122e 100%);
  color:#c5d2ea;
}
footer.site a{ text-decoration:none; transition:color .2s ease; }
footer.site a:hover{ color:#fff; }
