/*
 * What the Doxygen site of ADS changes in doxygen-awesome-css, loaded
 * after it [see HTML_EXTRA_STYLESHEET in docs/Doxyfile].
 */

/* the content as wide as on the Sphinx site [see docs/_static/ads.css],
   where the formulae and the signatures of the API need it */
html {
    --content-maxwidth: 1300px;
}

/* the title in the side panel, which has the width that
   doxygen-awesome-sidebar-only.css wants, on two lines, or it would be
   cut */
#projectname {
    white-space: normal;
}

/* a display formula wider than the page scrolls in its own box, and does
   not spill over the margin */
mjx-container[display="true"] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* a pseudocode, the display \class{pseudocode}{\begin{array} ...} of the
   comments [see docs/STYLE.md], reads as a listing: on the left, a little
   indented, instead of in the middle of the page */
mjx-container[jax="CHTML"][display="true"]:has(.pseudocode) {
    text-align: left !important;
    padding-left: 2em;
}

/* the types of the members on more lines where they are long, in a column
   of a quarter of the table: kept on one line, the longest type (e.g., an
   std::conditional_t of a nested template) widens the column for every
   member of the table and pushes the names out of the page */
table.memberdecls td.memItemLeft,
table.memberdecls td.mdescLeft {
    width: 25%;
    white-space: normal;
}

/* the title of a group of members in the colors of the theme, light or
   dark, in place of the white shadow and the fixed blue of doxygen.css */
div.groupHeader {
    box-shadow: none;
    color: var(--page-foreground-color);
    border-bottom: 1px solid var(--separator-color);
    padding-bottom: 4px;
}

/* the entries of the outline on the right on more lines, where the types
   of the parameters of the overloads make them wider than the panel, the
   lines after the first under the first, after the indentation of the
   entry, and not under the margin of the panel */
#page-nav-contents div.item {
    display: flex;
    align-items: baseline;
    white-space: normal;
}

#page-nav-contents div.item > span.arrow {
    flex: none;
}

#page-nav ul.page-outline li div.item > a {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.4;
    padding: 0.3em 0;
}

/* the look of the PDF of the user manual [see manual/build/extra.css]:
   the Latin Modern fonts of TeX for the text and the code (copied next to
   this file by HTML_EXTRA_FILES), at the size of a book, black text,
   white panels, plain tables with thin rules, the code within the prose
   without a box, and the primary 7030A0 only for the links */
@font-face { font-family: "Latin Modern Roman";
    src: url("lmroman10-regular.otf") format("opentype"); }
@font-face { font-family: "Latin Modern Roman"; font-weight: bold;
    src: url("lmroman10-bold.otf") format("opentype"); }
@font-face { font-family: "Latin Modern Roman"; font-style: italic;
    src: url("lmroman10-italic.otf") format("opentype"); }
@font-face { font-family: "Latin Modern Roman"; font-weight: bold;
    font-style: italic;
    src: url("lmroman10-bolditalic.otf") format("opentype"); }
@font-face { font-family: "Latin Modern Mono";
    src: url("lmmono10-regular.otf") format("opentype"); }
@font-face { font-family: "Latin Modern Mono"; font-style: italic;
    src: url("lmmono10-italic.otf") format("opentype"); }

html {
    --font-family: "Latin Modern Roman", serif;
    --font-family-monospace: "Latin Modern Mono", monospace;
    --page-font-size: 17px;
    --navigation-font-size: 15px;
    --toc-font-size: 15px;
    --code-font-size: 15px;
    --title-font-size: 24px;
    --primary-color: #7030A0;
    --primary-dark-color: #7030A0;
    --primary-light-color: #9363be;
    --page-foreground-color: #000000;
    --side-nav-background: var(--page-background-color);
    --tablehead-background: none;
    --code-background: none;
}

/* the same in the dark theme, with the purple of the links lightened so
   that it reads on the dark background */
@media (prefers-color-scheme: dark) {
    html:not(.light-mode) {
        --primary-color: #b37fdb;
        --primary-dark-color: #b37fdb;
        --primary-light-color: #9363be;
        --page-foreground-color: #e6e6e6;
        --side-nav-background: var(--page-background-color);
    }
}
html.dark-mode {
    --primary-color: #b37fdb;
    --primary-dark-color: #b37fdb;
    --primary-light-color: #9363be;
    --page-foreground-color: #e6e6e6;
    --side-nav-background: var(--page-background-color);
}

div.contents p, div.contents li, div.contents dd {
    text-align: justify;
    hyphens: auto;
}

h1, h2, h3, h4, h5, div.header .title {
    font-weight: bold;
    letter-spacing: 0;
}

/* the code within the prose as \texttt in the PDF */
div.contents code, div.contents span.tt {
    border: none;
    padding: 0;
    border-radius: 0;
}

/* the tables as in the PDF: a rule above and below and a thin one under
   the head, with no grid and no shadow */
table.markdownTable tbody, table.doxtable tbody, table.fieldtable {
    box-shadow: none;
    border-radius: 0;
}
table.markdownTable, table.doxtable, table.fieldtable {
    border-collapse: collapse;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
}
table.markdownTable td, table.markdownTable th,
table.doxtable td, table.doxtable th,
table.fieldtable td, table.fieldtable th {
    border: none;
}
table.markdownTable tr, table.doxtable tr {
    border-bottom: none;
}
table.markdownTable th, table.doxtable th, table.fieldtable th {
    font-weight: bold;
    border-bottom: 0.5px solid currentColor;
}

/* the labels of the members (inline, explicit, ...) in gray, the purple
   being only for the links */
span.mlabel {
    background: var(--page-secondary-foreground-color);
}
