/* v8 language-specific navigation fix
   Ensures Chinese pages only show Chinese navigation and English pages only show English navigation,
   even when earlier layout rules force nav/dropdown links to display:block!important. */
html[lang="zh-CN"] body .lang-en,
html[lang="zh"] body .lang-en,
html:not([lang="en"]) body .lang-en {
  display: none !important;
}
html[lang="en"] body .lang-zh {
  display: none !important;
}

/* Keep the currently selected language visible in the top navigation/dropdowns. */
html[lang="zh-CN"] body .site_head .shortcut-links .lang-zh,
html[lang="zh"] body .site_head .shortcut-links .lang-zh,
html:not([lang="en"]) body .site_head .shortcut-links .lang-zh,
html[lang="en"] body .site_head .shortcut-links .lang-en {
  display: inline-flex !important;
  align-items: center !important;
}
html[lang="zh-CN"] body .site_head .dropdown-content .lang-zh,
html[lang="zh"] body .site_head .dropdown-content .lang-zh,
html:not([lang="en"]) body .site_head .dropdown-content .lang-zh,
html[lang="en"] body .site_head .dropdown-content .lang-en {
  display: block !important;
}

/* Mobile menu / duplicated nav: same language isolation. */
html[lang="zh-CN"] body .pages .page .lang-zh,
html[lang="zh"] body .pages .page .lang-zh,
html:not([lang="en"]) body .pages .page .lang-zh,
html[lang="en"] body .pages .page .lang-en {
  display: block !important;
}
html[lang="zh-CN"] body .pages .page .dropdown-content .lang-zh,
html[lang="zh"] body .pages .page .dropdown-content .lang-zh,
html:not([lang="en"]) body .pages .page .dropdown-content .lang-zh,
html[lang="en"] body .pages .page .dropdown-content .lang-en {
  display: block !important;
}

/* Protect publications page navigation from list/card rules used in the publications body. */
body.publications-page .site_head .shortcut-links ul,
body.publications-page .site_head .shortcut-links li,
body.publications-page .site_head .shortcut-links a {
  writing-mode: horizontal-tb !important;
  word-break: keep-all !important;
  white-space: nowrap !important;
}
