/* === Global Navigation — veritymod.com === */
/* Responsive: Desktop dropdown menu + Mobile hamburger slide-in */

/* ============================================ */
/*   Accessibility — Skip-to-content link       */
/* ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  padding: 8px 16px;
  background: #7C3AED;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  z-index: 10000;
  transition: top 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid #A78BFA;
  outline-offset: 2px;
}

/* ============================================ */
/*   Accessibility — Visible focus styles       */
/* ============================================ */
body.has-global-nav a:focus-visible,
body.has-global-nav button:focus-visible,
body.has-global-nav input:focus-visible,
body.has-global-nav textarea:focus-visible,
body.has-global-nav select:focus-visible,
body.has-global-nav [tabindex]:focus-visible {
  outline: 2px solid #A78BFA;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

#global-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  background: rgba(9, 9, 11, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #1e1e2e;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.gn-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

/* Brand */
.gn-brand {
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  color: #f1f5f9;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.gn-brand span {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop Menu */
.gn-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gn-item {
  position: relative;
}

.gn-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.gn-trigger:hover,
.gn-trigger:focus-visible {
  color: #f1f5f9;
  background: rgba(167, 139, 250, 0.1);
  outline: none;
}

.gn-arrow {
  font-size: 9px;
  transition: transform 0.2s;
  display: inline-block;
  margin-left: 2px;
}
.gn-item:hover > .gn-trigger .gn-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.gn-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: rgba(17, 17, 24, 0.99);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid #1e1e2e;
  border-radius: 12px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.gn-item:hover > .gn-dropdown,
.gn-item:focus-within > .gn-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(2px);
}

.gn-sub-link {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
.gn-sub-link:hover {
  color: #f1f5f9;
  background: rgba(167, 139, 250, 0.12);
}

/* Highlight current page */
.gn-sub-link.current,
.gn-sub-link[aria-current="page"] {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.08);
}

/* Hamburger — hidden on desktop */
.gn-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1001;
}
.gn-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #f1f5f9;
  border-radius: 2px;
  transition: all 0.25s;
}
.gn-hamburger span + span {
  margin-top: 4px;
}
.gn-hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.gn-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.gn-hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile overlay */
.gn-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}
.gn-overlay.open {
  display: block;
  opacity: 1;
}

/* Mobile slide-in menu */
.gn-mobile {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #0c0c16;
  z-index: 999;
  padding: 64px 22px 30px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.gn-mobile.open {
  transform: translateX(0);
}

.gn-mobile-group {
  margin-bottom: 22px;
}
.gn-mobile-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e1e2e;
}
.gn-mobile-link {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
  transition: color 0.2s;
}
.gn-mobile-link:hover {
  color: #c4b5fd;
}
.gn-mobile-link.current {
  color: #c4b5fd;
}

/* Responsive: Mobile breakpoint */
@media (max-width: 767px) {
  .gn-menu {
    display: none;
  }
  .gn-hamburger {
    display: block;
  }
  .gn-mobile {
    display: block;
  }
  .gn-inner {
    height: 48px;
    padding: 0 16px;
  }
}

/* ============================================ */
/*   Global Body Padding & Spacing Unification  */
/* ============================================ */

body.has-global-nav {
  /* Override per-page inconsistent padding-tops (0~80px) */
  padding-top: 68px !important;
}

/* Responsive: Mobile optimization */
@media (max-width: 767px) {
  body.has-global-nav {
    padding-top: 58px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  /* Prevent inner content overflow on small screens */
  .wrap, .container {
    max-width: 100% !important;
    min-width: unset !important;
  }
  /* Adaptive headings */
  h1 {
    font-size: clamp(22px, 6.5vw, 32px) !important;
    line-height: 1.2 !important;
  }
  h2 {
    font-size: clamp(18px, 5vw, 24px) !important;
  }
}

/* Desktop breathing room */
@media (min-width: 768px) {
  body.has-global-nav {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* Additional mobile polish */
@media (max-width: 480px) {
  body.has-global-nav {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .wrap, main {
    padding: 0 4px;
  }
}

/* ============================================ */
/*   Hero & Page Content Spacing Normalization  */
/* ============================================ */

/* Override per-page hero padding (was 20~100px → unified 32px) */
body.has-global-nav .hero,
body.has-global-nav .hero-section {
  padding-top: 32px !important;
  padding-bottom: 24px !important;
  text-align: center;
}

/* Consistent badge-to-title gap */
body.has-global-nav .hero-badge,
body.has-global-nav .badge,
body.has-global-nav .page-badge {
  margin-bottom: 14px !important;
}

/* Pages without hero wrapper — ensure first h1 has breathing room */
body.has-global-nav .wrap > h1:first-child,
body.has-global-nav main > h1:first-child {
  margin-top: 28px;
}

/* Global .wrap centering fallback (in case individual pages omit margin:0 auto) */
body.has-global-nav .wrap {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Mobile: smaller hero spacing */
@media (max-width: 767px) {
  body.has-global-nav .hero,
  body.has-global-nav .hero-section {
    padding-top: 24px !important;
    padding-bottom: 16px !important;
  }
  body.has-global-nav .wrap > h1:first-child {
    margin-top: 20px;
  }
  body.has-global-nav .hero-badge,
  body.has-global-nav .badge {
    font-size: 11px !important;
    padding: 3px 10px !important;
  }
}

