/* ==========================================================================
   nav.css
   Styles for the navigation dropdowns and mobile menu panel.
   Pairs with assets/js/nav.js. Pure CSS + vanilla JS, no build step,
   no routing logic of any kind.
   ========================================================================== */

/* ---- Desktop dropdowns ---- */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
  border: none;
  background: none;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 280px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 18px 40px rgba(15, 22, 36, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}

.nav-dropdown.is-open .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.nav-dropdown-item:hover {
  background-color: rgba(26, 170, 163, 0.07);
}

.nav-dropdown-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(26, 170, 163, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.nav-dropdown-item-icon svg {
  width: 14px;
  height: 14px;
  color: #1aaaa3;
}

.nav-dropdown-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-dropdown-item-label {
  font-family: var(--font-heading, inherit);
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

.nav-dropdown-item-desc {
  font-family: var(--font-body, inherit);
  font-size: 11.5px;
  color: #8a8f98;
}

/* ---- Mobile sublist icons (mirrors desktop dropdown icons) ---- */

.mobile-menu-sublist .mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-link-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(26, 170, 163, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-menu-link-icon svg {
  width: 12.5px;
  height: 12.5px;
  color: #1aaaa3;
}

/* ---- Mobile hamburger icon morph (optional subtle affordance) ---- */

.mobile-menu-toggle.is-active {
  background-color: rgba(0, 0, 0, 0.06);
}

/* ---- Mobile menu panel ---- */

.mobile-menu-panel {
  position: fixed;
  top: 56px; /* matches nav h-14 */
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 49;
  overflow-y: auto;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.mobile-menu-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-menu-panel-inner {
  padding: 18px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu-link {
  display: block;
  padding: 13px 4px;
  font-size: 14.5px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu-link-top {
  font-weight: 600;
}

.mobile-menu-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu-group-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: #1a1a1a;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.mobile-menu-chevron {
  transition: transform 0.2s ease;
}

.mobile-menu-group.is-open .mobile-menu-chevron {
  transform: rotate(180deg);
}

.mobile-menu-sublist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-left: 12px;
}

.mobile-menu-group.is-open .mobile-menu-sublist {
  max-height: 600px;
}

.mobile-menu-sublist .mobile-menu-link {
  font-weight: 400;
  font-size: 13.5px;
  color: #4b5160;
  border-bottom: none;
  padding: 10px 4px;
}

.mobile-menu-cta {
  margin-top: 18px;
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-heading, inherit);
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, rgb(26, 170, 163), rgb(48, 168, 115));
  cursor: pointer;
}

/* lock background scroll while mobile menu is open */
body.mobile-menu-locked {
  overflow: hidden;
}

/* mobile menu panel only relevant below the desktop breakpoint */
@media (min-width: 1024px) {
  .mobile-menu-panel {
    display: none;
  }
}
