/* --- Active sidebar item -------------------------------------------------
   Furo's default for the current page is just bold text (the "current"
   background variable resolves to the sidebar background, so it's invisible).
   Make it clearly stand out: a brand-green left accent bar, a faint tinted
   background, and green bold text. Uses --color-brand-* / color-mix so it
   adapts to both light and dark mode automatically. */
.sidebar-tree .current-page > .reference {
  font-weight: bold;
  color: var(--color-brand-content);
  background: color-mix(in srgb, var(--color-brand-content) 12%, transparent);
  border-left: 3px solid var(--color-brand-content);
  /* Keep text aligned despite the 3px border. */
  padding-left: calc(var(--sidebar-item-spacing-horizontal) - 3px);
}

.sidebar-tree .current-page > .reference:hover {
  background: color-mix(in srgb, var(--color-brand-content) 20%, transparent);
}

/* Keep the permalink icon subordinate to and optically centered on headings. */
.headerlink-icon {
  width: 0.72em;
  height: 0.72em;
  vertical-align: -0.06em;
}

/* "Return type" and "Setter type" values use the same code font as the
   signature's type hint. The class is added in conf.py (_mark_type_fields). */
dl.field-list > dd.type-hint {
  font-family: var(--font-stack--monospace);
  font-size: var(--font-size--small--2);
}

/* Comments in code samples stay upright in dark mode: Furo's dark Pygments
   style italicizes them (the light style doesn't). Both the explicit dark
   toggle and the system-preference case are covered, matching the selectors
   pygments.css uses. */
body[data-theme="dark"] .highlight .c,
body[data-theme="dark"] .highlight .ch,
body[data-theme="dark"] .highlight .cm,
body[data-theme="dark"] .highlight .cpf,
body[data-theme="dark"] .highlight .c1 {
  font-style: normal;
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .highlight .c,
  body:not([data-theme="light"]) .highlight .ch,
  body:not([data-theme="light"]) .highlight .cm,
  body:not([data-theme="light"]) .highlight .cpf,
  body:not([data-theme="light"]) .highlight .c1 {
    font-style: normal;
  }
}
