/* Shared language switcher: compact pill + dropdown.
   Visual reference: _seo_tasks/screenshots/lang-switcher (Ice Fishing).
   Designed to drop into any theme header without overriding theme typography. */

.lang-switcher {
  position: relative;
  display: inline-flex;
  font-family: inherit;
  line-height: 1;
  z-index: 50;
}

.lang-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 38, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.lang-switcher__toggle:hover,
.lang-switcher__toggle:focus-visible {
  background: rgba(28, 38, 58, 0.96);
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.lang-switcher__toggle[aria-expanded="true"] {
  background: rgba(28, 38, 58, 1);
  border-color: rgba(255, 255, 255, 0.32);
}

.lang-switcher__flag {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  /* Render colour emoji on platforms that need an explicit family hint */
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

.lang-switcher__code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lang-switcher__caret {
  width: 10px;
  height: 6px;
  transition: transform 0.2s ease;
  color: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

.lang-switcher__toggle[aria-expanded="true"] .lang-switcher__caret {
  transform: rotate(180deg);
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(13, 20, 33, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
  z-index: 100;
  /* Subtle entry */
  animation: lang-switcher-fade 0.16s ease-out;
}

.lang-switcher__menu[hidden] {
  display: none;
}

@keyframes lang-switcher-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-switcher__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #e6e9f0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.lang-switcher__option:hover,
.lang-switcher__option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.lang-switcher__option.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.lang-switcher__option .lang-switcher__flag {
  font-size: 16px;
}

.lang-switcher__name {
  font-weight: 500;
}

/* Mobile tuning: keep the pill compact, prevent menu overflow */
@media (max-width: 640px) {
  .lang-switcher__toggle {
    padding: 7px 10px;
    border-radius: 20px;
  }
  .lang-switcher__menu {
    right: 0;
    min-width: 168px;
  }
}
