/* =========================================================
   Palette (light mode)
   Change these vars and the whole theme follows.
   ========================================================= */
:root{
  --bg:               #D3DAD9;  /* main content background */
  --text:             #37353E;  /* main text */
  --accent:           #715A5A;  /* links, headings, captions */
  --accent-hover:     #8A6B6B;
  --accent-visited:   #9A7A7A;

  --sb-bg:            #37353E;  /* sidebar bg + mobile top bar */
  --sb-text:          #D3DAD9;  /* sidebar text */
  --sb-hover-bg:      #44444E;

  --code-bg:          #2B2B2B;  /* block code */
  --code-fg:          #F2F2F2;
  --inline-code-bg:   #37353E;  /* inline code */
  --inline-code-fg:   #FAFAFA;

  --note-bg:          #EAEFF2;  /* admonition NOTE */
  --note-border:      #715A5A;
  --note-header:      #8A6B6B;

  /* NEW: token vars */
  --code-func:        #89B4FA;  /* Pygments .nf — function names */
  --code-op:          #f2f2f2;  /* Pygments .o  — operators (=, +, etc.) */
}

/* =========================================================
   Layout & navigation
   ========================================================= */
.wy-nav-content {
  background-color: var(--bg);
  color: var(--text);
}

/* Side bar */
.wy-side-nav-search, .wy-nav-side {
  background-color: var(--sb-bg);
}
.wy-side-nav-search .project,
.wy-menu-vertical a {
  color: var(--sb-text);
}

/* Sidebar hover/current */
.wy-menu-vertical li.current > a,
.wy-menu-vertical a:hover {
  background-color: var(--sb-hover-bg);
  color: var(--sb-text);
}

/* Sidebar section titles (GETTING STARTED, etc.) */
nav.wy-nav-side .wy-menu-vertical p.caption,
nav.wy-nav-side .wy-menu-vertical .caption,
nav.wy-nav-side .wy-menu-vertical .caption > span.caption-text {
  color: var(--accent) !important;
}

/* Mobile top bar */
.wy-nav-top { background-color: var(--sb-bg) !important; }
.wy-nav-top a, .wy-nav-top i, .wy-nav-top .fa, .wy-nav-top .icon {
  color: var(--sb-text) !important;
}

/* =========================================================
   Links & headings (content area only)
   ========================================================= */
.wy-nav-content a { color: var(--accent); }
.wy-nav-content a:hover { color: var(--accent-hover); }
.wy-nav-content a:visited { color: var(--accent-visited); }

.rst-content .section > h1,
.rst-content .section > h2,
.rst-content .section > h3,
.rst-content .section > h4,
.rst-content .section > h5,
.rst-content .section > h6 {
  color: var(--accent);
}
.rst-content h1 a, .rst-content h2 a, .rst-content h3 a {
  color: var(--accent) !important;
}

/* Keep visited color consistent in the left TOC, too */
.wy-menu-vertical a:visited { color: var(--accent-visited); }

/* =========================================================
   Code blocks & inline code
   ========================================================= */
div.highlight, div.highlight pre {
  background-color: var(--code-bg) !important;
  color: var(--code-fg) !important;
}
code {
  background-color: var(--inline-code-bg) !important;
  color: var(--inline-code-fg) !important;
  border-radius: 4px;
  padding: 2px 4px;
}

/* Pygments token colors (tweak as you like) */
.highlight .na { color: #86e1fc !important; }                      /* keys / attributes */
.highlight .nt { color: #a3cb59 !important; font-weight: 700; }    /* tag names */
.highlight .nn { color: #86e1fc !important; font-weight: 700; }    /* namespaces */
.highlight .s, .highlight .s2 { color: #9ee1f5 !important; }       /* strings */
.highlight .m, .highlight .mf { color: #a3cb59 !important; }       /* numbers */
.highlight .kc, .highlight .k  { color: #ffcb6b !important; }      /* keywords */
.highlight .p { color: #e0e0e0 !important; }                       /* punctuation */
.highlight .o { color: var(--code-op) !important; }                /* operators (=, +, -, etc.) */
.highlight .nf { color: var(--code-func) !important; }             /* function names */

/* =========================================================
   Definition-list term badge (API dt blocks)
   ========================================================= */
html .rst-content dl:not(.docutils) > dt,
html .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
  background: #CDB9B9 !important;  /* soft taupe to match accent family */
  color: var(--text) !important;
  border-top: 3px solid var(--accent) !important;
}

/* Field lists (Parameters/Returns) heading chips */
.rst-content dl.field-list > dt,
.rst-content dl.field-list > dt > strong {
  background: #CDB9B9 !important;
  color: var(--text) !important;
  border-top: 3px solid var(--accent) !important;
}

/* =========================================================
   Admonitions (NOTE)
   ========================================================= */
.rst-content .admonition.note {
  background: var(--note-bg) !important;
  border: 1px solid var(--note-border) !important;
}
.rst-content .admonition.note > .admonition-title {
  background: var(--note-header) !important;
  color: #ffffff !important;
  border-bottom: 1px solid var(--note-border) !important;
}
.rst-content .admonition.note > .admonition-title:before {
  color: #ffffff !important;
}

/* Links & code inside admonitions */
.rst-content .admonition a { color: var(--accent); }
.rst-content .admonition code { background: var(--inline-code-bg); color: var(--inline-code-fg); }

/* =========================================================
   Optional dark-mode overrides (only if you use a toggle)
   ========================================================= */
html[data-theme="dark"]{
  --bg:             #1f2430;
  --text:           #E6E6E6;
  --accent:         #C6A6A6;
  --accent-hover:   #D1B7B7;
  --accent-visited: #A78989;

  --sb-bg:          #111318;
  --sb-text:        #D3DAD9;
  --sb-hover-bg:    #1b1e25;

  --code-bg:        #0f1115;
  --code-fg:        #e8e8e8;

  --inline-code-bg: #1b1e25;
  --inline-code-fg: #f2f2f2;

  --note-bg:        #232836;
  --note-border:    #C6A6A6;
  --note-header:    #9F7F7F;

  /* dark-mode token vars */
  --code-func:      #89B4FA;
  --code-op:        #B3B3B3;
}

/* Keep sidebar caption readable in dark mode */
html[data-theme="dark"] nav.wy-nav-side .wy-menu-vertical .caption,
html[data-theme="dark"] nav.wy-nav-side .wy-menu-vertical .caption > span.caption-text {
  color: var(--accent) !important;
}