.nav-specialties {
  position: relative;
  display: inline-flex;
}

header .nav > a:not(.nav-journal):not(.nav-cta),
.nav-specialties-toggle {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 40px;
  padding: 10px 16px;
  color: var(--charcoal, #2f3435);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(126, 148, 163, 0.16);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 28px rgba(47, 52, 53, 0.07);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

header .nav > a:not(.nav-journal):not(.nav-cta)::before,
.nav-specialties-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 48%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(69, 126, 158, 0.92), transparent);
  opacity: 0;
  transform: translateX(-220%);
  transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
  pointer-events: none;
}

header .nav > a:not(.nav-journal):not(.nav-cta):hover::before,
header .nav > a:not(.nav-journal):not(.nav-cta):focus-visible::before,
.nav-specialties-toggle:hover::before,
.nav-specialties-toggle:focus-visible::before {
  opacity: 1;
  transform: translateX(320%);
}

.nav-specialties-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.nav-specialties-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.nav-specialties-toggle:hover,
.nav-specialties-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 16px 32px rgba(47, 52, 53, 0.12);
}

.nav-specialties-toggle:focus-visible {
  outline: 3px solid rgba(79, 116, 138, 0.25);
  outline-offset: 3px;
}

.nav-specialties[data-open="true"] .nav-specialties-toggle::after {
  transform: translateY(2px) rotate(225deg);
}

.nav-specialties-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 80;
  width: min(330px, calc(100vw - 32px));
  padding: 12px;
  display: none;
  gap: 6px;
  transform: translateX(-50%);
  border: 1px solid rgba(126, 148, 163, 0.2);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 24px 60px rgba(47, 52, 53, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.nav-specialties[data-open="true"] .nav-specialties-menu {
  display: grid;
}

.nav-specialties-menu a {
  width: 100%;
  min-height: 0;
  padding: 11px 13px;
  display: block;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
}

.nav-specialties-menu a:hover,
.nav-specialties-menu a:focus-visible {
  transform: none;
  background: rgba(144, 154, 151, 0.13);
  box-shadow: none;
}

.nav-specialties-menu a:first-child {
  color: var(--blue-dark, #4f748a);
  background: rgba(111, 155, 180, 0.1);
  font-weight: 800;
}

.page-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 260px);
  margin: 34px auto 0;
  padding: 0;
  color: rgba(79, 116, 138, 0.36);
}

.page-signature::before,
.page-signature::after {
  content: "";
  height: 1px;
  flex: 1;
  background: currentColor;
}

.page-signature img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.78;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.related-links a {
  color: var(--blue, #35606f);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  color: rgba(47, 52, 53, 0.68);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue, #35606f);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  header .nav.open .nav-specialties {
    width: 100%;
    display: grid;
  }

  header .nav.open .nav-specialties-toggle {
    width: 100%;
  }

  header .nav.open .nav-specialties-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    transform: none;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: rgba(239, 232, 221, 0.48);
  }

  header .nav.open .nav-specialties-menu a {
    width: 100%;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.72);
  }
}

@media (min-width: 761px) {
  header .brand-logo {
    filter:
      contrast(1.16)
      drop-shadow(0 0 0.38px rgba(20, 25, 26, 0.72))
      drop-shadow(0 7px 16px rgba(47, 52, 53, 0.08));
  }
}

@media (prefers-reduced-motion: reduce) {
  header .nav > a:not(.nav-journal):not(.nav-cta),
  header .nav > a:not(.nav-journal):not(.nav-cta)::before,
  .nav-specialties-toggle,
  .nav-specialties-toggle::before,
  .nav-specialties-toggle::after {
    transition: none;
  }

  header .nav > a:not(.nav-journal):not(.nav-cta):hover::before,
  header .nav > a:not(.nav-journal):not(.nav-cta):focus-visible::before,
  .nav-specialties-toggle:hover::before,
  .nav-specialties-toggle:focus-visible::before {
    opacity: 0;
    transform: translateX(-220%);
  }

  header .nav > a:not(.nav-journal):not(.nav-cta):hover,
  .nav-specialties-toggle:hover {
    transform: none;
  }
}
