/* ════════════════════════════════════════════════════════════
   SITE NAV
════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  display: flex;
  align-items: center;
  line-height: 0;
}
.nav-logo img {
  height: 30px;
  width: auto;
  display: block;
}

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

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

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--body);
  transition: color 0.18s;
}
.nav-links a:hover { color: var(--blue); }

/* ════════════════════════════════════════════════════════════
   DROPDOWN SUBMENU
════════════════════════════════════════════════════════════ */
.nav-links .menu-item-has-children { position: relative; }

/* chevron indicator on parent link */
.nav-links .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.45;
  transition: transform 0.18s;
}
.nav-links .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* invisible bridge fills the gap so hover isn't lost mid-cursor-move */
.nav-links .menu-item-has-children::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
  display: none;
  z-index: 299;
}
.nav-links .menu-item-has-children:hover::before { display: block; }

/* dropdown panel */
.nav-links .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 6px 0;
  min-width: 200px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s 0.15s;
  z-index: 300;
}

.nav-links .menu-item-has-children:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.nav-links .sub-menu li { display: block; }

.nav-links .sub-menu a {
  display: block;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links .sub-menu a:hover {
  color: var(--blue);
  background: var(--blue-tint);
}

/* ════════════════════════════════════════════════════════════
   SUBMENU TOGGLE BUTTON (injected by JS, mobile only)
════════════════════════════════════════════════════════════ */
.submenu-toggle {
  display: none; /* shown only in mobile media query */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 20px;
  min-height: 44px;
  color: var(--body);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.submenu-toggle svg { transition: transform 0.18s; }
.menu-item-has-children.is-open > .submenu-toggle svg { transform: rotate(180deg); }

/* ════════════════════════════════════════════════════════════
   MOBILE TOGGLE BUTTON
════════════════════════════════════════════════════════════ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--near-black);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */

/* Prevent the CSS :hover dropdown from firing on touch devices */
@media (hover: none) {
  .nav-links .menu-item-has-children:hover .sub-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px);
  }
}

@media (max-width: 600px) {
  .nav-toggle { display: flex; }
  .nav-right   { gap: 16px; }

  /* Full-width slide-down menu panel */
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 8px 0 16px;
  }
  .nav-links.is-open { display: flex; }

  .nav-links > li > a {
    display: block;
    padding: 11px 28px;
    font-size: 16px;
  }

  /* No dropdowns on mobile — parent links navigate directly */
  .submenu-toggle { display: none; }
  .nav-links .menu-item-has-children > a::after { display: none; }
  .nav-links .menu-item-has-children::before { display: none !important; }
  .nav-links .sub-menu { display: none !important; }
}
