/* ====================================================================
   site-nav.css - Shared Universal Site Header / Navigation
   LIGHT: Minimalist editorial header matching landing page layout.
   Sparse typography, uppercase text links, brand left, nav right.
   ==================================================================== */

.site-header,
.nex-header {
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-border);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  width: 100%;
  height: 80px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) clamp(var(--space-4), 3vw, 46px) var(--space-2) clamp(var(--space-4), 2.35vw, var(--space-9));
  box-sizing: border-box;
  transition: background-color 200ms ease, border-color 200ms ease;
}

/* Landing page hero overlay mode: floating transparently over hero */
body.nex-landing:not(.nex-workspace-page) > .nex-header {
  position: fixed;
  background: transparent;
  border-bottom: none;
}

body.nex-landing:not(.nex-workspace-page) > .nex-header.is-scrolled {
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-border);
}

/* Minimalist editorial brand mark */
.nex-brand,
.nex-brand:visited {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--letter-spacing-heading);
  color: var(--color-nav-link);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
  line-height: 1;
}

.nex-brand:hover,
.nex-brand:focus-visible {
  color: var(--color-accent);
}

/* Right side navigation cluster */
.nex-header-right,
.site-actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  pointer-events: auto;
}

.nex-nav__link,
.nex-nav__link:visited {
  font-family: var(--font-display);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
  color: var(--color-nav-link);
  text-decoration: none;
  opacity: 1;
  transition: opacity 200ms ease, color 200ms ease;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.nex-nav__link:hover,
.nex-nav__link:focus-visible {
  opacity: 1;
  color: var(--color-accent);
}

.nex-nav__link--active,
.nex-nav__link--active:visited {
  opacity: 1;
  color: var(--color-nav-link);
  border-bottom: var(--border-width-strong) solid var(--color-accent);
}

.nex-nav__link--active:hover,
.nex-nav__link--active:focus-visible {
  color: var(--color-accent);
}

.site-header a:not(.btn):focus-visible,
.nex-header a:not(.btn):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

/* Mobile hamburger button: hidden by default on desktop */
.nex-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .site-header,
  .nex-header {
  padding: var(--space-2) var(--space-5);
}

  /* Editorial minimalist 2-bar menu button */
  .nex-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  cursor: pointer;
  gap: var(--space-1-5);
  z-index: 501;
}

  .nex-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease, background-color 180ms ease;
  transform-origin: center;
}

  /* Morph to X when menu is open */
  .nex-header.is-menu-open .nex-menu-toggle__bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

  .nex-header.is-menu-open .nex-menu-toggle__bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

  /* Mobile Navigation Drawer */
  .nex-header-right,
  .site-actions {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100dvh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-20) var(--space-8) var(--space-12);
  gap: var(--space-2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 500;
  overflow-y: auto;
  box-sizing: border-box;
}

  .nex-header.is-menu-open .nex-header-right,
  .nex-header.is-menu-open .site-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

  /* Authentication pages can retain the theme utility without creating an
     empty mobile navigation drawer. */
  .nex-header-right.site-actions--utility,
  .site-actions.site-actions--utility {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: none;
  overflow: visible;
}

  .nex-nav__link,
  .nex-nav__link:visited {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--letter-spacing-heading);
  text-transform: uppercase;
  color: var(--color-nav-link);
  padding: var(--space-3) 0;
  width: 100%;
  border-bottom: var(--border-width) solid var(--color-border);
  opacity: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
}

  .nex-nav__link:hover,
  .nex-nav__link:focus-visible {
  color: var(--color-accent);
  padding-left: var(--space-1-5);
}

  .nex-nav__link--active,
  .nex-nav__link--active:visited {
  color: var(--color-nav-link);
  border-bottom-color: var(--color-accent);
}

  .nex-nav__link--active:hover,
  .nex-nav__link--active:focus-visible {
  color: var(--color-accent);
}
}

body.nex-menu-locked {
  overflow: hidden !important;
}
