/*
 * Переключатель языка сайта и подсказка языка (SCRUM-510, 01.10.2026).
 *
 * НАШ ФАЙЛ, А НЕ ЗЕРКАЛО: у эталона переключатель не снят (у тестового сайта языков нет), и кита
 * под него нет. Цвета - только роли полосы, которые уже посчитал PHP с проверкой контраста
 * (`--ls-ink`, `--ls-line` внутри `.ls-bar`; плотная плоскость `--ls-bar-fill-on` под список,
 * потому что полоса над первым экраном бывает прозрачной, а список поверх фото прозрачным быть
 * не имеет права). Только логические свойства: сайт бывает справа налево.
 */

.ls-lang {
  position: relative;
  flex: none;
  color: var(--ls-ink, #1a1a18);
}

.ls-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 44px;
  padding-inline: 10px;
  border-radius: calc(10px * var(--ls-r-k, 1));
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: inherit;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ls-lang__btn::-webkit-details-marker {
  display: none;
}

.ls-lang__btn::marker {
  content: "";
}

.ls-lang__btn:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.ls-lang__btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0;
}

.ls-lang__ic {
  flex: none;
  opacity: 0.85;
}

.ls-lang__sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ls-lang__menu {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  /* Этаж внутри полосы: у неё свой контекст наложения, и выше оснастки холста список не встанет. */
  z-index: 5;
  min-inline-size: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--ls-bar-fill-on, var(--ls-paper, #fff));
  color: var(--ls-bar-ink-on, var(--ls-ink, #1a1a18));
  border: 1px solid var(--ls-bar-line-on, var(--ls-line, #e2ded7));
  border-radius: calc(12px * var(--ls-r-k, 1));
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.14);
}

.ls-lang--nav .ls-lang__menu {
  inset-inline-end: auto;
  inset-inline-start: 0;
}

.ls-lang__opt {
  display: flex;
  align-items: center;
  min-block-size: 40px;
  padding-inline: 12px;
  border-radius: calc(8px * var(--ls-r-k, 1));
  color: inherit;
  text-decoration: none;
  font-size: 0.9375rem;
}

.ls-lang__opt:hover,
.ls-lang__opt:focus-visible {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.ls-lang__opt:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0;
}

.ls-lang__opt[aria-current="true"] {
  font-weight: 600;
}

.ls-lang__opt[aria-current="true"]::after {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  margin-inline-start: auto;
  border-radius: 50%;
  background: currentColor;
}

/* На узкой бумаге место решает полка: языки там строкой, а в полосе остаётся только значок. */
@container ls (width <= 700px) {
  .ls-lang--nav {
    display: none;
  }

  .ls-lang__code {
    display: none;
  }
}

.ls-sheet__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 16px 0 0;
  list-style: none;
  border-block-start: 1px solid var(--ls-line, #e2ded7);
}

.ls-sheet__lang {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 14px;
  border: 1px solid var(--ls-line, #e2ded7);
  border-radius: var(--ls-r-pill, 999px);
  color: inherit;
  text-decoration: none;
}

.ls-sheet__lang[aria-current="true"] {
  border-color: currentColor;
  font-weight: 600;
}

/* --- подсказка языка внизу страницы --------------------------------------------- */

.ls-hint {
  position: fixed;
  inset-block-end: 16px;
  inset-inline: 16px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 12px;
  max-inline-size: 520px;
  margin-inline: auto;
  padding-block: 12px;
  padding-inline: 16px 12px;
  background: var(--ls-paper, #fff);
  color: var(--ls-ink, #1a1a18);
  border: 1px solid var(--ls-line, #e2ded7);
  border-radius: calc(14px * var(--ls-r-k, 1));
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.16);
  font-size: 0.9375rem;
  line-height: 1.4;
  animation: ls-hint-in 240ms ease-out both;
}

.ls-hint__say {
  flex: 1;
  margin: 0;
}

.ls-hint__go {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 16px;
  border-radius: calc(10px * var(--ls-r-k, 1));
  background: var(--ls-ink, #1a1a18);
  color: var(--ls-paper, #fff);
  font-weight: 600;
  text-decoration: none;
}

.ls-hint__x {
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ls-hint__go:focus-visible,
.ls-hint__x:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@keyframes ls-hint-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls-hint {
    animation: none;
  }
}

html.atx-rm .ls-hint {
  animation: none;
}
