/* Header language menu (native <details>): globe + native name at the end of the header's
   first row; phones show the short name and open the list full width under the header.
   Colours come from the planner's variables; article pages (no styles.css) use the fallbacks.
   .sr-only comes from i18n.css (planner) and the inline article style. */
.lang-menu {
  position: relative;
  flex: none;
  margin-inline-start: auto;
}
.lang-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  font-weight: 600;
  color: var(--ink, #1d2a44);
  white-space: nowrap;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e6ddd2);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-menu__btn::-webkit-details-marker {
  display: none;
}
.lang-menu__btn:hover,
.lang-menu[open] .lang-menu__btn {
  border-color: var(--teal, #0b7268);
}
.lang-menu__short {
  display: none;
}
.lang-menu__caret {
  transition: transform 0.2s;
}
.lang-menu[open] .lang-menu__caret {
  transform: rotate(180deg);
}
.lang-menu__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: max-content;
  gap: 2px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e6ddd2);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(18, 49, 79, 0.16);
}
.lang-menu__list a {
  display: block;
  padding: 10px 14px;
  color: var(--ink, #1d2a44);
  white-space: nowrap;
  text-decoration: none;
  border-radius: 8px;
}
.lang-menu__list a:hover {
  background: var(--bg, #faf6f0);
}
.lang-menu__list a[aria-current] {
  font-weight: 700;
  background: var(--teal-faint, #d7f4ee);
}
@media (max-width: 720px) {
  .lang-menu {
    position: static;
  }
  .lang-menu__btn {
    gap: 5px;
    padding: 0 10px;
  }
  .lang-menu__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .lang-menu__short {
    display: inline;
  }
  .lang-menu__list {
    top: 100%;
    inset-inline: 0;
    width: auto;
    border-radius: 0 0 12px 12px;
  }
}
