/* ============================================================
 * WeFinance — header "Services" dropdown
 * Loaded on all pages after styles.min.css (see src/header.php).
 * Pure CSS (hover + focus-within) — no JS required on desktop.
 * ============================================================ */

.nav-dd {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dd > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-dd__caret {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.nav-dd:hover .nav-dd__caret,
.nav-dd:focus-within .nav-dd__caret {
  transform: rotate(180deg);
}

/* Invisible hover bridge so the pointer can travel to the panel */
.nav-dd::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
}

.nav-dd__panel {
  position: absolute;
  top: calc(100% + 16px);
  left: -24px;
  min-width: 320px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 20px 0 20px 0;
  box-shadow: 24px 12px 59px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 40;
}
.nav-dd:hover .nav-dd__panel,
.nav-dd:focus-within .nav-dd__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-dd__panel a {
  display: block;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 500;
  color: #0e0e11;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dd__panel a:hover {
  background: #f4f9f9;
  color: #4e9c9b;
}

/* ============================================================
 * Mobile drawer — collapsible "Services" submenu (CSS-only)
 * ============================================================ */
.nav-m-group { display: flex; flex-direction: column; }

/* The checkbox is the accordion state; visually hidden but focusable */
.nav-m-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-m-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: #0e0e11;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-m-caret {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #7b7b7b;
  transition: transform 0.25s ease;
}
.nav-m-toggle:checked ~ .nav-m-label .nav-m-caret { transform: rotate(180deg); }
.nav-m-toggle:focus-visible ~ .nav-m-label { outline: 2px solid #80c0bf; outline-offset: 3px; }

/* Collapsed by default; expands when the toggle is checked */
.nav-sub-mobile {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  border-left: 2px solid #ececec;
  margin: 0 0 0 4px;
  padding-left: 16px;
  transition: max-height 0.3s ease, visibility 0.3s, margin 0.3s ease;
}
.nav-m-toggle:checked ~ .nav-sub-mobile {
  max-height: 480px;
  visibility: visible;
  margin-bottom: 8px;
}

.nav-sub-mobile a {
  display: flex;
  align-items: center;
  min-height: 44px;          /* comfortable tap target */
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #4a4a52;
  transition: color 0.15s ease;
}
.nav-sub-mobile a:active,
.nav-sub-mobile a:hover { color: #4e9c9b; }
.nav-sub-mobile a.is-current { color: #4e9c9b; font-weight: 600; }
