.nav-pill {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding-inline: var(--pad-x);
}

.nav-container {
  max-width: var(--max-width);
  margin-inline: auto;
  background: var(--surface-card);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 12px 12px 24px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-strong);
  font-weight: 700;
  font-size: 18px;
}

.nav-logo-mark {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links > a,
.nav-dropdown-toggle {
  color: var(--text-body);
  text-decoration: none;
  transition: color .2s var(--ease-out);
}

.nav-links > a:hover,
.nav-dropdown-toggle:hover { color: var(--primary); }
.nav-links > a[aria-current="page"],
.nav-dropdown-toggle[aria-current="page"] { color: var(--primary); font-weight: 600; }

/* ---- Specialties dropdown (disclosure pattern) ---- */
.nav-dropdown { position: relative; display: inline-flex; }

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  min-height: 44px;
}
.nav-caret {
  width: 16px;
  height: 16px;
  transition: transform .2s var(--ease-out);
}
.nav-dropdown.is-open > .nav-dropdown-toggle .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: 250px;
  margin: 10px 0 0;
  padding: 8px;
  list-style: none;
  background: var(--surface-card);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}
/* Open state is owned by JS (.is-open). :focus-within is a no-JS keyboard
   fallback. Hover-open is handled in JS (with hover-intent delay), NOT pure
   CSS :hover — see nav.js. */
.nav-dropdown.is-open > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu { display: flex; }

/* Transparent "hover bridge": fills the 10px gap between trigger and menu so
   the cursor never leaves the wrapper while travelling down to the items.
   Only present where hover-open applies; it lives inside the (descendant of
   the) wrapper, so mouseleave won't fire while crossing it. */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    bottom: 100%;
    inset-inline: 0;
    height: 10px; /* matches .nav-dropdown-menu margin-top */
  }
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.nav-dropdown-menu a:hover { background: var(--surface-tint); color: var(--primary); }
.nav-dropdown-menu a[aria-current="page"] { background: var(--surface-tint); color: var(--primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  padding: 8px 12px;
}
.nav-lang .sep { color: var(--border-soft); margin-inline: 4px; }
.nav-lang .muted { color: var(--text-muted); }

.nav-cta {
  padding: 12px 22px;
  font-size: 14px;
}

.nav-burger {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 2px;
  transition: transform .2s var(--ease-out), opacity .2s var(--ease-out);
}
.nav-container.is-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-container.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav-container.is-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: var(--pad-x);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    background: var(--surface-card);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
  }
  .nav-container.is-open .nav-links { display: flex; }

  .nav-links > a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
  }

  /* Specialties becomes an in-flow expandable subgroup on mobile */
  .nav-dropdown { display: flex; flex-direction: column; align-items: stretch; }
  .nav-dropdown-toggle { justify-content: space-between; padding-inline: 8px; }
  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin: 4px 0 4px 8px;
    box-shadow: none;
    background: var(--surface-tint);
    border-radius: 14px;
  }
  /* On coarse pointers, only the JS toggle (.is-open / focus) opens it */
  .nav-dropdown:focus-within > .nav-dropdown-menu { display: none; }
  .nav-dropdown.is-open > .nav-dropdown-menu { display: flex; }
}

@media (max-width: 560px) {
  .nav-cta { display: none; }
}
