/* QENEX apex cross-product nav — house cyan #0d9ba8 (email / Dual-Rail CTA fill).
 * Live: /var/www/qenex.ai/qx-nav.css  Deploy: scripts/deploy-qx-nav.sh
 * Body links stay navy/white — do not use house cyan as text-on-white.
 * @import first (site-wide token layer); safe where /design/tokens.css is
 * not routed (import 404s silently, page renders with the rules below).
 */
@import url("/design/tokens.css");
/* QENEX cross-product nav banner — loaded as an external stylesheet because
 * qenex.ai's CSP is `style-src 'self'` (no unsafe-inline). Same content as the
 * previous inline <style id="qx-nav-css">, kept identical so the rendered
 * banner matches what was originally designed. */

/* body padding-top no longer needed: nav is position:sticky */

#qx-nav {
  position: sticky;
  top: 0;
  height: 56px;
  z-index: 9000;
  background: rgba(10, 14, 39, 0.92);
  border-bottom: 1px solid rgba(13, 155, 168, 0.15);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

#qx-nav .qx-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 48px;
  min-width: 48px;
  padding: 4px 0;
}
#qx-nav .qx-brand img {
  height: 44px;
  width: auto;
  display: block;
}
@media (max-width: 768px) {
  #qx-nav .qx-brand img { height: 36px; }
}

#qx-nav .qx-products {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

#qx-nav .qx-products a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  transition: color 0.15s, background 0.15s;
}

#qx-nav .qx-products a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

#qx-nav .qx-products a.qx-current {
  color: #0d9ba8;
  background: rgba(13, 155, 168, 0.08);
}

#qx-nav .qx-products a.qx-cta {
  color: #0d9ba8;
  border: 1px solid rgba(13, 155, 168, 0.35);
}

#qx-nav .qx-products a.qx-cta:hover {
  background: rgba(13, 155, 168, 0.12);
  color: #fff;
}

@media (max-width: 768px) {
  /* Mobile: enlarge the nav strip so every link reaches the 48×48
   * Apple-HIG / WCAG 2.2 §2.5.5 touch-target minimum. */
  /* mobile body padding-top no longer needed */
  #qx-nav {
    height: 64px;
    padding: 0 0.75rem;
    font-size: 0.78rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #qx-nav .qx-brand {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.4rem;
  }
  #qx-nav .qx-products {
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
  }
  #qx-nav .qx-products a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.7rem;
    white-space: nowrap;
  }
}

/* ============================================================
   Mobile nav hamburger (CSS-only checkbox-hack, <=768px breakpoint).
   Added 2026-05-17 in response to design-audit D3 verdict.
   Replaces the previous horizontal-scroll treatment.
   ============================================================ */

/* Default desktop: hamburger hidden, nav visible */
#qx-nav .qx-nav-toggle { display: none; }
#qx-nav .qx-hamburger { display: none; }

@media (max-width: 768px) {
  /* Restore nav to relative positioning so absolute children anchor correctly */
  #qx-nav {
    position: relative;
    overflow-x: visible;
    flex-wrap: nowrap;
    height: auto;
    min-height: 64px;
  }

  /* Hide the checkbox visually but keep accessible */
  #qx-nav .qx-nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
  }
  #qx-nav .qx-hamburger {
    min-width: 48px;
    min-height: 48px;
  }

  /* Hamburger label (the visible 3-bar button) */
  #qx-nav .qx-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    padding: 4px 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    margin-left: auto;
    z-index: 100;
  }
  #qx-nav .qx-hamburger:hover { opacity: 0.85; }
  #qx-nav .qx-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #0d9ba8;
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
  }

  /* Drawer: replace horizontal nav with stacked drawer */
  #qx-nav .qx-products {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0A0E27;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid #1E2A4A;
    border-bottom: 1px solid #1E2A4A;
    box-shadow: 0 8px 16px rgba(0,0,0,0.45);
    z-index: 90;
  }
  #qx-nav .qx-nav-toggle:checked ~ .qx-products {
    display: flex;
  }

  /* Drawer link styling */
  #qx-nav .qx-products a {
    width: 100%;
    padding: 0.9rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 48px;
    box-sizing: border-box;
  }
  #qx-nav .qx-products a:last-child { border-bottom: 0; }
  #qx-nav .qx-products a.qx-cta {
    margin-top: 0.4rem;
    background: rgba(13, 155, 168, 0.08);
    text-align: center;
  }

  /* Hamburger transform when checked (X icon) */
  #qx-nav .qx-nav-toggle:checked ~ .qx-hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  #qx-nav .qx-nav-toggle:checked ~ .qx-hamburger span:nth-child(2) {
    opacity: 0;
  }
  #qx-nav .qx-nav-toggle:checked ~ .qx-hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
