/* HAIL site navigation. Single source of truth for the public-page top nav.
 *
 * Each public page only needs:
 *   <link rel="stylesheet" href="/css/site-nav.css">
 *   <script defer src="/js/site-nav.js"></script>
 * with the standard <nav><div class="container">...</div></nav> markup.
 *
 * Page-level <style> blocks should not redefine nav, .nav-logo, .nav-links,
 * .nav-cta, or the hamburger. Keep this file authoritative.
 */

/* ============================================================== */
/* Desktop nav layer                                              */
/* ============================================================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px 0;
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #0F1115;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.18s ease;
}

.nav-logo:hover {
  color: #8A9A84;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0F1115;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: #8A9A84;
}

.nav-cta {
  background: #0F1115;
  color: #F5F3EF !important;
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-cta:hover {
  background: #8A9A84;
  color: #F5F3EF !important;
}

/* ============================================================== */
/* Hamburger (mobile)                                              */
/* ============================================================== */

.nav-hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
  z-index: 200;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #0F1115;
  margin: 5px auto;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

nav.nav-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

  /* Top-down dropdown panel anchored to the bottom of the nav bar. */
  nav .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #FAF9F7;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.22s ease, opacity 0.18s ease, visibility 0s linear 0.22s;
    z-index: 150;
  }

  nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.22s ease, opacity 0.18s ease, visibility 0s linear 0s;
  }

  /* Override any leftover page-level rules for the mobile panel. */
  nav .nav-links a,
  nav .nav-links a:not(.nav-cta) {
    display: block !important;
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #0F1115 !important;
    text-decoration: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  nav .nav-links a:hover {
    color: #8A9A84 !important;
  }

  nav .nav-links a:last-child {
    border-bottom: 0;
  }

  /* CTA reads as a distinct centered pill at the bottom of the panel. */
  nav .nav-links .nav-cta {
    display: block !important;
    width: auto !important;
    align-self: center !important;
    margin: 14px 0 4px !important;
    padding: 14px 44px !important;
    background: #0F1115 !important;
    color: #F5F3EF !important;
    border-radius: 4px !important;
    text-align: center;
    font-weight: 600 !important;
    border-bottom: 0 !important;
    letter-spacing: 0.06em !important;
  }

  nav .nav-links .nav-cta:hover {
    background: #8A9A84 !important;
    color: #F5F3EF !important;
  }
}
