/* TOC highlight — reading companion (.toc-side__nav) */
.toc-side__nav a {
  transition: color 0.15s ease, opacity 0.15s ease;
}

.toc-side__nav a.toc-active {
  color: var(--primary) !important;
  opacity: 1 !important;
  font-weight: 500;
}

/* P1-1: Split ZH/EN dark accent so colors match each language's design system */
html:not(:lang(zh)) body.dark .toc-side__nav a.toc-active,
html:not(:lang(zh)) .dark .toc-side__nav a.toc-active {
  color: #7dd3fc !important;
}

html:lang(zh) body.dark .toc-side__nav a.toc-active {
  color: #ff6b6b !important; /* softened ZH dark accent — see tokens.css */
}

/* TOC highlight — left sidebar (.toc-sidebar__nav, US-015) */
.toc-sidebar__nav #TableOfContents a {
  transition: color 0.15s ease;
}

.toc-sidebar__nav #TableOfContents a.toc-sidebar-active {
  color: var(--color-accent, var(--primary)) !important;
  font-weight: 600;
}

/* P1-1: sidebar TOC also split by language */
html:not(:lang(zh)) body.dark .toc-sidebar__nav #TableOfContents a.toc-sidebar-active,
html:not(:lang(zh)) .dark .toc-sidebar__nav #TableOfContents a.toc-sidebar-active {
  color: var(--color-accent, #7dd3fc) !important;
}

html:lang(zh) body.dark .toc-sidebar__nav #TableOfContents a.toc-sidebar-active {
  color: var(--color-accent, #ff6b6b) !important; /* fallback matches softened ZH dark accent */
}

/* Smooth scrolling (JS sets scrollBehavior on <html>, CSS provides fallback) */
html {
  scroll-behavior: smooth;
}
