/* ════════════════════════════════════════════════════════
   Property of JIL Sovereign Technologies, Inc. (DE).
   All Rights Reserved. 2025-2026 Patent Pending.
   Author: Jeff Mendonca (Dallas TX)
   File:   apps/central-portal/public/assets/jil-header.css
   Repo:   jammer-x/jil-sovereign-full-go-live
   Version: 2026.04.02-975
   ════════════════════════════════════════════════════════
   JIL SOVEREIGN - UNIVERSAL HEADER / NAV (V17)
   Shared CSS for all pages using header.html partial.
   Uses v2-* classes to match the header partial markup.
   Adapted for dark/light via jil-tokens.css variables.
   ════════════════════════════════════════════════════════ */

/* Fallback variables - mapped to token system names.
   When jil-tokens.css loads these get overridden by theme. */
:root {
  --gold: #B8973A;
  --gold-hover: #907530;
  --border-subtle: #CBD5E1;
  --border-strong: #B0BCC9;
  --text-primary: #0F172A;
  --text-secondary: #0F172A;
  --text-muted: #1E293B;
  --text-on-gold: #0B0F16;
  --navy-primary: #102A43;
  --bg-elevated: #FFFFFF;
  --bg-soft: #F0F2F5;
  --bg-overlay: rgba(255,255,255,0.92);
  --blue: #2563EB;
  --blue-tint: rgba(37,99,235,0.08);
  --gold-tint: rgba(184,151,58,0.08);
  --gold-border: rgba(184,151,58,0.28);
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-lg: 0 8px 24px rgba(16,42,67,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

/* ── Header Bar ──────────────────────────────────────────── */
.v2-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  /* Canonical JIL nav: 20% charcoal surface + 2px gold rule. Light
     desaturated charcoal reads as a clear bar without being white-on-cream
     ambiguous. Applied everywhere (institutional partial, V2 SPA, retail).
     Dropdowns + mega menus stay white for readability inside. */
  background: #D7DADD;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--gold, #9A7828);
  transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.v2-header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.05);
  border-bottom-color: rgba(184, 151, 58, 0.14);
}

/* ── Nav Container ───────────────────────────────────────── */
.v2-nav {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  height: 64px;
  overflow: hidden;
}
.v2-nav-item:has(.v2-mega-dropdown-full) {
  position: static;
}

/* ── Logo ────────────────────────────────────────────────── */
.v2-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
  height: 100%;
}
.v2-nav-logo img {
  display: block;
  height: 36px;
  width: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.v14-logo-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Nav Links ───────────────────────────────────────────── */
.v2-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}
.v2-nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.v2-nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.85rem;
  height: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy-primary, #102A43);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.v2-nav-link:hover {
  color: var(--navy-primary, #102A43);
  text-decoration: underline;
  text-decoration-color: var(--gold, #C9A227);
  text-underline-offset: 6px;
}
.v2-nav-link.active {
  color: var(--navy-primary, #102A43);
  text-decoration: underline;
  text-decoration-color: var(--gold, #C9A227);
  text-underline-offset: 6px;
}
.v2-mobile-link.active h4 { color: var(--gold); }

.v2-nav-link .chevron {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.3s;
  margin-top: 1px;
}
.v2-nav-item:hover .chevron { transform: rotate(180deg); }

/* ── Mega Dropdown ───────────────────────────────────────── */
.v2-mega-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle, #CBD5E1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-width: 720px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.08);
  z-index: 10000;
}
.v2-nav-item:hover .v2-mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.v2-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.v2-mega-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s ease;
}
.v2-mega-item:hover { background: var(--bg-soft); }
.v2-mega-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--blue-tint);
}
.v2-mega-text h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}
.v2-mega-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── 6-Column Docs Mega Dropdown ─────────────────────────── */
.v2-mega-dropdown-full {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle, #CBD5E1);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  width: 960px;
  max-width: calc(100vw - 2rem);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.08);
  z-index: 10000;
}
.v2-nav-item:hover .v2-mega-dropdown-full {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.v2-mega-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding: 0.75rem 1rem;
}
.v2-mega-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}
.v2-mega-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}
.v2-mega-link {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.3rem 0;
  transition: color 0.2s;
}
.v2-mega-link:hover { color: var(--gold); }

/* ── Simple Dropdown ─────────────────────────────────────── */
.v2-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle, #CBD5E1);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.08);
  z-index: 10000;
}
/* Hover bridge - prevents accidental dropdown close when moving cursor */
.v2-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.v2-nav-item:hover .v2-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.v2-dropdown-item {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s ease;
}
.v2-dropdown-item:hover { background: var(--bg-soft); color: var(--gold); }

/* ── Nav Actions (right side) ────────────────────────────── */
.v2-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}

/* ── Nav CTA Buttons ─────────────────────────────────────── */
.v14-btn-demo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #FFFFFF;
  color: var(--navy-primary, #102A43);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border: 1px solid var(--navy-primary, #102A43);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.v14-btn-demo:hover {
  background: #F0F2F5;
  color: var(--navy-primary, #102A43);
}
.v14-btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-soft, #F0F2F5);
  color: var(--text-primary, #0F172A);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-subtle, #D6E0EB);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.v14-btn-buy:hover {
  background: #D6E0EB;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

/* ── Language Selector ───────────────────────────────────── */
.jil-i18n-selector {
  position: relative;
}

/* ── Hamburger (Mobile) ──────────────────────────────────── */
.v2-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 10001;
  padding: 12px 10px;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.v2-hamburger:active {
  background: var(--bg-soft);
}
.v2-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  position: absolute;
  left: 10px;
  right: 10px;
  width: calc(100% - 20px);
  transition: all 0.3s ease;
  border-radius: 2px;
}
.v2-hamburger span:nth-child(1) { top: 12px; }
.v2-hamburger span:nth-child(2) { top: 21px; }
.v2-hamburger span:nth-child(3) { top: 30px; }
.v2-hamburger.open { background: var(--bg-soft); }
.v2-hamburger.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.v2-hamburger.open span:nth-child(2) { opacity: 0; }
.v2-hamburger.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ── Mobile Menu ─────────────────────────────────────────── */
.v2-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  z-index: 10000;
  padding: 5rem 1.5rem 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.v2-mobile-menu.open { display: block; }
body.v2-menu-open { overflow: hidden; }
.v2-mobile-section { margin-bottom: 1.5rem; }
.v2-mobile-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.v2-mobile-link {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}
.v2-mobile-link h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.v2-mobile-link p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}
.v2-mobile-home {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--gold-border, rgba(199,163,78,0.3));
  margin-bottom: 1rem;
}
.v2-mobile-home svg { flex-shrink: 0; }
.v2-mobile-home:active { opacity: 0.7; }
.v2-mobile-home.active { border-bottom-color: var(--gold); }
.v2-mobile-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.875rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1rem;
  background: var(--bg-soft, #F0F2F5);
  color: var(--text-primary, #0F172A);
  border: 1px solid var(--border-subtle, #D6E0EB);
  text-decoration: none;
}

/* ── Mobile Accordion ──────────────────────────────────────── */
.v2-mobile-accordion-body {
  display: none;
}
.v2-mobile-section.open .v2-mobile-accordion-body {
  display: block;
}
.v2-mobile-section-title {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  padding-right: 1.5rem;
}
.v2-mobile-section-title::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--gold);
  transition: transform 0.2s ease;
}
.v2-mobile-section.open .v2-mobile-section-title::after {
  transform: translateY(-50%) rotate(180deg);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1280px) and (min-width: 1081px) {
  .v2-nav-link { padding: 0 0.55rem; font-size: 0.82rem; }
  .v2-nav { padding: 0 1rem; }
  .v14-logo-text { font-size: 0.95rem; }
  .v2-nav-actions { gap: 0.35rem; }
  .v14-btn-buy,
  .v14-btn-demo { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
}
@media (max-width: 1080px) {
  .v2-nav-links,
  .v2-nav-actions { display: none; }
  .v2-hamburger { display: block; }
  .v2-mega-dropdown,
  .v2-mega-dropdown-full,
  .v2-dropdown { display: none; }
}
@media (max-width: 768px) {
  .v2-nav { height: 56px; padding: 0 1rem; }
  .v2-nav-logo img { height: 28px; width: 28px; }
  .v14-logo-text { font-size: 1rem; }
}
@media (max-width: 480px) {
  .v2-nav { height: 52px; padding: 0 0.75rem; }
  .v2-nav-logo img { height: 24px; width: 24px; }
}

/* ========== Mobile top-bar language picker (v2 + institutional headers) ========== */
.v2-mobile-lang { display: none; position: relative; margin-right: 0.5rem; }
.v2-mobile-lang-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: transparent; color: inherit;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.v2-mobile-lang-trigger:hover { border-color: var(--accent, #2A6BFF); }
.v2-mobile-lang-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 168px; max-height: 60vh; overflow-y: auto;
  /* Force explicit OPAQUE colors regardless of theme — the dropdown must
     pop out from the nav and remain readable on both sovereign-light and
     sovereign-dark. The earlier var(--bg-soft) / var(--text) approach
     produced dark-on-dark / light-on-light combinations on pages with no
     `data-theme` attribute (e.g. legacy product pages). 2026-05-14. */
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px; padding: 4px; z-index: 1100;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}
.v2-mobile-lang-dropdown.open { display: block; }
.v2-mobile-lang-opt {
  padding: 8px 10px; font-size: 0.85rem; color: #0F172A;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.v2-mobile-lang-opt:hover,
.v2-mobile-lang-opt[aria-selected="true"] { background: rgba(184, 144, 58, 0.14); color: #8C6B22; }
[data-theme="sovereign-dark"] .v2-mobile-lang-dropdown {
  background: #1B262E; color: #F5F7FB;
  border-color: rgba(245, 247, 251, 0.12);
}
[data-theme="sovereign-dark"] .v2-mobile-lang-opt { color: #F5F7FB; }
[data-theme="sovereign-dark"] .v2-mobile-lang-opt:hover,
[data-theme="sovereign-dark"] .v2-mobile-lang-opt[aria-selected="true"] {
  background: rgba(228, 195, 90, 0.16); color: #E4C35A;
}

/* Show on mobile only */
@media (max-width: 1080px) {
  .v2-mobile-lang { display: inline-block; }
}

/* Institutional nav: at >1080px the desktop .jil-lang-selector dropdown is
   shown alongside main nav items. At <=1080px the main nav row collapses
   behind the hamburger, hiding the desktop selector — so the v2-mobile-lang
   fallback must remain visible in the top bar to keep language switching
   reachable without opening the drawer. The dual-selector stacking issue
   the earlier `display: none !important` rule was guarding against is
   handled by hiding the desktop selector at the same breakpoint (below). */
@media (min-width: 1081px) {
  .jil-nav .v2-mobile-lang { display: none !important; }
}
@media (max-width: 1080px) {
  .jil-nav .jil-lang-selector { display: none !important; }
}

/* ========== Inline CTA language picker (hero + footer CTAs) ========== */
.v2-cta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.v2-inline-lang { position: relative; }
.v2-inline-lang-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--ink, #e2e8f0); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.v2-inline-lang-trigger:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.28); }
.v2-inline-lang-trigger .flag { font-size: 18px; line-height: 1; }
.v2-inline-lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: #0b1222; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 4px; z-index: 200;
  max-height: 360px; overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.v2-inline-lang.open .v2-inline-lang-dropdown { display: block; }
.v2-inline-lang-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  color: var(--ink, #e2e8f0); font-size: 14px;
}
.v2-inline-lang-opt:hover { background: rgba(255,255,255,0.06); }
.v2-inline-lang-opt.active { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.v2-inline-lang-opt .flag { font-size: 18px; }

/* Print: hide the site nav so 1.5-page exec briefs (/products, /pillars,
   etc.) don't carry the JIL nav onto the printed page. Companion rule
   on the footer sits in /partials/footer-institutional.html. */
@media print {
  .jil-nav { display: none !important; }
  body { padding-top: 0 !important; }
}
