/* ===========================
   BASE HEADER
=========================== */

html {
  scroll-padding-top: 96px; /* match header height */
}


.jn-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #1e1f20;
  z-index: 99999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}



.nav-container {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 24px;
}

/* ===========================
   NAV LAYOUT (DESKTOP)
=========================== */
/* ===========================
   DESKTOP HEADER GRID
=========================== */

/* ===========================
   DESKTOP GRID LAYOUT
=========================== */

.jn-nav {
  width: 100%;
}

.jn-nav-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
}

/* LEFT */
.jn-left {
  display: flex;
  align-items: center;
}

/* CENTER (true center) */
.jn-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* RIGHT ghost column */
.jn-right-ghost {
  width: 40px;
}

/* Logo sizing */
.jn-logo img,
.jn-aeon-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* Ghost mirrors left logo width */
.jn-right-ghost {
  width: calc(40px * 1.6);
}


/* ===========================
   LINKS & LOGOS
=========================== */

.menu__item {
  position: relative;
  display: flex;
  align-items: center;
}

/* Slight left shift for AEON logo */
.menu__item.aeon-hover {
  margin-left: -16px; /* adjust: -8px / -12px / -20px */
}


.menu__link,
.jn-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.jn-logo img,
.jn-aeon-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* ===========================
   HOVER EFFECTS
=========================== */

.menu__link:hover,
.jn-logo:hover {
  background: linear-gradient(
    90deg,
    var(--primary_color),
    var(--secondary_color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu__link::before,
.menu__link::after,
.jn-logo::before,
.jn-logo::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 2px;
  width: 0;
  transition: width 0.3s ease;
}

.menu__link::before,
.jn-logo::before {
  left: 50%;
  background: var(--secondary_color);
}

.menu__link::after,
.jn-logo::after {
  right: 50%;
  background: var(--primary_color);
}

.menu__link:hover::before,
.menu__link:hover::after,
.jn-logo:hover::before,
.jn-logo:hover::after {
  width: 50%;
}

/* ===========================
   AEON LOGO HOVER SWAP
=========================== */

.aeon-hover .menu__link {
  position: relative;
}

.aeon-logo {
  height: 40px;
  width: auto;
  display: block;
  transition: opacity 0.25s ease;
}

/* Stack images */
.aeon-default {
  opacity: 1;
}

.aeon-hover-img {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Swap on hover */
.aeon-hover .menu__link:hover .aeon-default {
  opacity: 0;
}

.aeon-hover .menu__link:hover .aeon-hover-img {
  opacity: 1;
}


/* ===========================
   DROPDOWNS (DESKTOP)
=========================== */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: #1e1f20;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px 0;
  min-width: 200px;
  list-style: none;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

.dropdown-menu li a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--primary_color);
}

/* ===========================
   HAMBURGER (MOBILE)
=========================== */

.jn-hamburger {
  display: none;
}


/* ===========================
   MOBILE BREAKPOINT
   =========================== */
@media (max-width: 992px) {
    /* 🔥 KILL DESKTOP GRID ON MOBILE */
  .jn-nav-grid {
    display: block;
  }

  .jn-right-ghost {
    display: none;
  }

  /* Reset center group to act like old .jn-menu */
  .jn-center {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
  }

    /* Remove desktop dropdown bridge on mobile */
    .dropdown::after {
        display: none;
    }
    
    /* Show Hamburger */
    .jn-hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 9999 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        position: fixed;
        top: 20px;
        right: 24px;
    }
    
    .jn-hamburger span {
        width: 28px;
        height: 3px;
        background: #fff;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    /* Hamburger Animation when Active */
    .jn-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .jn-hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .jn-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    /* Mobile container - logo on left, hamburger on right */
    .nav-container {
        justify-content: space-between;
    }
    
    /* Show JusticeNexus logo on left */
    .jn-logo {
        order: -1;
        z-index: 1001;
    }
    
    .jn-logo img {
        height: 40px;
    }
    
    /* Mobile Navigation */
    .jn-nav {
        position: fixed;
        top: 82px;
        left: 0;
        width: 100%;
        height: calc(100vh - 82px);
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(10px);
        
        /* Hidden by default */
        opacity: 0;
        visibility: hidden;
        transform: translateX(-100%);
        
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 40px 20px;
        overflow-y: auto;
        
        transition: all 0.4s ease;
    }
    
    /* Show nav when active */
    .jn-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    /* Mobile Menu */
    .jn-center {
        flex-direction: column;
        gap: 0;
        width: 100%;
        }

    
    .menu__item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .menu__link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 18px 20px;
        font-size: 1.1rem;
    }
    
    /* Remove hover underline on mobile (keep for logos) */
    .menu__link::before,
    .menu__link::after {
        display: none;
    }

    
    .menu__link.active::before,
    .menu__link.active::after {
        display: none;
    }
    
    /* But keep underline for logos on mobile */
    .jn-logo::before,
    .jn-logo::after {
        display: block;
    }
    
    /* Mobile Dropdown */
    .dropdown-menu {
        position: static;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        min-width: 100%;
        
        /* Start collapsed */
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        
        transition: max-height 0.4s ease, padding 0.4s ease;
    }
    
    /* Show dropdown when parent has active class */
    .dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 10px 0;
    }
    
    .dropdown-menu li a {
        /* text-align: center; */
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .dropdown-menu li a:hover {
        padding-left: 20px;
        background: rgba(255, 255, 255, 0.08);
    }
    
    /* AEON logo in mobile menu */
    .jn-aeon-logo {
        height: 35px;
        margin: 10px 0;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ===========================
   SMALL MOBILE
   =========================== */
@media (max-width: 575px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .jn-logo img {
        height: 35px;
    }
    
    .jn-hamburger {
        top: 18px;
        right: 16px;
    }
    
    .jn-hamburger span {
        width: 24px;
    }
    
    .menu__link {
        font-size: 1rem;
        padding: 16px 20px;
    }
    
    body {
        /* padding-top: 70px; */
    }
    
    .jn-nav {
        top: 70px;
        height: calc(100vh - 70px);
    }
}

.jn-nav,
.dropdown-menu {
  z-index: 10000;
}

/* ===========================
   ACTIVE PAGE HIGHLIGHTING
=========================== */


/* Show underline permanently for active page */
.menu__link.active::before,
.menu__link.active::after {
  width: 50%;
}

/* Keep underline visible on active page */
.menu__link.active::before {
  left: 50%;
  background: var(--secondary_color);
}

.menu__link.active::after {
  right: 50%;
  background: var(--primary_color);
}

/* Also highlight dropdown items when active */
.dropdown-menu li a.active {
  color: var(--primary_color);
  background: rgba(255,255,255,0.08);
}

