/*
 * H5CPP Doxygen theme override — orange + solarized palette
 * Applied on top of doxygen-awesome.css
 * Light mode: solarized-light;  Dark mode: slate-inspired
 */

/* ------------------------------------------------------------------ */
/* Light mode                                                          */
/* ------------------------------------------------------------------ */
html {
    /* Orange primary — matches MkDocs Material 'orange' primary */
    --primary-color:           #E65100;
    --primary-dark-color:      #BF360C;
    --primary-light-color:     #FF6D00;
    --on-primary-color:        #ffffff;
    --link-color:              #E65100;

    /* Solarized light base palette */
    --page-background-color:   #fdf6e3;   /* base3  */
    --page-foreground-color:   #586e75;   /* base01 */
    --page-secondary-foreground-color: #93a1a1;  /* base1 */
    --separator-color:         #eee8d5;   /* base2  */
    --side-nav-background:     #eee8d5;   /* base2  */
    --code-background:         #eee8d5;   /* base2  */
    --blockquote-background:   #f5eed9;
    --blockquote-foreground:   #657b83;   /* base00 */
    --tablehead-background:    #eee8d5;

    /* Keep border radius from awesome */
    --border-radius-large:     8px;
    --border-radius-medium:    6px;
    --border-radius-small:     4px;
}

/* ------------------------------------------------------------------ */
/* Dark mode (toggled by doxygen-awesome-darkmode-toggle.js)           */
/* Palette: slate-inspired, same orange accent                         */
/* ------------------------------------------------------------------ */
html.dark-mode {
    --primary-color:           #FF6D00;
    --primary-dark-color:      #E65100;
    --primary-light-color:     #FF8F00;
    --on-primary-color:        #ffffff;
    --link-color:              #FF8F00;

    --page-background-color:   #2b303b;
    --page-foreground-color:   #c0c5ce;
    --page-secondary-foreground-color: #868d97;
    --separator-color:         #3c414d;
    --side-nav-background:     #232830;
    --code-background:         #1e2229;
    --section-code-background: rgba(255, 255, 255, 0.06);
    --section-code-border:     rgba(255, 255, 255, 0.14);
    --blockquote-background:   #232830;
    --blockquote-foreground:   #868d97;
    --tablehead-background:    #232830;
}

/* ------------------------------------------------------------------ */
/* Typography — match MkDocs Material Roboto stack                     */
/* ------------------------------------------------------------------ */
html {
    --font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI",
                   Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-family-monospace: "Roboto Mono", ui-monospace, SFMono-Regular,
                              SF Mono, Menlo, Consolas, "Liberation Mono", monospace;
    --page-font-size:       15.6px;
    --content-line-height:  1.7;
}

/* ------------------------------------------------------------------ */
/* Layout — widen the main content cap                                 */
/* ------------------------------------------------------------------ */

/* The doxygen-awesome theme constrains main content via
 * --content-maxwidth (1050px by default). The theme's layout uses a
 * `margin: ... auto ... auto` centering on div.contents, so the
 * content sits in the middle of the available column with substantial
 * whitespace at the right edge of wide displays.
 *
 * Override ONLY the variable — don't touch widths on #doc-content or
 * .contents directly: the theme's flex layout (row-reverse on the
 * .contents wrapper, see doxygen-awesome.css L1005-1015) depends on
 * those staying as the theme intends. Setting them to 100% causes
 * outer horizontal scroll (the sidebar adds extra width on top of
 * #doc-content) and disrupts the flex flow for index pages that have
 * a flex-reversed aside.
 *
 * 1600px is a moderate widening from 1050px: comfortably fits wide
 * tables and side-by-side code samples on FullHD/4K, doesn't introduce
 * extreme line lengths on common 1920px+ displays since the sidebar
 * still consumes ~250px on the left. */
html {
    --content-maxwidth: 1600px;
}

/* Slightly warmer code blocks */
div.fragment,
pre.fragment {
    border-left: 3px solid var(--primary-light-color);
}

/* ------------------------------------------------------------------ */
/* Overload collapse (doxygen-overload-collapse.js)                    */
/* ------------------------------------------------------------------ */

/* Compact navigator strip placed under the primary heading of a
 * multi-overload run. Lists "[1/N] [2/N] ..." as anchor links so the
 * reader sees one entry per function name but can still jump to a
 * specific overload signature. */
.overload-jump-strip {
    margin: 0.3em 0 1em 0;
    padding: 0.2em 0.6em;
    font-size: 0.9em;
    color: var(--page-secondary-foreground-color);
    border-left: 3px solid var(--primary-light-color);
    background: var(--code-background);
    border-radius: var(--border-radius-small);
}
.overload-jump-strip .overload-jump-label {
    font-style: italic;
    margin-right: 0.4em;
}
.overload-jump-strip .overload-jump-link {
    display: inline-block;
    margin: 0 0.15em;
    padding: 0 0.35em;
    border-radius: var(--border-radius-small);
    color: var(--primary-color);
    text-decoration: none;
}
.overload-jump-strip .overload-jump-link:hover {
    background: var(--primary-color);
    color: var(--on-primary-color);
}

/* Folded [2..N] overloads — render the summary like a slimmer memtitle
 * so the visual rhythm stays consistent with the unfolded [1/N] header
 * above it. */
details.overload-fold {
    margin: 0.6em 0;
}
details.overload-fold > summary.overload-summary {
    cursor: pointer;
    padding: 0.4em 0.8em;
    background: var(--code-background);
    border-left: 3px solid var(--primary-light-color);
    border-radius: var(--border-radius-small);
    font-weight: 600;
    list-style: none;             /* hide default ▶ marker, we draw one below */
}
details.overload-fold > summary.overload-summary::-webkit-details-marker {
    display: none;
}
details.overload-fold > summary.overload-summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.5em;
    color: var(--primary-color);
    font-size: 0.8em;
    transition: transform 0.15s ease;
}
details.overload-fold[open] > summary.overload-summary::before {
    transform: rotate(90deg);
}
details.overload-fold > summary.overload-summary .overload {
    color: var(--page-secondary-foreground-color);
    font-weight: 400;
    margin-left: 0.4em;
}

/* ------------------------------------------------------------------ */
/* Compact function-signature rendering                                */
/* ------------------------------------------------------------------ */

/* Doxygen default: <table class="memname"> lays out a function
 * signature with one parameter per <tr>, producing a tall vertical
 * stack that scales poorly for template-heavy h5cpp signatures.
 * Collapse the inner table to flow inline so the signature reads as a
 * single C++ declaration and wraps naturally on narrow viewports.
 *
 * Only the inner table.memname is touched — the outer table.mlabels
 * wrapper (which keeps the "inline"/"static"/"virtual" label pinned
 * to the right) is left alone so it can continue to flex. */
table.memname,
table.memname > tbody,
table.memname > tbody > tr,
table.memname > tbody > tr > td {
    display: inline;
    padding: 0;
    border: none;
    background: none;
}
table.memname > tbody > tr > td.memname {
    font-weight: 600;
    white-space: nowrap;
}
table.memname > tbody > tr > td.paramtype {
    white-space: nowrap;
}
/* No margins on paramtype/paramname: Doxygen emits a non-breaking space
 * (&nbsp;) at the end of each paramtype cell which already acts as the
 * type/name separator. Adding CSS margin on top doubles that gap. */
