/* ============================================
   i18n Single-Page Toggle Styles
   Uses CSS visibility to show/hide language blocks
   ============================================ */

/* Hide all language-specific divs by default */
.markdown-body div[lang] {
  display: none;
}

/* Show Chinese content when html lang is zh-CN */
html[lang="zh-CN"] .markdown-body div[lang="zh-CN"] {
  display: block;
}

/* Show English content when html lang is en */
html[lang="en"] .markdown-body div[lang="en"] {
  display: block;
}

/* ---- Language toggle button (icon, top-left of title) ---- */
.i18n-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--smc-link-color, #0078E7);
  border-radius: 6px;
  background: transparent;
  color: var(--smc-link-color, #0078E7);
  font-size: 16px;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.25s ease;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.i18n-toggle-btn:hover {
  background: var(--smc-link-color, #0078E7);
  color: #fff;
}

.i18n-toggle-btn:active {
  transform: scale(0.92);
}

.i18n-toggle-btn .iconify {
  font-size: 16px;
  transition: transform 0.3s ease;
}

/* Horizontal flip 180° on click */
.i18n-toggle-btn.rotated .iconify {
  transform: scaleX(-1);
}



/* ---- Toggle button: sits inline before the title, top-aligned ---- */
.post-header > .i18n-toggle-btn {
  vertical-align: top;
  margin-right: 8px;
  margin-top: 10px;  /* match .post-title padding-top */
}

.post-header > .i18n-toggle-btn + .post-title {
  display: inline;
}

/* Transition for smooth language switching */
.markdown-body div[lang] {
  animation: i18nFadeIn 0.2s ease;
}

@keyframes i18nFadeIn {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* Hide the inactive title text */
.i18n-title-zh,
.i18n-title-en {
  display: none;
}

html[lang="zh-CN"] .i18n-title-zh {
  display: inline;
}

html[lang="en"] .i18n-title-en {
  display: inline;
}

html[lang="zh-CN"] .i18n-title-en {
  display: none;
}

html[lang="en"] .i18n-title-zh {
  display: none;
}

/* ---- expire_notice i18n (outside .markdown-body) ---- */
.expire_notice [lang] {
  display: none;
}

html[lang="zh-CN"] .expire_notice [lang="zh-CN"] {
  display: block;
}

html[lang="en"] .expire_notice [lang="en"] {
  display: block;
}

/* ---- TOC i18n: hide inactive language TOC wrapper ---- */
.post-toc-content > div[lang] {
  display: none;
}

html[lang="zh-CN"] .post-toc-content > div[lang="zh-CN"] {
  display: block;
}

html[lang="en"] .post-toc-content > div[lang="en"] {
  display: block;
}