/* The language menu in the header of open pages (scripts/site.mjs withLangMenu): a quiet button with a globe and the
   language of the page, and under it a list of links to the same page in other languages. Next to Sign in. */
.lang-menu { position: relative; margin-inline-start: auto; }
.lang-menu > summary {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--h-sm, 2.5rem); padding-inline: var(--sp-3);
  border-radius: 10px; color: var(--c-text); font-size: var(--fs-small); cursor: pointer; list-style: none;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::after {
  content: ""; width: 0.5rem; height: 0.5rem; margin-block-start: -0.25rem;
  border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg);
}
.lang-menu[open] > summary::after { margin-block-start: 0.25rem; transform: rotate(-135deg); }
.lang-menu > summary:hover { background: rgb(255 255 255 / 0.08); }
.lang-menu > summary:focus-visible { outline: 2px solid #f4f2ec; outline-offset: 2px; }
.lang-menu__icon { fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
/* The list looks as the site's own select (.csel__list of home.css, «Разработка»): dark, rounded, a check on the
   current language. Its values are copied here, not shared: select.mjs and .csel are the development's. */
.lang-menu__list {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + var(--sp-1)); z-index: 70;
  box-sizing: border-box; min-width: 10rem; max-width: calc(100vw - 16px); max-height: 19rem;
  margin: 0; padding: 6px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; list-style: none;
  border: 1px solid rgb(255 255 255 / 0.14); border-radius: 12px; background: #191a19; color: #c9c7bf;
  box-shadow: 0 30px 60px -20px #000; font-size: var(--fs-ui); line-height: var(--lh-ui); scrollbar-width: thin;
}
.lang-menu__list a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  min-height: 2.25rem; padding: 6px 10px; border-radius: 8px; color: inherit; text-decoration: none;
}
.lang-menu__list a:hover, .lang-menu__list a:focus-visible { background: rgb(255 255 255 / 0.08); color: var(--c-text); }
.lang-menu__list a:focus-visible { outline: 2px solid #f4f2ec; outline-offset: -2px; }
.lang-menu__list a[aria-current] { color: var(--c-text); font-weight: var(--fw-strong, 600); }
.lang-menu__list a[aria-current]::after {
  content: ""; flex: none; width: 1rem; height: 1rem; background: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat;
}
@media (pointer: coarse) { .lang-menu__list a { min-height: 2.75rem; } }
/* The home page header sits on the dark hero, under the answer card: an open menu goes above it. */
.hm-home__top:has(.lang-menu[open]),
.site-header:has(.lang-menu[open]) { z-index: 30; }
.hm-home__top .lang-menu > summary { color: #fff; }
/* On a phone the button keeps the globe; the name stays for screen readers. */
@media (max-width: 30rem) {
  .lang-menu > summary { padding-inline: var(--sp-2); }
  .lang-menu__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
