/* ---------- language menu ----------
 * Five languages do not fit beside the nav on a phone, and pills only ever showed two-letter codes.
 * This is a <details> element, so it opens and closes with no JavaScript at all; the small script in
 * the base template only adds outside-click and Escape. Each entry is written in its own script,
 * because someone looking for Japanese is looking for 日本語, not for "Japanese".
 */

.langmenu {
  position: relative;
  margin-left: 8px;
  flex: none;
}
.langmenu > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.langmenu > summary::-webkit-details-marker { display: none; }
.langmenu > summary::marker { content: ""; }
.langmenu > summary:hover,
.langmenu[open] > summary {
  color: var(--text);
  border-color: #3A3F47;
  background: rgba(255, 255, 255, 0.06);
}
.langmenu > summary:focus-visible {
  outline: 2px solid rgba(255, 122, 61, 0.8);
  outline-offset: 2px;
}
.langmenu__globe { opacity: 0.75; flex: none; }
.langmenu__caret { transition: transform 0.18s ease; flex: none; }
.langmenu[open] .langmenu__caret { transform: rotate(180deg); }

.langmenu__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid #2B3037;
  border-radius: 14px;
  background: #15171B;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
}
.langmenu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.langmenu__list a:hover,
.langmenu__list a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}
.langmenu__list a.is-on {
  color: #FFD9C7;
  background: rgba(255, 122, 61, 0.14);
  font-weight: 700;
}
.langmenu__tick { color: var(--accent-2); flex: none; }

.nav { margin-left: auto; }
@media (max-width: 620px) {
  .header-inner { gap: 10px; flex-wrap: wrap; padding-block: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .langmenu { margin-left: auto; }
  .langmenu__list { right: 0; min-width: 168px; }
}
