/* Sysand documentation theme.
 *
 * The docs keep the pydata-sphinx-theme layout (sidebar TOC, on-page nav,
 * search) but adopt the Sysand Index web app's visual identity so the two
 * sites feel like one product. We only re-point pydata's own CSS variables;
 * we do not restyle the app chrome.
 *
 * Design tokens mirror requirements-specification/design.md in the app repo.
 * The font files are the same self-hosted woff2 the app ships
 * (sysandindex/static/vendor/fonts/, fetched by scripts/fetch-vendor-assets.sh);
 * keep them in sync if the app's fonts change.
 */

/* === Self-hosted fonts (copied from the app's vendor bundle) === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter/inter-latin-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono/jetbrains-mono-latin-variable.woff2') format('woff2');
}

/* === Shared tokens === */
:root {
  --si-accent: #c2410c;
  --si-accent-hover: #9a3412;
  --si-accent-subtle: rgba(237, 137, 54, 0.12);

  --pst-font-family-base: 'Inter', var(--pst-font-family-base-system);
  --pst-font-family-heading: 'JetBrains Mono', var(--pst-font-family-base-system);
  --pst-font-family-monospace: 'JetBrains Mono', var(--pst-font-family-monospace-system);
}

/* === Light theme (pydata default mode) === */
html[data-theme="light"] {
  --pst-color-primary: var(--si-accent);
  --pst-color-primary-bg: var(--si-accent-subtle);
  --pst-color-link: var(--si-accent);
  --pst-color-link-hover: var(--si-accent-hover);
  --pst-color-inline-code: var(--si-accent);
  --pst-color-inline-code-links: var(--si-accent);

  --pst-color-background: #ffffff;
  --pst-color-on-background: #f6f8fa;
  --pst-color-surface: #f6f8fa;
  --pst-color-border: #d1d9e0;
  --pst-color-text-base: #1f2328;
  --pst-color-text-muted: #57606a;
}

/* === Dark theme === */
html[data-theme="dark"] {
  --si-accent: #ed8936;
  --si-accent-hover: #dd6b20;
  --si-accent-subtle: rgba(237, 137, 54, 0.15);

  --pst-color-primary: var(--si-accent);
  --pst-color-primary-bg: var(--si-accent-subtle);
  --pst-color-link: var(--si-accent);
  --pst-color-link-hover: var(--si-accent-hover);
  --pst-color-inline-code: var(--si-accent);
  --pst-color-inline-code-links: var(--si-accent);

  --pst-color-background: #0d1117;
  --pst-color-on-background: #161b22;
  --pst-color-surface: #161b22;
  --pst-color-border: #30363d;
  --pst-color-text-base: #e6edf3;
  --pst-color-text-muted: #8b949e;
}

/* === Brand wordmark in the navbar uses the heading (mono) font === */
.navbar-brand .title,
.sidebar-primary-item .navbar-brand .title {
  font-family: var(--pst-font-family-heading);
}

/* Keep the compact logo mark proportionate next to the wordmark. */
.navbar-brand img.logo__image {
  height: 1.75rem;
  width: auto;
}

/* Header brand and nav links are navigation chrome, not body links: keep
   hover/focus states to one accent indicator instead of pydata's link purple. */
.bd-header ul.navbar-nav.nav-underline > li.nav-item > .nav-link {
  border-bottom-color: transparent;
  box-shadow: none;
  text-decoration: none;
}

.bd-header ul.navbar-nav.nav-underline > li.nav-item > .nav-link::before {
  border-bottom-color: transparent;
}

.navbar-brand:is(:hover, :focus),
.bd-header ul.navbar-nav > li.nav-item > .nav-link:is(:hover, :focus, .active) {
  border-bottom-color: transparent;
  box-shadow: none;
  color: var(--pst-color-primary);
  text-decoration: none;
}

.bd-header ul.navbar-nav.nav-underline > li.nav-item > .nav-link:is(:hover, :focus, .active)::before {
  border-bottom-color: var(--pst-color-primary);
}

.bd-header .pst-navbar-icon {
  color: var(--pst-color-text-base);
}

.bd-header .pst-navbar-icon:is(:hover, :focus) {
  color: var(--pst-color-primary);
}

.bd-header .pst-navbar-icon::before,
.bd-header .pst-navbar-icon:is(:hover, :focus)::before {
  border-bottom-color: transparent;
}

/* Heading permalinks should use the Sysand accent, not pydata's purple
   secondary link color. */
a.headerlink,
a.headerlink:hover,
a.headerlink:focus {
  color: var(--pst-color-primary);
  text-decoration: none;
}

/* === Inline code: subtle accent background like the app === */
code.literal,
.rst-content code:not(.xref) {
  background-color: var(--si-accent-subtle);
}

/* Console prompts ($, PS>) are visual cues, not part of the command: keep
   them out of text selection, matching the copybutton_exclude in conf.py. */
.highlight span.gp {
  user-select: none;
}
