/*
2025
Adapted from Patrick Kidger's custom_css.css: https://github.com/patrick-kidger/lineax/blob/main/docs/_static/custom_css.css
*/

/* Fix /page#foo going to the top of the viewport and being hidden by the navbar */
html {
    scroll-padding-top: 50px;
}

/* Emphasise sections of nav on left hand side */

nav.md-nav {
  padding-left: 5px;
  padding-bottom: 5px;
}

nav.md-nav--secondary {
    border-left: revert !important;
}

.md-nav__title {
  font-size: 0.9rem;
}

.md-nav__item--section > .md-nav__link {
  font-size: 0.9rem;
}

/* Indent autogenerated documentation */

div.doc-contents {
  padding-left: 25px;
  border-left: 4px solid rgba(230, 230, 230);
}

/* Increase visibility of splitters "---" */

[data-md-color-scheme="default"] .md-typeset hr {
    border-bottom-color: rgb(0, 0, 0);
    border-bottom-width: 1pt;
}

[data-md-color-scheme="slate"] .md-typeset hr {
    border-bottom-color: rgb(230, 230, 230);
}

/* More space at the bottom of the page */

.md-main__inner {
  margin-bottom: 1.5rem;
}

/* Remove prev/next footer buttons */

.md-footer__inner {
    display: none;
}

/* Change font sizes */

html {
    /* Decrease font size for overall webpage
       Down from 137.5% which is the Material default */
    font-size: 137.5%;
}

.md-typeset .admonition {
    /* Increase font size in admonitions */
    font-size: 100% !important;
}

.md-typeset details {
    /* Increase font size in details */
    font-size: 100% !important;
}

.md-typeset h1 {
    font-size: 1.6rem;
}

.md-typeset h2 {
    font-size: 1.5rem;
}

.md-typeset h3 {
    font-size: 1.3rem;
}

.md-typeset h4 {
    font-size: 1.1rem;
}

.md-typeset h5 {
    font-size: 0.9rem;
}

.md-typeset h6 {
    font-size: 0.8rem;
}

/* Bugfix: remove the superfluous parts generated when doing:

??? Blah

    ::: library.something
*/

.md-typeset details .mkdocstrings > h4 {
    display: none;
}

.md-typeset details .mkdocstrings > h5 {
    display: none;
}

/* Change default colours for <a> tags */

[data-md-color-scheme="default"] {
    --md-typeset-a-color: rgb(94, 151, 246) !important;
}
[data-md-color-scheme="slate"] {
    --md-typeset-a-color: rgb(94, 151, 246) !important;
}

/* Highlight functions, classes etc. type signatures. Really helps to make clear where
   one item ends and another begins. */

[data-md-color-scheme="default"] {
    --doc-heading-color: #DDD;
    --doc-heading-border-color: #CCC;
    --doc-heading-color-alt: #F0F0F0;
}
[data-md-color-scheme="slate"] {
    --doc-heading-color: rgb(25,25,33);
    --doc-heading-border-color: rgb(25,25,33);
    --doc-heading-color-alt: rgb(33,33,44);
    --md-code-bg-color: rgb(38,38,50);
}

h4.doc-heading {
    /* NOT var(--md-code-bg-color) as that's not visually distinct from other code blocks.*/
    background-color: var(--doc-heading-color);
    border: solid var(--doc-heading-border-color);
    border-width: 1.5pt;
    border-radius: 2pt;
    padding: 0pt 5pt 2pt 5pt;
}
h5.doc-heading, h6.heading {
    background-color: var(--doc-heading-color-alt);
    border-radius: 2pt;
    padding: 0pt 5pt 2pt 5pt;
}


/* Place the logo as a background on the persistent sidebar element to avoid
   flicker when the navigation is re-rendered. This keeps a single stable
   background image and prevents the <img> from being removed/inserted. */
.md-sidebar--primary {
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center 0.6rem; /* centered horizontally, slightly from top */
    background-size: 180px auto;
    /* Ensure there's space for the background logo so it doesn't overlap the nav */
    padding-top: 140px;
}

@media (max-width: 720px) {
    .md-sidebar--primary {
        background-size: 120px auto;
        padding-top: 80px;
        background-position: center 0.4rem;
    }
}

@media (max-width: 480px) {
    .md-sidebar--primary {
        background-size: 96px auto;
        padding-top: 64px;
    }
}

[data-md-color-scheme="light"] img[src$="#only-light"],
[data-md-color-scheme="dark"] img[src$="#only-dark"] {
  display: none; /* Hide dark images in light mode */
}
