/* The language menu in the top bar, and the notes a translated page carries.
   Linked by tools/build_i18n.py on every page it stamps. */

.lang-pick { position: relative; flex: none; margin-left: 4px }
.lang-pick > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  color: var(--ink-2, #b7bfd2); font-size: 14px; font-weight: 400; line-height: 1;
  padding: 9px 10px; border-radius: 6px; border: 1px solid transparent; user-select: none;
}
.lang-pick > summary::-webkit-details-marker { display: none }
.lang-pick > summary:hover,
.lang-pick[open] > summary { color: var(--bright, #ff8a28); border-color: var(--line, rgba(255, 138, 40, .28)); background: rgba(255, 138, 40, .06) }
.lang-pick > summary:focus-visible { outline: 2px solid var(--bright, #ff8a28); outline-offset: 2px }
.lang-pick svg { display: block }
.lang-pick ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px;
  list-style: none; min-width: 190px;
  background: var(--panel, #0c1430); border: 1px solid var(--line, rgba(255, 138, 40, .28));
  border-top: 3px solid var(--bright, #ff8a28); box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
}
.lang-pick li a {
  display: block; padding: 8px 12px; border-radius: 4px; text-decoration: none;
  color: var(--ink, #e4e8f2); font-size: 15px;
}
.lang-pick li a:hover { background: rgba(255, 138, 40, .1); color: var(--bright, #ff8a28) }
.lang-pick li a[aria-current] { color: var(--bright, #ff8a28); font-weight: 700 }
.lang-pick li a[aria-current]::after { content: " \2713" }

@media (max-width: 760px) {
  .lang-pick { margin-left: 0 }
  .lang-pick > summary { padding: 6px 6px; font-size: 13px }
}
@media (max-width: 420px) {
  .lang-pick > summary span { display: none }
}

/* a translated page says so, at the foot and (legal pages) at the top */
footer .i18n-note { color: var(--dim, #8590aa); font-size: 13px; margin-top: 6px }
.i18n-legal {
  margin: 0 0 22px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2, #b7bfd2); background: rgba(255, 138, 40, .07);
  border-left: 3px solid var(--bright, #ff8a28);
}

/* the asset library has its own bar; art.js puts the menu there */
.hc-bar select.hc-lang { flex: none; max-width: 170px }

/* Rubik has no Chinese or Korean, so those pages name the system fonts that
   do (no download): Latin stays Rubik, each CJK character falls through. */
body:lang(zh) { font-family: "Rubik", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif }
body:lang(ko) { font-family: "Rubik", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", "Source Han Sans KR", system-ui, sans-serif; word-break: keep-all }
