/* Language switcher + the one-time language hint. Loaded on every page that has another
   language. Native <details>: no script focuses anything on open, so nothing gets a ring
   (focus-guard rule); the script only closes it on an outside tap or Escape. */
.lang-pick { position: relative; font-family: var(--sans); }
.lang-pick > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 40px; padding: 0 0.85rem; border-radius: var(--r-pill);
  font-size: 0.875rem; font-weight: 500; line-height: 1; white-space: nowrap;
  color: inherit; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 28%, transparent);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.lang-pick > summary::-webkit-details-marker { display: none; }
.lang-pick > summary svg { flex: none; opacity: 0.85; }
@media (hover: hover) { .lang-pick > summary:hover { border-color: color-mix(in srgb, currentColor 60%, transparent); } }
.lang-pick[open] > summary { border-color: color-mix(in srgb, currentColor 60%, transparent); }
.lang-pick__list {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; margin: 0; padding: 6px; list-style: none;
  min-width: 11rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-card);
  box-shadow: 0 18px 40px -18px rgba(18, 21, 26, 0.35);
  transform-origin: top right; animation: langIn 0.28s var(--ease) both;
}
@keyframes langIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.lang-pick__list a {
  display: flex; align-items: center; min-height: 42px; padding: 0 0.85rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  transition: background-color 0.2s var(--ease);
}
@media (hover: hover) { .lang-pick__list a:hover { background: var(--tint); } }
.lang-pick__list a[aria-current] { color: var(--accent); }
.lang-pick__list a[aria-current]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* placement */
.lang-pick--hero { margin-left: auto; color: #fff; }
.hero__nav .lang-pick--hero > summary { border-color: rgba(255, 255, 255, 0.38); }
.lang-pick--nav { color: var(--ink); }
.nav__inner > .lang-pick--nav { margin-left: auto; margin-right: 0.25rem; }
.lang-pick--menu { color: var(--band-text); margin-bottom: 1rem; }
.lang-pick--menu .lang-pick__list { right: auto; left: 0; top: auto; bottom: calc(100% + 8px); transform-origin: bottom left; }
@media (max-width: 767px) {
  /* the burger owns the top right on the home page; the menu carries the switcher there */
  .lang-pick--hero, .nav--page:not(.nav--tour) .lang-pick--nav { display: none; }
  .nav--tour .lang-pick--nav > summary { padding: 0 0.7rem; }
}
@media (max-width: 380px) { .nav--tour .lang-pick__cur { display: none; } }

.footer__langs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; }
.footer__langs a, .footer__langs span { color: var(--band-body); text-decoration: none; }
.footer__langs span[aria-current] { color: var(--band-text); }
@media (hover: hover) { .footer__langs a:hover { color: var(--band-text); } }
@media (max-width: 767px) { .footer__langs { justify-content: center; } }

/* the hint: once, for a browser set to zh/ja/ko, on the English page; never takes focus */
.lang-hint {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 70; max-width: min(23rem, calc(100vw - 6.5rem));
  padding: 1rem 1.1rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-card);
  box-shadow: 0 24px 50px -24px rgba(18, 21, 26, 0.45);
  opacity: 0; transform: translateY(10px); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.lang-hint.is-in { opacity: 1; transform: none; }
.lang-hint p { margin: 0 0 0.75rem; font-size: 0.9375rem; line-height: 1.6; }
.lang-hint__row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.lang-hint__go {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.1rem; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 500; font-size: 0.9375rem;
}
.lang-hint__no { background: none; border: 0; padding: 0.5rem 0.25rem; color: var(--muted); font: inherit; font-size: 0.875rem; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .lang-pick__list { animation: none; }
  .lang-hint { transition: opacity 0.2s linear; transform: none; }
}

/* honesty lines on translated pages */
.tnote { margin-top: 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.tnote a { color: inherit; }
