/**
 * CHF Theme — Navigation
 * Sticky header, mega-menu dropdowns, mobile hamburger
 */

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(27, 94, 32, 0.1);
}

.nav-wrap {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 80px;
}

/* ==========================================================================
   LOGO
   ========================================================================== */

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 2rem;
}

.logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.logo-text {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--g);
}

.logo-text span {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  color: var(--g);
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: color 0.2s;
  user-select: none;
}

.nav-menu > li > a:hover {
  color: var(--gold);
}

/* CTA button */
.nav-cta > a {
  background: var(--g) !important;
  color: var(--white) !important;
  border-radius: 4px !important;
  padding: 9px 18px !important;
  font-weight: 600 !important;
}

.nav-cta > a:hover {
  background: var(--gm) !important;
  color: var(--white) !important;
}

/* Chevron */
.chev {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  font-size: 10px;
  line-height: 1;
}

.chev::after {
  content: "\25BE";
  font-size: 10px;
}

/* ==========================================================================
   DROPDOWN MENUS
   ========================================================================== */

.dd {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(27, 94, 32, 0.15);
  min-width: 230px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 999;
  border: 1px solid var(--border);
  list-style: none;
  padding: 0;
  margin: 0;
}

.dd li a {
  display: block;
  padding: 10px 16px;
  color: var(--g);
  font-size: 13px;
  transition: all 0.15s;
  border-bottom: 1px solid var(--border);
}

.dd li:last-child a {
  border-bottom: none;
}

.dd li a:hover {
  background: var(--gold3);
  color: var(--gold2);
  padding-left: 20px;
}

/* Desktop hover reveal */
.nav-menu > li:hover > .dd,
.nav-menu > li.has-dropdown[aria-expanded="true"] > .dd {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MOBILE HAMBURGER
   ========================================================================== */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--g);
  position: relative;
  transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--g);
  position: absolute;
  left: 0;
  transition: all 0.3s;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  bottom: -7px;
}

/* Open state */
.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* ==========================================================================
   MOBILE MENU (< 1024px)
   ========================================================================== */

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

  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 90px 2rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 998;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu > li {
    border-bottom: 1px solid var(--border);
  }

  .nav-menu > li > a {
    padding: 10px 0;
    font-size: 15px;
    border-bottom: none;
    width: 100%;
  }

  /* Hide desktop hover reveal on mobile */
  .nav-menu > li:hover > .dd {
    opacity: 0;
    visibility: hidden;
  }

  .nav-cta {
    margin-top: 0.8rem;
    border-bottom: none !important;
  }

  .nav-cta > a {
    display: block !important;
    text-align: center;
    margin-top: 0;
    border-radius: 4px !important;
    padding: 10px 18px !important;
  }

  /* Dropdowns: hidden by default, expand on tap */
  .dd {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 0 0 1rem;
  }

  .dd.open {
    max-height: 500px;
    padding-bottom: 0.5rem;
  }

  .dd li a {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }

  .dd li:last-child a {
    border-bottom: none;
  }

  .dd li a:hover {
    padding-left: 8px;
  }

  /* Chevron rotation on open */
  .has-dropdown[aria-expanded="true"] .chev::after {
    display: inline-block;
    transform: rotate(180deg);
  }
}
