/* Light mode tweaks (unchanged primary) */
html[data-theme="light"] {
  --pst-color-primary: #e60000;
  --pst-color-secondary: #212121;
  --pst-color-accent: #7a0b1f;

  --pst-color-background: #f5f5f5;
  --pst-color-on-background: #ffffff;
  --pst-color-surface: #ffffff;
  --pst-color-on-surface: #2b2b2b;
  --pst-color-border: #d9d9d9;
  --pst-color-shadow: rgba(33, 33, 33, 0.12);

  --pst-color-text-base: #202020;
  --pst-color-text-muted: #5d5d5d;
  --pst-color-link: var(--pst-color-primary);
  --pst-color-link-hover: #ad0000;

  --pst-color-success: #3cba63;
  --pst-color-info: #7aa8ff;
  --pst-color-warning: #f4b76a;
  --pst-color-danger: #ff5050;

  --pst-color-table-row-odd: #ebebeb;
  --pst-color-table-row-even: #ffffff;
}

/* Dark mode adjusted for identical primary + readability */
html[data-theme="dark"] {
  --pst-color-primary: #e11021;          /* same red */
  --pst-color-secondary: #f5f5f5;
  --pst-color-accent: #ff4c4c;           /* brighter hover/red accents */

  --pst-color-background: #0d0d0d;       /* deep charcoal, not pure black */
  --pst-color-on-background: #191a1f;    /* navbars / elevated backgrounds */
  --pst-color-surface: #242429;          /* cards & panels */
  --pst-color-on-surface: #f3f3f5;       /* text on surfaces */
  --pst-color-border: #36363d;
  --pst-color-shadow: rgba(0, 0, 0, 0.42);

  --pst-color-text-base: #f5f5f7;        /* body text */
  --pst-color-text-muted: #b9b9c2;
  --pst-color-link: var(--pst-color-primary);
  --pst-color-link-hover: #f5f5f5;
  --pst-color-success: #5dd98b;
}

/* Bright mode inline code color */
html[data-theme="light"] {
  --pst-color-inline-code: #e60000;   /* replace with your preferred tone */
}

/* Dark mode inline code color (optional but recommended) */
html[data-theme="dark"] {
  --pst-color-inline-code: #f5f5f5;
}

/* Article content (light + dark): no underline, rely on color/weight */
.bd-article-container a,
.bd-article-container a:visited {
  text-decoration: none;
  color: #e11021;
  font-weight: 400;                   /* optional: subtle weight change */
}

.bd-article-container a:hover,
.bd-article-container a:focus-visible {
  color: var(--pst-color-primary);    /* give a clear hover state */
  text-decoration: none;
  outline: none;
  box-shadow: inset 0 -0.2em rgba(230, 0, 0, 0.25); /* soft highlight */
}

 /* Centered image captions */
 figcaption {
text-align: center;
}

/* Rounded card edges */
.sd-card {
  border-radius: 0.5rem;
  overflow: hidden;
}

/* One vertical line for every API domain entry body (C, Python, C++, C#, …) */
dl:has(> dt.sig) > dd {
  border-left: 3px solid var(--pst-color-border);
  padding-left: 1.25rem;
  margin-left: 0.25rem;
  margin-top: 0.5rem;
}

/* Remove it for entries nested inside another — already contained by the parent's border */
dl:has(> dt.sig) > dd dl:has(> dt.sig) > dd {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  margin-top: 0;
}

/* Suppress horizontal borders on nested entries.
   !important overrides the theme's .sig border-top applied with higher specificity. */
dl:has(> dt.sig) > dd dl:has(> dt.sig) > dt,
dl:has(> dt.sig) > dd dl:has(> dt.sig) > dd {
  border-top: none !important;
  border-bottom: none !important;
}

/* Subtle background on nested entry signature lines */
dl:has(> dt.sig) > dd > dl:has(> dt.sig) > dt {
  background: var(--pst-color-surface);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.15rem;
}

/* Same treatment for parameter/return field-list labels inside functions/methods */
dl:has(> dt.sig) > dd > dl.field-list > dt {
  background: var(--pst-color-surface);
  border-top: none !important;
  border-bottom: none !important;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.15rem;
}

/* Alternating table rows — light mode only */
html[data-theme="light"] table tbody tr:nth-child(odd) td,
html[data-theme="light"] table tbody tr:nth-child(odd) th {
  background-color: var(--pst-color-table-row-odd);
}

html[data-theme="light"] table tbody tr:nth-child(even) td,
html[data-theme="light"] table tbody tr:nth-child(even) th {
  background-color: var(--pst-color-table-row-even);
}
