/*
 * Navigation
 * Botti Realty Inc
 */

/* ── Header ───────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding: var(--space-4) 0;
}

header.scrolled {
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  padding: var(--space-3) 0;
}

/* ── Nav Container ───────────────────────── */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── Logo ─────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  height: 50px;
  width: auto;
  display: block;
  transition: filter 0.3s ease;
}

/* On transparent header (hero pages), invert logo to white */
header:not(.scrolled) .nav-logo img {
  filter: brightness(0) invert(1);
}

/* On scrolled white header, show original */
header.scrolled .nav-logo img {
  filter: none;
}

/* ── Nav Links ───────────────────────────── */
.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-8);
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-charcoal);
  text-decoration: none;
  position: relative;
  padding-bottom: var(--space-1);
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--color-navy);
}

.nav-links a.active {
  color: var(--color-navy);
  font-weight: 600;
}

/* Transparent header — make links white */
header:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.9);
}

header:not(.scrolled) .nav-links a:hover,
header:not(.scrolled) .nav-links a.active {
  color: var(--color-white);
}

/* ── Phone Link ──────────────────────────── */
.nav-phone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-gold);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.nav-phone:hover {
  color: var(--color-gold-light);
}

.nav-phone:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

header:not(.scrolled) .nav-phone {
  color: var(--color-gold);
}

/* ── Hamburger ───────────────────────────── */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
  color: var(--color-white);
}

header.scrolled .nav-hamburger {
  color: var(--color-navy);
}

.nav-hamburger:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .nav-phone {
    display: none;
  }
}

/* ── Mobile Panel ────────────────────────── */
.nav-mobile-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  z-index: calc(var(--z-nav) - 1);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: var(--space-20) var(--space-8) var(--space-8);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-mobile-panel.is-open {
  transform: translateY(0);
}

.nav-mobile-panel[aria-hidden="true"] {
  visibility: hidden;
}

.nav-mobile-panel.is-open[aria-hidden="false"] {
  visibility: visible;
}

.mobile-nav-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  background: none;
  border: 1px solid var(--color-grey-light);
  border-radius: var(--radius-sm);
  color: var(--color-navy);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-close:hover {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.mobile-nav-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.nav-mobile-panel nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.nav-mobile-panel nav ul a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--text-3xl);
  color: var(--color-navy);
  text-decoration: none;
  font-weight: 700;
  display: block;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-grey-light);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.nav-mobile-panel nav ul a:hover,
.nav-mobile-panel nav ul a.active {
  color: var(--color-gold);
  padding-left: var(--space-4);
}

.nav-mobile-panel nav ul a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mobile-phone {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-gold);
  text-decoration: none;
  margin-top: auto;
  padding-top: var(--space-6);
}

.mobile-phone:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Mobile logo in panel header area */
.nav-mobile-logo {
  position: absolute;
  top: var(--space-4);
  left: var(--space-6);
  height: 40px;
  width: auto;
}
