/* Language support on the public pages: the picker in the website header (index.php) and the loading state.
   Uses the landing page variables (--ink, --mute, --line, --cyan, --b). */

/* Until the dictionary of a non-English language is loaded (assets/shared/i18n.js), the English fallback texts
   stay invisible instead of flashing. If loading fails they appear after 1.5 s anyway. */
.i18n-pending [data-i18n],
.i18n-pending [data-i18n-html] {
  visibility: hidden;
  animation: i18n-reveal 0s 1.5s forwards;
}

@keyframes i18n-reveal {
  to {
    visibility: visible;
  }
}

.lang-pick {
  position: relative;
}

.lang-pick__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--mute);
  font: 600 13px var(--b);
  letter-spacing: .08em;
  transition: color .2s, border-color .2s;
}

.lang-pick__button:hover,
.lang-pick__button[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--cyan);
}

.lang-pick__button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

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

.lang-pick__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  min-width: 190px;
  padding: 6px;
  list-style: none;
  background: rgba(5, 11, 23, .94);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
}

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

.lang-pick__menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--mute);
  font: 400 15px var(--b);
  text-align: left;
  transition: color .2s, background .2s;
}

.lang-pick__menu button:hover {
  color: var(--ink);
  background: rgba(140, 170, 220, .08);
}

.lang-pick__menu button[aria-current="true"] {
  color: var(--ink);
}

.lang-pick__menu button[aria-current="true"]::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}

@media (prefers-reduced-motion: reduce) {

  .lang-pick__button,
  .lang-pick__button svg,
  .lang-pick__menu button {
    transition: none;
  }
}
