/* ---------------------------------------------------------------------------
   EN / 中文 switch for the al-folio pages.
   Lives outside assets/css/ on purpose: purgecss only rewrites _site/assets/css/*.css,
   and the .lang-mode-zh class never appears in the static HTML, so it would be purged.
   --------------------------------------------------------------------------- */

/* Only the hidden language is touched, so the visible one keeps its own display value. */
html:not(.lang-mode-zh) .lang-zh {
  display: none !important;
}
html.lang-mode-zh .lang-en {
  display: none !important;
}

.lang-zh {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;
}

/* The button injected into the navbar, before the theme toggle.
   It mirrors the theme's own #search-toggle: a bare button wrapping a
   .nav-link span, so the label inherits the navbar's font and the
   .nav-link padding that keeps it on the same line as "about" / "projects". */
#lang-toggle {
  padding: 0;
  border: 0;
  background-color: inherit;
  color: var(--global-text-color, inherit);
  cursor: pointer;
  font: inherit;
}

#lang-toggle:hover,
#lang-toggle:hover .nav-link {
  color: var(--global-hover-color, var(--global-theme-color, inherit));
}
