/*
 * permanent-i18n.css — B3 Persistent Trilingual Language Switch (v5)
 *
 * No-JS safe: show only source language, or Chinese fallback, or all.
 * Before .vtx-i18n-ready (no JS): hide all, show source-lang if marked, else zh.
 * After JS init: hide inactive, show .vtx-active.
 * No rule shows multiple languages simultaneously before JS.
 * v5 fix: zh fallback uses :not(:has([data-vtx-source-lang])) so en/ja source
 *   does not also display the Chinese section.
 */
/* ── Default: all wrappers hidden ── */
.vtx-lang-content {
  display: none;
}

/* ── Before JS: show source-language wrapper if marked ── */
html:not(.vtx-i18n-ready) .vtx-lang-content[data-vtx-source-lang] {
  display: block;
}

/* ── Before JS: fallback — if no source-lang exists, show Chinese ── */
/* v5 fix: only apply zh fallback when NO source-lang marker exists anywhere */
html:not(.vtx-i18n-ready):not(:has(.vtx-lang-content[data-vtx-source-lang])) .vtx-lang-content[lang="zh"] {
  display: block;
}

/* ── After JS init: hide all, show active ── */
html.vtx-i18n-ready .vtx-lang-content {
  display: none;
}
html.vtx-i18n-ready .vtx-lang-content.vtx-active {
  display: block;
}

/* ── Language switch container ── */
#vtx-permanent-langswitch {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#vtx-permanent-langswitch button {
  display: block;
  min-width: 36px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  background: #eceff1;
  color: #37474f;
  cursor: pointer;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  transition: background 0.15s, color 0.15s;
}
#vtx-permanent-langswitch button:hover {
  background: #cfd8dc;
}
#vtx-permanent-langswitch button.vtx-active {
  background: #42a5f5;
  color: #fff;
  border-color: #1e88e5;
}

/* ── Image translated text ── */
.vtx-img-text {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
  font-style: italic;
}

/* ── Accessibility ── */
.vtx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  #vtx-permanent-langswitch button {
    transition: none;
  }
}