:root {
    scroll-behavior: smooth;
}

body * {
    scroll-margin-top: 10px;
}

body {
    margin: 0;
    font-family: "Roboto Slab", Georgia, serif;
    color: #332255;
    scrollbar-gutter: stable;
}

header {
    background-color: #5749d1;
    padding: 1em;
    color: white;
    position: relative;
}

#logo {
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translatey(-50%);
}

/* #logo {
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translatey(-50%);
} */

header a {
    text-decoration: none;
    color: white;
}

header h1 {
    margin: 0;
    margin-right: 120px;
}

header p {
    margin-right: 120px;
}

#nav-button {
    position: fixed;
    top: 0;
    right: 0;
    width: 64px;
    height: 56px;
    background-color: #33225588;
    border: none;
    border-bottom-left-radius: 10px;
    font-size: 20pt;
    color: white;
    text-align: center;
    line-height: 0;
    cursor: pointer;
}

#nav-button:before {
    content: "\002630";
}

#nav-button:active {
    background-color: #8fc3e488;
}

#nav-button.open:before {
    content: "\00FF38";
}

#side-menu-title {
    color: #888;
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}

#nav-menu {
    position: fixed;
    top: 0;
    left: 102%;
    width: 80%;
    height: 100%;
    background: #ddd;
    box-shadow: 0 0 6px #00000088;
    transition: left 0.5s;
}

#nav-menu.open {
    left: 20%;
}

#nav-menu>h2 {
    text-align: center;
}

#nav-menu>ul {
    padding: 0;
    margin: 0;
    display: flex;
    padding: 4px;
    flex-flow: column nowrap;
    list-style: none;
}

#nav-menu>ul li {
    display: contents;
}

#nav-menu>ul a {
    flex: 1;
    flex-basis: 56px;
    padding-inline: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

#nav-menu>ul a:hover {
    background-color: #ffffff88;
}

#nav-menu>ul a.active {
    background-color: #4e9dc7;
    color: white;
    padding-top: 4px;
    box-shadow: inset 0 4px 4px #00000088;
}

#nav-menu>ul a.active:hover {
    background-color: #8fc3e4;
}

.zero-height {
    position: -webkit-sticky;
    position: sticky;
    top: 0px;
}

#page-nav-menu {
    left: -270px;
    position: absolute;
    margin-top: 2em;
    transition: 0.5s;
    -webkit-filter: drop-shadow(1px 1px 2px #00000088);
    filter: drop-shadow(1px 1px 2px #00000088);
}

#page-nav-menu:hover, #page-nav-menu.active {
    left: 0;
}

#page-nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    min-height: 196px;
    padding: 1rem;
    width: 270px;
    background-color: #eee;
    border-bottom-right-radius: 12px;
    display: flex;
    flex-flow: column nowrap;
    gap: 0.5em;

    max-height: calc(100vh - 5em);
    overflow-y: auto;
}

#page-nav-menu #page-nav-title {
    font-size: 14pt;
    text-align: center;
    margin: 0;
    position: absolute;
    display: block;
    box-sizing: border-box;
    left: calc(100% + 35px);
    height: 36px;
    width: 176px;
    padding: 8px;
    transform-origin: top left;
    transform: rotate(90deg);
    background-color: #eee;
    border-radius: 12px 12px 0 0;
}

#page-nav-menu h2:before {
    content: '\002BC6  On This Page \002BC6';
}

#page-nav-menu a {
    text-decoration: none;
    display: block;
    color: #332255;
    background-color: white;
    padding: 3px;
    border-radius: 0 3px 3px 0;
    border-left: 4px solid #a1ddcd;
    padding-left: 6px;
    margin-left: -6px;
    position: relative;
    left:0;
}

#page-nav-menu a:hover {
    left: 4px;
}

main {
    padding-bottom: 120px;
    padding-inline: 15% 5%;
}

main a:link,
footer a:link {
    color: #5749d1;
}

main a:visited,
footer a:visited {
    color: #5749d1;
    /* color: #d66393; */
}

main a:hover {
    color: #a1ddcd;
}

main p,
main dl * {
    line-height: 170%;
}

main h2 {
    margin-top: 60px;
    border-left: 8px solid #f9accc;
    padding-left: 10px;
    margin-left: -18px;
}

main h3 {
    border-left: 6px solid #a1ddcd;
    padding-left: 10px;
    margin-left: -16px;
}

main h4 {
    border-left: 5px solid #5749d1;
    padding-left: 10px;
    margin-left: -15px;
}

/* section {
    
} */

pre,
form {
    margin-block: 40px;
    padding: 20px;
    border-radius: 20px;
    background-color: #ddeeff;
    /* box-shadow: inset 0 0 6px #00000088; */
    font-size: small;
}

pre {
    overflow-x: auto;
}

pre.sectionhead {
    background-color: #ddf5ef;
}

code {
    font-family: "Roboto Mono", monospace;
    font-style: normal;
    color: #5749d1;
    background-color: #eee;
    border-radius: 5px;
    padding: 5px;
}

pre code {
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}

figure {
    margin: 0;
}

figure img {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
}

figcaption {
    color: #888;
    font-style: italic;
    margin-top: -30px;
    margin-bottom: 40px;
    margin-inline: 1em;
}

figcaption code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.docs-link {
    float: right;
    font-style: italic;
}

.docs-link:before {
    content: "\0027A5 Official docs page";
}

.comment {
    color: #2c9f80;
}

.note {
    color: #888;
}

.output {
    color: #332255;
}

.error {
    color: #e5162b;
}

.highlight {
    background-color: #ffff44;
    border-radius: 3px;
}

.string {
    color: #bb9153;
}

.quote {
    color: #4e9dc7;
}

kbd {
    padding: 3px;
    border-radius: 5px;
    background: #ddd;
    border: 2px outset #eee;
}

dt {
    margin-top: 20px;
    font-weight: bold;
    font-size: large;
}

table {
    gap: 2px;
    background-color: #ddeeff;
    border-radius: 5px;
}

th {
    background-color: #8fc3e4;
    color: white;
}

td {
    background-color: white;
}

th,
td {
    padding: 5px;
    border-radius: 5px;
}

footer {
    background-color: #ddd;
    padding-inline: 15%;
    padding-top: 20px;
    padding-bottom: 80px;
    text-align: center;
    color: #888;
}

#page-nav-menu a:hover,
footer a:hover {
    color: #2c9f80;
}

footer ul {
    /* display: flex;
    flex-flow: row wrap; */
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    margin: auto;
    padding: 0;
    -moz-column-gap: 3em;
    column-gap: 3em;
    row-gap: 1em;
}

footer ul li {
    text-align: left;
    word-break: break-word;
}

/* Change number of columns in references based on screen width */
@media screen and (min-width: 768px) {
    footer ul {
        grid-template-columns: repeat(2, 1fr);
        
    }
}

@media screen and (min-width: 1280px) {
    footer ul {
        grid-template-columns: repeat(3, 1fr);
        
    }
}

/* Responsive nav menu */
@media screen and (min-width: 768px) {
    body * {
        scroll-margin-top: 88px;
    }

    header {
        z-index: 1;
    }

    #nav-button {
        visibility: hidden;
    }

    #side-menu-title {
        display: none;
    }

    #nav-menu {
        position: -webkit-sticky;
        position: sticky;
        width: 100%;
        top: 0;
        left: 0;
    }

    #nav-menu>h2 {
        position: absolute;
        margin: 0;
        left: 20px;
        top: 50%;
        line-height: 0;
    }

    #nav-menu>ul {
        flex-flow: row nowrap;
        width: 70%;
        height: 64px;
        margin: auto;
    }

    .zero-height {
        top: 72px;
    }

    #page-nav-menu ul {
        max-height: calc(100vh - 15em);
    }

    main {
        padding-inline: 15%;
    }

    section {
        margin-left: 2em;
    }

    pre {
        font-size: large;
    }

    footer p {
        margin-inline: 10%;
    }
}