:root {
    /* Colors */
    --color-text: #E4E0EB;
    --color-heading: #FFFFFF;
    --color-link: #F6E748;
    --color-link-active: #ffde00;
    --color-code-bg: #1F2442;
    --color-side-bg: #543182;
    --color-content-bg: #3A1C63;
    --color-hover-link: color-mix(in srgb, var(--color-link) 40%, white);
    --color-hover-link-bg: rgba(255, 255, 255, 0.12);
    --color-quote-bg: color-mix(in srgb, var(--color-side-bg) 33%, transparent);
    --side-box-shadow: 0 0 20px 0px rgb(0 0 0 / 20%);

    /* Fonts */
    --font-body: Calibri, serif;
    --font-heading: Calibri, serif;
    --font-code: 'Terminus TTF', monospace;

    /* Sizing */
    --font-h1: 4rem;
    --font-h2: 3rem;
    --font-h3: 2.5rem;
    --font-h4: 2rem;
    --font-p: 1.5rem;

    /* Layout */
    --side-min-width: 240px;
    --side-max-width: 25%;
}

.light {
    --color-text: #2D2342;
    --color-heading: #3A1C63;
    --color-link: #7e6b00;
    --color-link-active: #FFD600;
    --color-code-bg: #F3F0FF;
    --color-side-bg: #efe1ff;
    --color-content-bg: #F8F6FF;
    --color-hover-link: color-mix(in srgb, var(--color-link) 40%, #3a1c63);
    --color-hover-link-bg: rgb(126 121 0 / 12%);
    --color-quote-bg: color-mix(in srgb, var(--color-side-bg) 33%, transparent);
    --side-box-shadow: 0 0 5px 5px rgb(213 193 233 / 60%);
}

/*@font-face {*/
/*    font-family: 'Terminus TTF';*/
/*    src: url('TerminusTTF.ttf') format('truetype');*/
/*}*/

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-width: 0;
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-link), transparent 50%);
    border-radius: 8px;
    border: 2px solid transparent; /* creates padding effect */
    background-clip: content-box;
}

*:hover {
    &::-webkit-scrollbar-track {
        /*background: rgba(0, 0, 0, 0.2);*/
    }

    &::-webkit-scrollbar-thumb {
        background: var(--color-link);
        border: 2px solid transparent;
        background-clip: content-box;
    }
}

@supports (-moz-appearance: none) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--color-link) transparent;
    }
}

html,
body {
    font-size: 14px;
    font-family: Calibri, serif;
    height: 100%;
    margin: 0;
    color: var(--color-text);
    overflow: hidden;
}

p {
    white-space: pre-wrap;
    margin-top: 0;
    font-size: var(--font-p);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    margin-bottom: 0;
}

h1 {
    font-size: var(--font-h1);
}

h2 {
    font-size: var(--font-h2);
}

h3 {
    font-size: var(--font-h3);
}

h4 {
    font-size: var(--font-h4);
}

blockquote {
    border-left-width: 0.25rem;
    border-left-style: solid;
    border-left-color: var(--color-text);
    padding-left: 0.5rem;
    background: var(--color-quote-bg);
}

a:link,
a:visited,
a:hover,
a:active {
    color: var(--color-link);
}

pre {
    position: relative;
}

.copy-code-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 2px 8px;
    font-size: 0.8em;
    cursor: pointer;
    z-index: 1;
    background: var(--color-content-bg);
    outline: none;
    border: 1px solid var(--color-link);
    color: var(--color-link);
    border-radius: 3px;
}

code {
    background: var(--color-code-bg);
    padding: 0 4px;
    margin: 0 -4px;
    max-height: 20rem;
}

.copy-code-block-button {
    display: block;
}


img,
video {
    max-width: 100%;
}

.layout {
    display: flex;
    height: 100%;
}

/*Aside*/

.side {
    font-size: 1rem;
    padding: 0 0 0 1rem;
    min-width: var(--side-min-width);
    max-width: var(--side-max-width);
    background: var(--color-side-bg);
    overflow-y: auto;
    direction: rtl;
    z-index: 1;
    box-shadow: var(--side-box-shadow);
}

.side.active {
    transform: translateX(0);
    box-shadow: 0 0 50px 5px rgb(0 0 0 / 30%);
}

.side * {
    direction: ltr;
}

.content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--color-content-bg);
    padding: 1rem;
    box-sizing: border-box;
}

ul.navtree {
    list-style: none;
    padding-left: 1rem;
    margin-left: 0;
    padding-right: 5px;
}

ul.navtree li {
    margin: 0.2rem 0;
}

ul.navtree li a.navtree,
ul.navtree li span.navtree {
    display: block;
    padding: 0.3rem 0.4rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
    /*border-left: 1px solid transparent;*/
}

ul.navtree li.navtree.parent a.navtree {
    /*padding-left: 0.8rem;*/
}

main.content li {
    white-space: pre-wrap;
    font-size: var(--font-p);
}

.navtree.parent > a::before {
    content: "▼";
    display: inline-block;
    margin-left: -1.5em;
    margin-right: 0.5em;
    font-size: 0.8em;
}

/* Hover styles */
ul.navtree li a.navtree:hover {
    background: var(--color-hover-link-bg);
    color: var(--color-hover-link);
}

ul.navtree li a.navtree[selected="true"] {
    letter-spacing: 1px;
    text-decoration: underline;
    font-weight: bold;
    /*border-radius: 0 4px 4px 0;*/
    /*color: var(--color-link-active);*/
    /*border-left: 2px solid var(--color-link-active);*/
}

.btn-primary {
    position: absolute;
    background: var(--color-side-bg);
    color: var(--color-link);
    border: none;
    border-radius: 20%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, color 0.2s;
}

#theme-toggle {
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

#hamburger-menu {
    display: none;
    top: 1rem;
    left: 1rem;
    z-index: 1;
}

#side-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
}

/*responsive settings*/
@media (max-width: 600px) {
    .side {
        min-width: var(--side-min-width);
        max-width: 80vw;
        transition: transform 0.3s cubic-bezier(.4, 0, .2, 1), box-shadow 0.3s;
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
    }

    #hamburger-menu {
        display: block;
    }
}

.hidden {
    display: none;
}