﻿/*
 * aj-mega.css — Mega-menu styles
 * Loaded only when primary nav is active.
 */

/* ── Site header ──────────────────────────────────────────────────────── */
.ajcs-mega-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 13, 0.96);
  border-bottom: 1px solid rgba(192, 192, 192, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 0.2s ease, box-shadow 0.2s ease;
}

.ajcs-mega-header.is-scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.ajcs-mega-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wp--style--global--wide-size);
  margin: 0 auto;
  padding: 0 var(--wp--preset--spacing--6);
  height: 96px;
  gap: 32px;
}

/* Brand */
.ajcs-mega-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.ajcs-mega-header__brand svg,
.ajcs-mega-header__brand img { width: 120px; max-height: 104px; height: auto; object-fit: contain; }
.ajcs-mega-header__site-name {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Primary nav */
.ajcs-mega-header__nav { flex: 1; }

.ajcs-mega-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 96px;
}

.ajcs-mega-header__menu > li {
  display: flex;
  align-items: center;
  position: relative;
}

.ajcs-mega-header__item-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  height: 100%;
  font-family: var(--wp--preset--font-family--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(192, 192, 192, 0.8);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
  cursor: pointer;
}
.ajcs-mega-header__item-link:hover,
.ajcs-mega-header__menu > li.current-menu-item > .ajcs-mega-header__item-link,
.ajcs-mega-header__menu > li.current-menu-ancestor > .ajcs-mega-header__item-link {
  color: #fff;
}

.ajcs-mega-header__chevron {
  font-size: 13px;
  opacity: 0.5;
  transition: transform 0.2s ease;
  margin-top: 1px;
}
.ajcs-mega-header__menu > li[aria-expanded="true"] .ajcs-mega-header__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Actions */
.ajcs-mega-header__actions { flex-shrink: 0; }
.ajcs-mega-header__cta { font-size: 14px; padding: 12px 20px; }

/* ── Mega panel ───────────────────────────────────────────────────────── */
.ajcs-mega-panel {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 480px;
  background: var(--wp--preset--color--navy-900);
  border: 1px solid rgba(192, 192, 192, 0.14);
  border-top: 2px solid var(--wp--preset--color--ignition-red);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
}

/* Open state — toggled by JS */
.ajcs-mega-header__menu > li.is-open > .ajcs-mega-panel,
.ajcs-mega-header__menu > li:focus-within > .ajcs-mega-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ajcs-mega-panel__inner {
  padding: 28px 32px 32px;
}

.ajcs-mega-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ajcs-mega-panel__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: rgba(192, 192, 192, 0.75);
  font-family: var(--wp--preset--font-family--sans);
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid rgba(192, 192, 192, 0.06);
  transition: color 0.15s ease, background 0.15s ease;
}
.ajcs-mega-panel__link:hover {
  color: #fff;
  background: rgba(200, 16, 46, 0.07);
  transform: translateX(4px);
  border-radius: 0;
}
.ajcs-mega-panel__list > li:last-child .ajcs-mega-panel__link { border-bottom: 0; }

/* ── Responsive — collapse to standard dropdown on mobile ────────────── */
@media (max-width: 1024px) {
  .ajcs-mega-header__menu { display: none; }
  .ajcs-mega-header__inner { justify-content: space-between; }
}

@media (max-width: 600px) {
  /* Shrink logo + tighten spacing so CTA button fits on narrow screens */
  .ajcs-mega-header__inner {
    padding: 0 12px;
    gap: 8px;
    height: 68px;
  }
  .ajcs-mega-header__brand svg,
  .ajcs-mega-header__brand img { width: 60px; }
  .ajcs-mega-header__cta {
    padding: 8px 14px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }
}
