/*
 * nav.css — Fixed navigation bar
 * Source: Build 1 spec — bestyearyet.com Homepage Build Queue
 *
 * Behavior:
 *   - Transparent on page load
 *   - Gains --color-off-white background + shadow after 10px scroll (.scrolled class via nav.js)
 *   - Mobile: hamburger replaces right cluster; drawer slides down from nav bar
 *
 * Depends on: styles/tokens.css (custom properties)
 */


/* ================================================================
 * NAV BAR
 * ================================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 72px;
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.nav.scrolled {
  background: var(--color-off-white);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-logo-img {
  height: 52px;   /* Nav is 72px — 10px padding top/bottom fills the header comfortably */
  width: auto;
  display: block;
}


/* ================================================================
 * DESKTOP RIGHT CLUSTER
 * ================================================================ */

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-login {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-login:hover {
  color: var(--color-text-primary);
}

/* Nav CTA — inherits .btn-primary, overrides size for nav context */
.nav-cta {
  font-size: 15px;
  padding: 12px 24px;
  min-height: 44px;
}


/* ================================================================
 * HAMBURGER BUTTON (mobile only — hidden on desktop)
 * ================================================================ */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Hamburger animates to × when drawer is open */
.nav.is-open .nav-hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.is-open .nav-hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav.is-open .nav-hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ================================================================
 * MOBILE DRAWER
 * Slides down from the nav bar; hidden until .is-open on .nav
 * ================================================================ */

.nav-drawer {
  display: none; /* flex on mobile */
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 28px;
  background: var(--color-off-white);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav.is-open .nav-drawer {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Full-width CTA inside drawer */
.nav-drawer-cta {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.nav-drawer-login {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-secondary);
  text-decoration: none;
  text-align: center;
  padding: 10px 0;
  display: block;
  transition: color var(--transition-fast);
}

.nav-drawer-login:hover {
  color: var(--color-text-primary);
}


/* ================================================================
 * BACKDROP — blur overlay behind mobile drawer
 * ================================================================ */

.nav-backdrop {
  display: none; /* block on mobile */
  position: fixed;
  inset: 0;
  z-index: 999; /* just below nav (1000) */
  background: rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}


/* ================================================================
 * MOBILE BREAKPOINT (max-width: 768px)
 * ================================================================ */

@media (max-width: 768px) {
  .nav {
    height: 64px;
  }

  .nav-inner {
    padding: 0 24px;
  }

  .nav-right {
    display: none; /* replaced by hamburger */
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-drawer {
    display: flex;
  }

  .nav-backdrop {
    display: block;
  }

  .nav-logo-img {
    height: 44px;   /* Mobile nav is 64px — 10px padding top/bottom */
  }
}
