:root {
    --sidebar-fg: hsl(0, 0%, 0%);
    --sidebar-active: #1f1fff;
    --sidebar-spacer: #f4f4f4;

    --scrollbar: #8F8F8F;

    --icons: #747474;
    --icons-hover: #000000;

    --links: #20609f;

    --inline-code-color: #301900;

    --theme-popup-bg: #fafafa;
    --theme-popup-border: #cccccc;
    --theme-hover: #e6e6e6;

    --quote-bg: hsl(197, 37%, 96%);
    --quote-border: hsl(197, 37%, 91%);

    --warning-border: #ff8e00;

    --table-border-color: hsl(0, 0%, 95%);
    --table-header-bg: hsl(0, 0%, 80%);
    --table-alternate-bg: hsl(0, 0%, 97%);

    --searchbar-border-color: #aaa;
    --searchbar-bg: #fafafa;
    --searchbar-fg: #000;
    --searchbar-shadow-color: #aaa;
    --searchresults-header-fg: #666;
    --searchresults-border-color: #888;
    --searchresults-li-bg: #e4f2fe;
    --search-mark-bg: #a2cff5;

    --mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
    --code-font-size: 0.875em /* please adjust the ace font size accordingly in editor.js */
}


html, body {
    margin: 0;
    padding: 0;
    color: #1F1F1F;
}

#searchresults a,
.content a:link,
a:visited,
a > .hljs {
    color: #20609f;
}

h1, h2, h3, h4, h5, h6 {
    color: #444;
}

pre {
    overflow-x: scroll;
}


#container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
}

nav {
    display: none;
}

#nav-mobile-reveal {
    display: none;
}

#nav-mobile-reveal:checked ~ nav {
    display: block;

    margin: 8px;
    padding: 8px 16px;
    border: 2px solid #333;
}

main {
    padding: 12px 24px;
}

.chapter {
    list-style: none outside none;
    padding-inline-start: 0;
    line-height: 2.2em;
}

.chapter ol {
    width: 100%;
}

.chapter li {
    display: flex;
    color: #aaaaaa;
}
.chapter li a {
    display: block;
    padding: 0;
    text-decoration: none;
    color: var(--sidebar-fg);
}

.chapter li a:hover {
    color: var(--sidebar-active);
}

.chapter li a.active {
    color: var(--sidebar-active);
}

.chapter li > a.toggle {
    cursor: pointer;
    display: block;
    margin-inline-start: auto;
    padding: 0 10px;
    user-select: none;
    opacity: 0.68;
}

.chapter li > a.toggle div {
    transition: transform 0.5s;
}

/* collapse the section */
.chapter li:not(.expanded) + li > ol {
    display: none;
}

.chapter li.chapter-item {
    line-height: 1.5em;
    margin-block-start: 0.6em;
}

.chapter li.expanded > a.toggle div {
    transform: rotate(90deg);
}

.spacer {
    width: 100%;
    height: 3px;
    margin: 5px 0px;
}
.chapter .spacer {
    background-color: var(--sidebar-spacer);
}

@media (-moz-touch-enabled: 1), (pointer: coarse) {
    .chapter li a { padding: 5px 0; }
    .spacer { margin: 10px 0; }
}

.section {
    list-style: none outside none;
    padding-inline-start: 20px;
    line-height: 1.9em;
}

.side-spacer {
    display: none;
}


.page-buttons-row {
    width: 100%;

    display: flex;
    flex-direction: row;
    gap: 4px;

    padding-top: 48px;
    padding-bottom: 48px;
}

.page-buttons-row a {
    display: block;

    line-height: 48px;

    border: 2px solid #1e4975;
    border-radius: 8px;
    padding: 0px 16px;

    color: #1e4975;
    text-decoration: none;
}

.page-buttons-spacer {
    flex-grow: 1;
    flex-shrink: 1;
}


@media only screen and (min-width: 750px) {

    #container {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        overflow-y: scroll;
    }

    .side-spacer {
        display: inline-block;
        position: sticky;
        top: 0;

        flex-shrink: 1;
        flex-grow: 1;
        
        background-color: #EAEAEA;
    }

    nav {
        display: block;
        width: 250px;
        position: sticky;
        top: 0;

        flex-grow: 0;
        flex-shrink: 0;
        overflow-y: scroll;

        padding: 12px;
        padding-left: 16px;

        background-color: #FAFAFA;
    }

    .toc-toggle {
        display: none;
    }

    main {
        width: 800px;
        max-width: calc(100% - 380px);
        padding: 24px 48px;

        background-color: #FFF;
    }

}