/* Self-hosted fonts — no Google Fonts dependency */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fraunces-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fraunces-variable-italic.woff2") format("woff2");
}

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

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter-600.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/fraunces-600.woff2") format("woff2");
}

/* Botanical palette — light mode */
html[data-theme="light"] {
    --pst-color-primary: #3a6b4a;        /* forest green */
    --pst-color-primary-bg: #e6efe7;
    --pst-color-secondary: #c9a14a;      /* warm gold */
    --pst-color-accent: #c9a14a;
    --pst-color-success: #3a6b4a;
    --pst-color-info: #3a6b4a;
    --pst-color-warning: #c9974a;

    --pst-color-background: #fbfaf6;     /* warm ivory */
    --pst-color-on-background: #ffffff;  /* card surface */
    --pst-color-surface: #fbfaf6;
    --pst-color-on-surface: #1f2a24;

    --pst-color-text-base: #1f2a24;      /* near-black */
    --pst-color-text-muted: #3a4a40;
    --pst-color-border: #ece6d6;
    --pst-color-border-muted: #f1ece0;
    --pst-color-shadow: rgba(31, 42, 36, 0.06);

    --pst-color-link: #3a6b4a;
    --pst-color-link-hover: #c9a14a;

    --pst-color-inline-code: #1f2a24;
    --pst-color-inline-code-links: #3a6b4a;
    --pst-color-target: #fff7e0;
}

/* Botanical palette — dark mode */
html[data-theme="dark"] {
    --pst-color-primary: #6b9d7a;        /* lifted forest green for contrast */
    --pst-color-primary-bg: #1e2a23;
    --pst-color-secondary: #d8b870;      /* lifted gold */
    --pst-color-accent: #d8b870;
    --pst-color-success: #6b9d7a;
    --pst-color-info: #6b9d7a;

    --pst-color-background: #11181c;     /* deep near-black */
    --pst-color-on-background: #1a232a;
    --pst-color-surface: #1a232a;
    --pst-color-on-surface: #e9e0c8;

    --pst-color-text-base: #e9e0c8;
    --pst-color-text-muted: #b8b0a0;
    --pst-color-border: #2a3a32;
    --pst-color-border-muted: #1f2a24;
    --pst-color-shadow: rgba(0, 0, 0, 0.4);

    --pst-color-link: #d8b870;
    --pst-color-link-hover: #6b9d7a;

    --pst-color-inline-code: #e9e0c8;
    --pst-color-inline-code-links: #d8b870;
    --pst-color-target: #2a3a32;
}

/* Botanical typography */
html {
    --pst-font-family-base: "Inter", system-ui, -apple-system, sans-serif;
    --pst-font-family-heading: "Fraunces", Georgia, serif;
    --pst-font-family-monospace: "JetBrains Mono", ui-monospace, monospace;
}

body {
    font-family: var(--pst-font-family-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .navbar-brand, .pst-navbar-icon {
    font-family: var(--pst-font-family-heading);
    font-weight: 600;
    letter-spacing: -0.005em;
}

h1 {
    font-size: 2.4rem;
    line-height: 1.1;
}

h2 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-top: 2rem;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.3;
}

code, pre, kbd, samp, tt {
    font-family: var(--pst-font-family-monospace);
}

p, li {
    line-height: 1.7;
}

/* Content max-width and rhythm — wide enough that most code blocks (≲ 90 mono cols)
   render without horizontal scroll while prose stays readable. */
.bd-main .bd-content .bd-article-container {
    max-width: 88ch;
}

/* API-reference pages embed wide C++ signatures (heavy template chains
   with multi-base inheritance). Widen the column when `dl.cpp` is present
   so signatures don't wrap aggressively and the page stops feeling
   cramped. The CSS `:has()` selector is supported in all evergreen
   browsers we target. */
.bd-main .bd-content .bd-article-container:has(dl.cpp) {
    max-width: 120ch;
}

/* Tables — auto layout sizes columns to content; tables that declare a
   `<colgroup>` (i.e. list-table with explicit `:widths:`) switch to fixed
   layout so the configured widths become authoritative and content wraps
   within. Inline code only breaks as a last resort to prevent overflow,
   so plain text never breaks letter-by-letter. */
.bd-content table {
    table-layout: auto;
    width: 100%;
}

.bd-content table:has(colgroup) {
    table-layout: fixed;
}

.bd-content table th,
.bd-content table td {
    vertical-align: top;
}

.bd-content table code,
.bd-content table .literal {
    white-space: normal;
    overflow-wrap: break-word;
}

.pst-scrollable-table-container {
    overflow-x: auto;
}

.pst-scrollable-table-container:has(table:has(colgroup)) {
    overflow-x: visible;
}

/* Active sidebar item — gold accent bar */
.bd-sidebar-primary .nav-link.active,
nav.bd-links li > a.current {
    border-left: 2px solid var(--pst-color-secondary);
    padding-left: 0.6rem;
    margin-left: -0.75rem;
    color: var(--pst-color-text-base);
    font-weight: 600;
}

/* Section dividers */
.bd-content hr {
    border: 0;
    border-top: 1px solid var(--pst-color-border);
    margin: 2rem 0;
}

/* Soft warm shadows on cards instead of hard borders */
.sd-card,
div.admonition,
div.note,
div.tip {
    box-shadow: 0 1px 3px var(--pst-color-shadow);
    border: none;
    background: var(--pst-color-on-background);
    border-radius: 6px;
}

/* Note callout — gold left border, Fraunces label */
div.admonition.note,
div.note {
    border-left: 3px solid var(--pst-color-secondary);
    border-radius: 0 4px 4px 0;
    padding: 0.9rem 1.1rem;
}

div.admonition.note p.admonition-title,
div.note p.admonition-title {
    font-family: var(--pst-font-family-heading);
    font-weight: 600;
    color: var(--pst-color-text-base);
    margin-bottom: 0.4rem;
}

/* Inline code — warm tinted background */
.bd-content code.literal {
    background: var(--pst-color-border-muted);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    border: none;
    color: var(--pst-color-text-base);
}

/* Code block surface — Pygments handles fg per mode; we tint the bg so the
   block separates from the page surface. Light mode: warm sand. Dark mode:
   keep monokai's #272822 (already distinct from the near-black page bg). */
.highlight pre {
    border-radius: 6px;
    padding: 0.9rem 1.1rem;
}

html[data-theme="light"] .highlight {
    background: #ece2c8;
    border: 1px solid #d8cdb0;
    border-radius: 6px;
}

/* Homepage hero */
.ginkgo-hero {
    position: relative;
    overflow: hidden;
    padding: 2.4rem 1rem 2.4rem;
    margin: -1rem -1rem 0;
    background: var(--pst-color-background);
    flex: 0 0 auto;
}

.ginkgo-hero-watermark {
    position: absolute;
    right: -2rem;
    top: -2rem;
    width: 14rem;
    height: 14rem;
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
}

.ginkgo-hero-inner {
    position: relative;
    max-width: 60rem;
    margin: 0 auto;
}

.ginkgo-hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pst-color-primary);
    font-weight: 600;
}

.ginkgo-hero-headline {
    font-family: var(--pst-font-family-heading);
    font-weight: 600;
    font-size: 2.8rem;
    line-height: 1.1;
    margin: 0.5rem 0 1rem;
    color: var(--pst-color-text-base);
}

@media (max-width: 720px) {
    .ginkgo-hero-headline {
        font-size: 2.1rem;
    }
}

.ginkgo-hero-headline em {
    color: var(--pst-color-primary);
    font-style: italic;
}

.ginkgo-hero-ctas {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
}

.ginkgo-cta {
    display: inline-block;
    padding: 0.65rem 1.15rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.ginkgo-cta-primary {
    background: var(--pst-color-primary);
    color: #fff;
}

.ginkgo-cta-primary:hover {
    background: #2e5a3c;
    color: #fff;
}

.ginkgo-cta-secondary {
    background: transparent;
    color: var(--pst-color-text-base);
    border: 1px solid var(--pst-color-text-base);
}

.ginkgo-hero-install {
    background: var(--pst-color-border-muted);
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--pst-color-text-muted);
    font-family: var(--pst-font-family-monospace);
}

/* Feature strip */
.ginkgo-feature-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
    padding: 2.4rem 3rem 2.8rem;
    background: var(--pst-color-on-background);
    border: 1px solid var(--pst-color-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--pst-color-shadow);
    max-width: 56rem;
    margin: 1.5rem auto 2rem;
    flex: 0 0 auto;
}

.ginkgo-feature {
    max-width: 22rem;
    margin-inline: auto;
}

@media (max-width: 640px) {
    .ginkgo-feature-strip {
        grid-template-columns: 1fr;
        padding: 1.8rem 1.6rem 2rem;
    }
}

.ginkgo-feature h3 {
    font-family: var(--pst-font-family-heading);
    font-size: 1.05rem;
    margin: 0 0 0.4rem;
    color: var(--pst-color-text-base);
}

.ginkgo-feature p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--pst-color-text-muted);
    margin: 0;
}

.ginkgo-feature-rule {
    width: 2rem;
    height: 2px;
    background: var(--pst-color-secondary);
    margin-bottom: 0.7rem;
}

/* Shared section frame for homepage extras (news, cite) */
.ginkgo-news,
.ginkgo-cite {
    flex: 0 0 auto;
    padding: 2.4rem 1rem;
    margin: 0 -1rem;
    background: var(--pst-color-background);
    border-top: 1px solid var(--pst-color-border);
}

.ginkgo-cite {
    background: var(--pst-color-on-background);
}

.ginkgo-section-inner {
    max-width: 60rem;
    margin: 0 auto;
}

.ginkgo-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.ginkgo-section-header h2 {
    font-family: var(--pst-font-family-heading);
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.2;
    margin: 0;
    color: var(--pst-color-text-base);
}

.ginkgo-section-link {
    font-size: 0.85rem;
    color: var(--pst-color-primary);
    text-decoration: none;
    font-weight: 600;
}

.ginkgo-section-link:hover {
    color: var(--pst-color-secondary);
}

/* News list */
.ginkgo-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.ginkgo-news-item {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.4rem 1.2rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--pst-color-border-muted);
    align-items: baseline;
}

.ginkgo-news-item:first-child {
    border-top: none;
    padding-top: 0;
}

.ginkgo-news-item time {
    font-family: var(--pst-font-family-monospace);
    font-size: 0.78rem;
    color: var(--pst-color-text-muted);
    grid-column: 1;
    grid-row: 1 / 3;
    padding-top: 0.15rem;
}

.ginkgo-news-title {
    font-weight: 600;
    color: var(--pst-color-text-base);
    grid-column: 2;
    grid-row: 1;
}

.ginkgo-news-summary {
    font-size: 0.92rem;
    color: var(--pst-color-text-muted);
    grid-column: 2;
    grid-row: 2;
    line-height: 1.55;
}

@media (max-width: 540px) {
    .ginkgo-news-item {
        grid-template-columns: 1fr;
    }
    .ginkgo-news-item time {
        grid-column: 1;
        grid-row: auto;
    }
    .ginkgo-news-title {
        grid-column: 1;
        grid-row: auto;
    }
    .ginkgo-news-summary {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Citation block */
.ginkgo-cite-intro {
    font-size: 0.95rem;
    color: var(--pst-color-text-muted);
    margin: 0 0 0.8rem;
    line-height: 1.55;
}

.ginkgo-cite-block {
    position: relative;
    background: #1f2a24;
    border-radius: 6px;
    overflow: hidden;
}

.ginkgo-cite-block pre {
    margin: 0;
    padding: 1rem 1.1rem;
    background: transparent;
    color: #e9e0c8;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-x: auto;
}

.ginkgo-cite-block code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.ginkgo-cite-copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    background: var(--pst-color-secondary);
    color: #1f2a24;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-family: var(--pst-font-family-base);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.ginkgo-cite-copy:hover {
    background: #d8b870;
}

.ginkgo-cite-copy.is-copied {
    background: var(--pst-color-primary);
    color: #fff;
}

/* Version switcher */
.ginkgo-version-switcher {
    position: relative;
    display: inline-block;
    margin-right: 0.6rem;
}

.ginkgo-version-button {
    background: var(--pst-color-on-background);
    border: 1px solid var(--pst-color-secondary);
    color: var(--pst-color-primary);
    padding: 0.25rem 0.7rem;
    border-radius: 14px;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: var(--pst-font-family-base);
}

.ginkgo-version-menu {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--pst-color-on-background);
    border: 1px solid var(--pst-color-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--pst-color-shadow);
    min-width: 8rem;
    z-index: 100;
}

.ginkgo-version-switcher:hover .ginkgo-version-menu,
.ginkgo-version-switcher:focus-within .ginkgo-version-menu {
    display: block;
}

.ginkgo-version-item {
    display: block;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    color: var(--pst-color-text-base);
    text-decoration: none;
}

.ginkgo-version-item:hover {
    background: var(--pst-color-primary-bg);
}

.ginkgo-version-item.is-current {
    color: var(--pst-color-primary);
    font-weight: 600;
}

/* Mermaid graphs (example navigation graph):
   sphinxcontrib-mermaid 2.x injects an inline <style> that forces
       pre.mermaid > svg { height: 500px; width: 100%; max-width: 100% !important; }
   which crushes large diagrams into a tiny strip. Override with higher
   specificity (matching exactly + !important) so the SVG renders at its
   natural size and the container scrolls horizontally on overflow. */
.mermaid-container,
pre.mermaid,
.mermaid {
    overflow-x: auto !important;
    max-width: 100%;
    background: #ffffff;
    border-radius: 6px;
    padding: 12px;
}

.mermaid-container > pre.mermaid,
pre.mermaid {
    width: -webkit-max-content !important;
    width: max-content !important;
    min-width: 100% !important;
}

.mermaid-container > pre.mermaid > svg,
pre.mermaid > svg,
.mermaid svg {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

html[data-theme="dark"] .mermaid-container,
html[data-theme="dark"] pre.mermaid,
html[data-theme="dark"] .mermaid {
    background: #0f172a;
}

/* C++ API (Breathe + sphinx.cpp domain).
   Default PyData theme barely styles the C++ domain: classes with many bases
   render as one unbreakable horizontal line, and member functions blend into
   the surrounding prose with no card boundary. The rules below give every
   declaration a code-surface card, allow long signatures to wrap on commas
   and angle brackets, and surface the "Public Types / Functions / Static
   Functions" group headers that Breathe emits via .breathe-sectiondef. */

/* Every C++ definition list (class, struct, function, type, var, enum,
   enumerator). Tighten vertical rhythm and stop browsers from inheriting
   prose paragraph margins inside descriptions. */
dl.cpp {
    margin: 1rem 0;
}

dl.cpp + dl.cpp {
    margin-top: 0.5rem;
}

/* Declaration row — the <dt> that holds the signature. Treat as a code
   surface: warm tint, accent bar on the left, monospace, and (crucially)
   normal whitespace so the long base-class clauses wrap. */
dl.cpp > dt {
    background: var(--pst-color-surface);
    border-left: 3px solid var(--pst-color-accent, #c79a3a);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.875rem;
    line-height: 1.55;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

dl.cpp.cpp-class > dt,
dl.cpp.cpp-struct > dt {
    /* Classes/structs are the heaviest entries — give them a little more
       breathing room and a stronger accent. */
    background: var(--pst-color-surface);
    border-left-width: 4px;
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
}

/* Sphinx wraps every signature token in <span class="pre">…</span> with
   inline white-space:pre. Override at the parent dt level so the inner
   spans break at natural points (commas, angle brackets, ::). */
dl.cpp > dt span.pre {
    white-space: normal;
}

/* Multi-line parameter lists. With `maximum_signature_line_length` set
   in conf.py, Sphinx breaks long signatures so each parameter sits on
   its own line, wrapped in a nested <dl><dd>…</dd></dl> inside the
   signature's <dt>. Default browser <dd> styling indents 40px but loses
   the alignment with the opening parenthesis and doesn't share the
   signature's monospace face. The rules below make the multi-line form
   read like canonical hand-formatted C++:

       ReturnType  function_name(
           ParamType1 name1,
           ParamType2 name2,
           ParamType3 name3 = default
       )

   Sphinx places the opening `(` at the end of the line that holds the
   function name, and the closing `)` on its own line after the nested
   <dl>, so we don't need to move the parens — only style the params. */
dl.cpp > dt > dl {
    margin: 0;
    padding: 0;
    display: block;
}

dl.cpp > dt > dl > dd {
    margin: 0 0 0 2em;
    padding: 0;
    border: none;
    background: none;
    text-indent: 0;
    white-space: normal;
}

dl.cpp > dt > dl > dd > .sig-param {
    display: inline;
}

/* The closing `)` after the nested <dl> sits on its own logical line —
   give it a touch of left padding so it visually aligns with the
   function name rather than indented under the params. */
dl.cpp > dt > dl + .sig-paren {
    display: inline-block;
    margin-left: 0;
}

/* Syntax colouring for C++ signatures. Sphinx tags every token with a
   Pygments class (k = keyword, kt = keyword type, n = name, nf = function
   name, nc = class name, p = punctuation, o = operator, mi = number,
   s = string, cp = preprocessor). Pygments' own stylesheet only scopes
   these inside `.highlight` blocks, so we re-apply the palette here using
   the botanical theme tokens. */
dl.cpp > dt .k,
dl.cpp > dt .kt,
dl.cpp > dt .kr {
    color: var(--pst-color-primary);
    font-weight: 600;
}

dl.cpp > dt .nf,
dl.cpp > dt .sig-name {
    color: var(--pst-color-secondary);
    font-weight: 600;
}

dl.cpp > dt .nc,
dl.cpp > dt .nn {
    color: var(--pst-color-primary);
}

dl.cpp > dt .p,
dl.cpp > dt .o {
    color: var(--pst-color-text-muted);
}

dl.cpp > dt .mi,
dl.cpp > dt .mf,
dl.cpp > dt .s,
dl.cpp > dt .s1,
dl.cpp > dt .s2 {
    color: var(--pst-color-warning, #c9974a);
}

dl.cpp > dt .cp,
dl.cpp > dt .cpf {
    color: var(--pst-color-text-muted);
    font-style: italic;
}

dl.cpp > dt .c1,
dl.cpp > dt .c {
    color: var(--pst-color-text-muted);
    font-style: italic;
}

/* Dark-mode token contrast — primary/secondary are already lifted in the
   dark palette so the rules above carry over, but punctuation needs a
   little more presence against the darker surface. */
html[data-theme="dark"] dl.cpp > dt .p,
html[data-theme="dark"] dl.cpp > dt .o {
    color: var(--pst-color-text-base);
    opacity: 0.65;
}

/* Description body. Indent so the member visually nests under its
   signature, and trim trailing margin so member-to-member spacing is
   driven by the parent <dl> rather than paragraph margins. */
dl.cpp > dd {
    margin: 0.25rem 0 0.75rem 1rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--pst-color-border, #e5e7eb);
}

dl.cpp > dd > p:last-child {
    margin-bottom: 0;
}

/* Empty <dd></dd> (undocumented member). Hide the empty body and pull the
   next entry tight, so a sequence of typedef-only entries doesn't sprawl. */
dl.cpp > dd:empty {
    display: none;
}

/* "Inherits from" block — injected by the _split_class_bases handler
   in conf.py. The long base-class chain that the C++ domain would
   otherwise render inline in the class signature ends up here, one
   base per line, prefixed by a tiny uppercase label. */
p.cpp-inherits-label-line,
p.cpp-subclassed-label-line {
    margin: 0.5rem 0 0.25rem;
    padding: 0;
}

p.cpp-subclassed-label-line {
    margin-top: 1.25rem;
}

p.cpp-inherits-label-line .cpp-inherits-label,
p.cpp-subclassed-label-line .cpp-subclassed-label {
    font-family: var(--pst-font-family-base);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pst-color-text-muted);
}

ul.cpp-inherits-list,
ul.cpp-subclassed-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

ul.cpp-inherits-list > li,
ul.cpp-subclassed-list > li {
    margin: 0;
    padding: 0.1rem 0 0.1rem 0.75rem;
    border-left: 2px solid var(--pst-color-border);
}

ul.cpp-inherits-list > li > p.cpp-inherits-item,
ul.cpp-subclassed-list > li > p.cpp-subclassed-item {
    margin: 0;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--pst-color-text-base);
}

ul.cpp-inherits-list .k,
ul.cpp-inherits-list .kr {
    /* `public` / `protected` access specifier — quiet so the base-class
       name leads visually. */
    color: var(--pst-color-text-muted);
    font-weight: 400;
    font-style: italic;
    opacity: 0.75;
    margin-right: 0.25rem;
}

ul.cpp-inherits-list .p,
ul.cpp-inherits-list .o {
    color: var(--pst-color-text-muted);
}

/* `@par References` blocks (and any other `@par` section like `Note`,
   `Algorithm`, `Remarks`) inside C++ descriptions. Sphinx renders these
   as `<dl class="simple">` with a `<dt><strong>Label</strong></dt>`.
   We piggy-back on the same `:has()` pattern as the `cpp-inherits` rules
   to skip the `field-list simple` variants Sphinx uses for Template
   Parameters / Parameters / Returns. */
dl.cpp dl.simple:not(.field-list) {
    margin: 1rem 0 0.5rem;
    padding: 0;
}

dl.cpp dl.simple:not(.field-list) > dt {
    font-family: var(--pst-font-family-base);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pst-color-text-muted);
    border: none;
    background: none;
    padding: 0;
    margin: 0 0 0.25rem 0;
}

dl.cpp dl.simple:not(.field-list) > dt > strong {
    font-weight: inherit;
}

dl.cpp dl.simple:not(.field-list) > dd {
    margin: 0;
    padding: 0;
    border: none;
}

dl.cpp dl.simple:not(.field-list) > dd > p {
    margin: 0;
}

dl.cpp dl.simple:not(.field-list) ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

dl.cpp dl.simple:not(.field-list) li {
    padding: 0.2rem 0 0.2rem 0.75rem;
    margin: 0 0 0.35rem 0;
    border-left: 2px solid var(--pst-color-border);
    font-size: 0.92rem;
    line-height: 1.55;
}

dl.cpp dl.simple:not(.field-list) li:last-child {
    margin-bottom: 0;
}

/* The DOI / URL link inside a reference entry — render as a compact
   monospace tag rather than a full underlined URL, so the citation
   reads as "Authors, *Title.* Venue, Year. [doi-tag]" instead of
   trailing into a 60-character URL. */
dl.cpp dl.simple:not(.field-list) a.reference.external {
    display: inline-block;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.8rem;
    padding: 0.02rem 0.4rem;
    margin-left: 0.15rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 3px;
    background: var(--pst-color-primary-bg);
    color: var(--pst-color-link);
    text-decoration: none;
    vertical-align: baseline;
    word-break: break-all;
}

dl.cpp dl.simple:not(.field-list) a.reference.external:hover {
    background: var(--pst-color-link);
    color: var(--pst-color-background);
    border-color: var(--pst-color-link);
}

/* Breathe section groups: "Public Types", "Public Functions", … */
.breathe-sectiondef {
    margin: 1.5rem 0;
    padding: 0;
    border: none;
}

.breathe-sectiondef-title {
    font-family: var(--pst-font-family-base);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pst-color-text-muted, #6b7280);
    margin: 1.25rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--pst-color-border, #e5e7eb);
}

/* Field lists inside descriptions — "Template Parameters", "Parameters",
   "Returns". Make the label column compact and visually distinct from the
   surrounding prose. */
dl.cpp dl.field-list > dt {
    background: transparent;
    border: none;
    padding: 0;
    font-family: var(--pst-font-family-base);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pst-color-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

dl.cpp dl.field-list > dd {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

dl.cpp dl.field-list ul.simple {
    margin: 0.25rem 0;
}

/* Headerlink (#) inside C++ definitions — softer, less screaming than
   the default. */
dl.cpp > dt .headerlink {
    color: var(--pst-color-text-muted, #6b7280);
    font-weight: 400;
    margin-left: 0.4rem;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

dl.cpp > dt:hover .headerlink {
    opacity: 1;
}

/* Dark mode — soften the card so it doesn't look like a tab. */
html[data-theme="dark"] dl.cpp > dt {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--pst-color-accent, #d6b25a);
}

html[data-theme="dark"] dl.cpp > dd {
    border-left-color: rgba(255, 255, 255, 0.12);
}
