/* ==========================================================================
   Site header
   Structure, mega menu and mobile navigation adapted from the 2026 redesign
   header-inner, wired to the existing Bootstrap based pages.
   ========================================================================== */

:root {
  --nav-ink: #0b0a1e;
  --nav-red: #ec1c24;
  --nav-red-hover: #ff3039;
  --nav-teal: #3ef0a5;
  --nav-h: 88px;
  --nav-gutter: 32px;
  --nav-font: "Georama", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --nav-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- header shell ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--nav-h);
  color: var(--nav-ink);
  background: rgba(255, 255, 255, 1);
  border-bottom: 1px solid rgba(11, 10, 30, 0.08);
  backdrop-filter: blur(16px) saturate(1.2);
  transition:
    background 0.3s var(--nav-ease),
    border-color 0.3s var(--nav-ease);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(11, 10, 30, 0.14);
}
.header-inner {
  position: relative;
  width: min(1320px, calc(100% - var(--nav-gutter) * 2));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-header .icon,
.mobile-nav .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-header .icon--sm,
.mobile-nav .icon--sm {
  width: 14px;
  height: 14px;
}

/* ---------- brand ---------- */
.site-header .brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 1;
}
.site-header .brand img {
  width: 158px;
  height: auto;
}

/* ---------- primary nav ---------- */
.site-header .nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 0;
}
.site-header .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: rgba(11, 10, 30, 0.72);
  font-family: var(--nav-font);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.2s var(--nav-ease),
    background 0.2s var(--nav-ease);
}
.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
  color: var(--nav-ink);
  background: rgba(11, 10, 30, 0.06);
}
.site-header .nav-link.is-active {
  color: #9c0000;
  background: transparent;
}
.site-header .nav-link .chev {
  width: 10px;
  height: 10px;
  opacity: 0.55;
}

/* ---------- header actions ---------- */

/* ---------- menu toggle ---------- */
.site-header .nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 10, 30, 0.18);
  border-radius: 12px;
  background: rgba(11, 10, 30, 0.04);
  color: var(--nav-ink);
  cursor: pointer;
}
.site-header .nav-toggle .icon {
  width: 20px;
  height: 20px;
}

/* ---------- mega menu ---------- */
.site-header .has-mega {
  position: relative;
}
.site-header .mega {
  position: absolute;
  top: calc(100% + 24px);
  right: -8px;
  width: 360px;
  box-sizing: border-box;
  padding: 22px;
  border: 1px solid rgba(11, 10, 30, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 40px 100px -30px rgba(11, 10, 30, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.22s var(--nav-ease),
    transform 0.22s var(--nav-ease),
    visibility 0.22s;
  z-index: 20;
}
.site-header .mega::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 24px;
}
.site-header .has-mega:hover .mega,
.site-header .has-mega:focus-within .mega,
.site-header .has-mega.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-header .mega-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.site-header .mega-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.site-header .mega-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s var(--nav-ease);
}
.site-header .mega-item:hover {
  background: rgba(11, 10, 30, 0.06);
}
.site-header .mega-item b {
  display: block;
  font-family: var(--nav-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--nav-ink);
}
.site-header .mega-item span span {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(11, 10, 30, 0.55);
  font-weight: 400;
  letter-spacing: 0;
}
.site-header .mega-item .mega-arrow {
  width: 13px;
  height: 13px;
  color: rgba(11, 10, 30, 0.35);
}
.site-header .mega-item.is-active b {
  color: #9c0000;
}

/* ---------- compact dropdown (Company) ---------- */
.site-header .has-mega--company .mega {
  width: 300px;
}

/* ---------- mobile navigation ---------- */
.mobile-nav {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1029;
  padding: 22px var(--nav-gutter) 40px;
  overflow-y: auto;
  background: var(--nav-ink);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s var(--nav-ease),
    transform 0.25s var(--nav-ease),
    visibility 0.25s;
}
body.nav-open .mobile-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
body.nav-open {
  overflow: hidden;
}
.mobile-nav .m-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  font-family: var(--nav-font);
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}
.mobile-nav .m-link.is-active,
.mobile-nav .m-sub-toggle.is-active,
.mobile-nav .m-sub a.is-active {
  color: var(--nav-red-hover);
}
.mobile-nav .m-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background: none;
  color: #fff;
  font-family: var(--nav-font);
  font-size: 20px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.mobile-nav .m-sub-toggle .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--nav-ease);
}
.mobile-nav .m-sub-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
.mobile-nav .m-sub {
  display: none;
  padding: 8px 0 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}
.mobile-nav .m-sub.is-open {
  display: block;
}
.mobile-nav .m-sub a {
  display: block;
  padding: 9px 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}
.mobile-nav .m-sub a b {
  color: #fff;
  font-weight: 500;
}
.mobile-nav .m-meta {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.42);
}
.mobile-nav .m-meta a {
  color: inherit;
  text-decoration: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root {
    --nav-gutter: 24px;
  }
  .site-header .nav-link {
    padding: 10px 8px;
    font-size: 13px;
  }
  .site-header .nav-link[data-nav="join-us"] {
    display: none;
  }
  .site-header .brand img {
    width: 146px;
  }
  .site-header .mega {
    width: 400px;
  }
}
@media (max-width: 1024px) {
  :root {
    --nav-h: 76px;
    --nav-gutter: 20px;
  }
  .site-header .nav {
    display: none;
  }
  .site-header .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}
