@import "normalize.css";
@import "vars.css";
@import "typo.css";
@import "components.css";
@import "microns/microns.css";

body {
    background: light-dark(var(--white-light), var(--gray-light));
    color: light-dark(var(--black), var(--white));
}

body .document{
    margin: 0 auto;
    display: flex;
}

div.body, .caption-text code {
    color: light-dark(var(--black), var(--white));
}

div.sphinxsidebar{
    position: unset;
    flex: 1;
    order: 1;
    overflow: unset;
    line-height: 1.5;

    p {
        margin: 0;
    }

    h3 {
        border-top: 1px solid light-dark(var(--gray-light), var(--white-light));
        border-bottom: 1px solid light-dark(var(--gray-light), var(--white-light));
        color: light-dark(var(--black), var(--white));
        font-size: 1.45em;
        font-weight: normal;
        margin: 0 0 5px 0;
        line-height: 1.5em;
    }

    ul, ul.want-points{
        list-style: none;
        padding: 0;
    }

    ul ul {
        margin-left: 20px;
    }

    ul li a{
        border: none;
        display: block;
        padding: 5px 3px;
        color: light-dark(var(--black), var(--white));

        &:hover, &.current{
            background-color: light-dark(var(--white), var(--white-light));
            border: none;
        }

        &.current {
            font-weight: bold;
        }
    }

    ul .toctree-l1{
        margin: 5px 0;
        cursor: pointer;

        &:has(ul) > a::after{
            content: "\E707";
            float: right;
            top: 0;
            font-family: "microns";
        }
    }
}
div.documentwrapper {
    flex: 4;
    order: 2;
    max-width: 940px;

    div.body {
        padding-left: 30px;
    }
}

div.sphinxsidebarwrapper{
    position: sticky;
    height: 100vh;
    display: flex;
    flex-direction: column;
    top: 0;
    padding: 0;
    border-right: 1px solid light-dark(var(--gray-light), var(--white-light));

    > ul{
        flex-grow: 1;
        flex-shrink: 1;
        overflow: auto;
        scroll-behavior: smooth;
    }


    p.logo {
        margin: 40px 0 10px 0;
    }
}

div.document {
    display: flex;
}

div.body{
    background: transparent;
    max-width: 1100px;
}

div.clearer{
    clear: none;
    display: none;
}

:target > h2:first-of-type{
    background-color: var(--yellow-light);
}

div.related {

    ul {
        margin: 0;
        padding: 0 0 0 10px;
        list-style: none;

        li {
            display: inline;
        }
    }
}

nav#rellinks {

    text-align: right;
    
    li + li::before {
      content: "|";
    }
}

div.footer {
  margin: 20px auto 30px auto;
  font-size: 14px;
  color: var(--gray);
  text-align: right;
}


.related.bottom{
    border-top: 1px solid light-dark(var(--gray-light), var(--white-light));
}

@media screen and (min-width: 1200px){
    div.document {
        width: 1200px;
    }
}

@media screen and (max-width: 940px) {
    div.sphinxsidebar p.logo {
        display: block;
    }

    body {
        padding: 0;
    }

    div.document {
        display: block;
    }
}

.logo {
    img {
        display: block;
        margin: 0 auto;
    }
}

@media (prefers-color-scheme: dark) {
    div.sphinxsidebar p.logo {
        filter: brightness(0) invert(1);
    }
}

[data-theme="dark"] div.sphinxsidebar p.logo {
    filter: brightness(0) invert(1);
}

[data-theme="light"] div.sphinxsidebar p.logo {
    filter: none;
}

button[data-theme-toggler]{
    border: none;
    position: fixed;
    top: 10px;
    right: 10px;
    background: none;
    color: light-dark(var(--black), var(--white));
    font-size: 20px;
    cursor: pointer;

    i::before{
        font-family: "microns";
        width: 20px;
        height: 20px;
        font-style: normal;
    }
    
    
    &:hover {
        color: light-dark(var(--white), var(--black));
    }
}

[data-theme="dark"] button[data-theme-toggler] i::before{
    content: "\E7B2";
}

[data-theme="light"] button[data-theme-toggler] i::before{
    content: "\E7B1";
}