/* Переключатель языка — единый для лендинга и для страницы /subtitles.
 *
 * Обычный CSS без переменных и без Tailwind: этот же файл подключает лэйаут
 * телевизора, где утилиты с var(--tw-bg-opacity) движок отбрасывает целиком
 * (подробнее — в шапке subtitles.css).
 */

.lang-switch {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1;
}

/* Своя стрелка вместо треугольника браузера. */
.lang-switch > summary {
  list-style: none;
}

.lang-switch > summary::-webkit-details-marker {
  display: none;
}

.lang-switch__toggle {
  display: flex;
  align-items: center;
  padding: 0.75em 1.15em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.95);
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lang-switch__toggle:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.lang-switch__toggle:focus {
  outline: none;
  border-color: #a78bfa;
}

.lang-switch__caret {
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.5em;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.15s ease;
}

.lang-switch[open] .lang-switch__caret {
  transform: rotate(180deg);
}

/* Меню раскрывается вверх: кнопка прижата к нижнему краю экрана. */
.lang-switch__menu {
  position: absolute;
  right: 0;
  bottom: 100%;
  min-width: 100%;
  margin-bottom: 0.6em;
  padding: 0.35em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.4em;
  background: rgba(17, 24, 39, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  white-space: nowrap;
  animation: lang-switch-in 0.15s ease-out;
}

.lang-switch__item {
  display: block;
  padding: 0.62em 1.15em;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch__item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-switch__item:focus {
  outline: none;
  color: #ffffff;
  background: rgba(167, 139, 250, 0.25);
}

.lang-switch__item.is-current {
  color: #ffffff;
  background: #7c3aed;
}

@keyframes lang-switch-in {
  from { opacity: 0; transform: translateY(0.5em); }
  to   { opacity: 1; transform: translateY(0); }
}
