/* ============================================================
   DMA CUSTOM MEGA MENU v12.1 -- css/megamenu.css
   ============================================================

   Squarespace loads this from Cloudflare Pages via a <link> tag in
   Pages > Custom Code > Code Injection > Header. Pairs with
   js/megamenu.js. The inline Code Injection block (v11.1) is retired;
   the repo is canonical as of v12.

   v12.1 CHANGES (August 31, 2026, same session):
   - #dma-announcement-host block appended at end of file: ruling 1
     styling for the relocated native Announcement Bar (Red background,
     Cloud text; relocation logic in megamenu.js v12.1).

   v12 CHANGES (August 31, 2026 -- item 37 session):
   - Migrated out of inline Code Injection into this repo file.
   - Featured column removed site-wide (ruling: menu is evergreen,
     Announcement Bar carries time-sensitive promos). .col-featured
     rules deleted; .mega-cols grid is now 2 columns.
   - Announcement Bar UNHIDDEN: .header-announcement-bar-wrapper
     removed from the hide rule so the native bar can render. The
     native header itself stays hidden. Bar position must be
     live-verified with the bar enabled.
   - Active/open underline recolored: --dma-copper #C67A3C (not in
     the Dopamine palette; prohibited earth tone) replaced with
     Sunny --dma-sunny #F5C842.
   - Deep Cobalt fallbacks corrected #2E4AA3 -> #2D4AB0 (canonical).
   - Utility bar contrast restyle (scope part 7): labels were
     #5A5A56 on #141413, far below the contrast floor. Now Cloud at
     0.72 alpha, weight 500, hover full Cloud. Separators lifted to
     match. Bar background stays #141413 (deliberate darker strip
     against Ink #1A1A18; not pure black, not a violation).

   Everything not listed above is carried verbatim from v11.1.
   Hover logic, panel timing, mobile accordion, and the v7 overlay
   fix are unchanged.

   Last updated: August 31, 2026 -- Andy Whitlock
   ============================================================ */

/* --- HIDE DEFAULT SQUARESPACE NAV ---
   v12: only the header itself. The announcement bar wrapper is no
   longer hidden -- ruling 1 makes the native Announcement Bar the
   time-sensitive promo surface. */
header#header {
  display: none !important;
}

/* --- SQUARESPACE OVERLAY FIX ---
   Squarespace hero sections put invisible overlay divs (.fluidImageOverlay)
   directly below the nav bar. These steal mouse events from our mega menu
   when the cursor crosses the nav/content boundary. Disabling their
   pointer-events prevents this. Does not affect hero image appearance. */
.fluidImageOverlay,
.section-background-overlay {
  pointer-events: none !important;
}

/* --- NAV PROPERTIES --- */
:root {
  --nav-utility-h: 28px;
  --nav-main-h: 64px;
  --nav-total-h: 92px;
  --stagger-step: 30ms;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  padding-top: var(--nav-total-h) !important;
}

/* ============================================================
   UTILITY BAR
   v12 contrast restyle: the old #5A5A56-on-#141413 labels sat far
   below the design system contrast floors. Cloud at 0.72 alpha
   clears WCAG AA for this size at weight 500.
   ============================================================ */
.util-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  height: var(--nav-utility-h);
  background: #141413;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.util-bar a {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(250, 250, 248, 0.72);
  text-decoration: none;
  text-transform: uppercase;
  padding: 0 10px;
  transition: color 0.2s;
}

.util-bar a:hover { color: var(--dma-cloud, #FAFAF8); }

.util-bar .sep {
  color: rgba(250, 250, 248, 0.22);
  font-size: 10px;
  user-select: none;
}

/* ============================================================
   MAIN NAV
   ============================================================ */
.main-nav {
  position: fixed;
  top: var(--nav-utility-h);
  left: 0; right: 0;
  z-index: 9999;
  height: var(--nav-main-h);
  background: var(--dma-ink, #1A1A18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 56px;
  width: auto;
  display: block;
}

.nav-items {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-item {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-item > .nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--dma-slate, #8A8A84);
  text-decoration: none;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}

/* Sunny underline -- instant on/off, no animation.
   v12: was --dma-copper #C67A3C (palette violation). */
.nav-item > .nav-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--dma-sunny, #F5C842);
  opacity: 0;
}

/* Active page */
.nav-item.active > .nav-label {
  color: var(--dma-cloud, #FAFAF8);
}

.nav-item.active > .nav-label::after {
  opacity: 1;
}

/* Hide active underline when a different dropdown is open */
.nav-items:has(.nav-item.open) .nav-item.active:not(.open) > .nav-label::after {
  opacity: 0;
}

/* Open item: white text + underline */
.nav-item.open > .nav-label {
  color: var(--dma-cloud, #FAFAF8);
}

.nav-item.open > .nav-label::after {
  opacity: 1;
}

/* CTA button */
.nav-cta {
  margin-left: 16px;
  flex-shrink: 0;
}

.nav-cta a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--dma-cobalt, #3B5CCC);
  color: var(--dma-cloud, #FAFAF8);
  padding: 7px 14px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.15s;
}

.nav-cta a:hover {
  background: var(--dma-cobalt-deep, #2D4AB0);
  transform: translateY(-1px);
}

/* ============================================================
   MEGA PANEL -- fades in at final position (no transform)
   v7: removed translateY animation. The bounce looked nice but
   created a gap between cursor and panel during the animation
   where Squarespace's hero overlay stole mouse events.
   v12: two-column grid (Browse + Quick Links). Featured is gone.
   ============================================================ */
.mega-panel {
  position: fixed;
  top: var(--nav-total-h);
  left: 0; right: 0;
  background: #1E1E1C;
  padding: 32px 48px 40px;
  z-index: 9998;
  border-top: 1px solid rgba(255,255,255,0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.12s ease,
    visibility 0s linear 0.12s;
}

.nav-item.open .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.1s ease,
    visibility 0s linear 0s;
}

.mega-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Column headers */
.mega-col-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 16px;
  font-family: 'Bricolage Grotesque', sans-serif;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.08s, transform 0.08s;
}

.nav-item.open .mega-col-head {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.2s ease 40ms,
    transform 0.25s var(--bounce) 40ms;
}

/* Links -- stagger + background highlight */
.mega-col a {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 4px;
  font-family: 'Bricolage Grotesque', sans-serif;
  position: relative;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.07) 0%,
    rgba(255,255,255,0.03) 80%,
    transparent 100%
  );
  background-size: 0% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.08s ease,
    transform 0.08s ease,
    color 0.15s ease,
    background-size 0.3s ease;
}

.nav-item.open .mega-col a {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.3s ease calc(80ms + var(--i, 0) * var(--stagger-step)),
    transform 0.35s var(--bounce) calc(80ms + var(--i, 0) * var(--stagger-step)),
    color 0.15s ease,
    background-size 0.3s ease;
}

.mega-col a:hover {
  color: rgba(255,255,255,1);
  background-size: 100% 100%;
}

/* Quick links column */
.col-quick a { color: rgba(255,255,255,0.5); }

.col-quick a:hover {
  color: rgba(255,255,255,1);
  background-size: 100% 100%;
}

/* Backdrop */
.mega-backdrop {
  position: fixed;
  top: var(--nav-total-h);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  pointer-events: none;
}

.mega-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================================
   MOBILE NAV
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px; height: 24px;
  cursor: pointer;
  background: none; border: none; padding: 0;
}

.hamburger span {
  display: block; height: 2px; width: 100%;
  background: var(--dma-cloud, #FAFAF8);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: var(--nav-total-h);
  left: 0; right: 0; bottom: 0;
  background: var(--dma-ink, #1A1A18);
  z-index: 9996;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  padding: 16px 0 120px;
}

.mobile-menu.show { transform: translateX(0); }
body.mobile-open { overflow: hidden !important; }

.mob-section { border-bottom: 1px solid rgba(255,255,255,0.06); }

.mob-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 24px;
  background: none; border: none; cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--dma-cloud, #FAFAF8); text-align: left;
}

.mob-trigger .chev {
  width: 12px; height: 12px;
  border-right: 2px solid var(--dma-cloud, #FAFAF8);
  border-bottom: 2px solid var(--dma-cloud, #FAFAF8);
  transform: rotate(45deg);
  transition: transform 0.3s var(--bounce);
  opacity: 0.5; flex-shrink: 0;
}

.mob-section.open .mob-trigger .chev { transform: rotate(-135deg); }

.mob-links {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mob-section.open .mob-links { max-height: 500px; }

.mob-links a {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 400;
  color: rgba(250,250,248,0.6);
  text-decoration: none;
  padding: 10px 24px 10px 56px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.08s ease, transform 0.08s ease, color 0.15s ease;
}

.mob-section.open .mob-links a {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.2s ease calc(var(--i, 0) * 40ms),
    transform 0.2s ease calc(var(--i, 0) * 40ms),
    color 0.15s ease;
}

.mob-links a:hover { color: var(--dma-cloud, #FAFAF8); }

.mob-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 16px 24px;
  background: var(--dma-ink, #1A1A18);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 9997;
  display: none;
}

body.mobile-open .mob-cta { display: block; }

.mob-cta a {
  display: block; text-align: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px; font-weight: 800;
  background: var(--dma-cobalt, #3B5CCC);
  color: var(--dma-cloud, #FAFAF8);
  padding: 14px; border-radius: 4px;
  text-decoration: none; text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.mob-cta a:hover { background: var(--dma-cobalt-deep, #2D4AB0); }

@media (max-width: 1024px) {
  .nav-items, .nav-cta { display: none !important; }
  .hamburger { display: flex; }
  .mega-panel, .mega-backdrop { display: none !important; }
}

@media (min-width: 1025px) {
  .mobile-menu, .mob-cta, .hamburger { display: none !important; }
}

/* Accessibility */
.nav-label:focus-visible,
.mega-col a:focus-visible,
.util-bar a:focus-visible,
.nav-cta a:focus-visible,
.mob-trigger:focus-visible,
.mob-links a:focus-visible {
  outline: 2px solid var(--dma-cobalt, #3B5CCC);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -100px; left: 16px;
  z-index: 100000;
  background: var(--dma-cobalt, #3B5CCC);
  color: var(--dma-cloud, #FAFAF8);
  padding: 8px 16px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 600;
  text-decoration: none; border-radius: 4px;
  transition: top 0.2s;
}

.skip-link:focus { top: 8px; }

/* ============================================================
   v12.1: ANNOUNCEMENT BAR HOST
   The native bar relocates here (see megamenu.js v12.1). Ruling 1
   styling: Red background, Cloud text, the events/urgency treatment.
   In flow directly below the fixed nav; pushes content naturally.
   ============================================================ */
#dma-announcement-host {
  position: relative;
  z-index: 9995;
}

#dma-announcement-host .sqs-announcement-bar-content {
  background: var(--dma-red, #E84B2F);
  color: var(--dma-cloud, #FAFAF8);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 44px;
  position: relative;
}

#dma-announcement-host .sqs-announcement-bar-text a {
  color: var(--dma-cloud, #FAFAF8);
  text-decoration: underline;
}

#dma-announcement-host .sqs-announcement-bar-close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--dma-cloud, #FAFAF8);
  cursor: pointer;
  opacity: 0.8;
}

#dma-announcement-host .sqs-announcement-bar-close:hover { opacity: 1; }
