.language-switcher {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.language-switcher summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  list-style: none;
  transition: border-color 180ms ease, color 180ms ease;
}

.language-switcher summary::-webkit-details-marker {
  display: none;
}

.language-switcher summary:hover,
.language-switcher summary:focus-visible,
.language-switcher[open] summary {
  border-color: var(--forest);
  color: var(--forest-dark);
}

.language-switcher-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.language-switcher[open] .language-switcher-chevron {
  transform: translateY(2px) rotate(225deg);
}

.language-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  width: max-content;
  min-width: 170px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.language-switcher-menu a {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.language-switcher-menu a:hover,
.language-switcher-menu a:focus-visible {
  color: var(--forest-dark);
  background: var(--wash);
}

.language-switcher-menu a[aria-current="page"] {
  color: var(--forest-dark);
  background: var(--wash);
  font-weight: 850;
}

.language-switcher-menu a[aria-current="page"]::after {
  content: "✓";
  color: var(--forest);
}

@media (max-width: 760px) {
  .language-switcher {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-switcher summary,
  .language-switcher-chevron {
    transition: none;
  }
}
