@import url("cbs.css");

:root {
    --background: #0D1117;
    --background-secondary: #161B22;
    --background-nav: #262F3B;
    --text: #C9D1D9;
    --text-secondary: #8C979F;
    --link: #58A6F0;
    --link-highlight: #6B61A9;
    --highlight: #343942;
    --highlight-hover: #464E5B;
    --highlight-active: #5A6475;
    --border: #393C41;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--highlight);
    border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--highlight-hover);
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--highlight-active);
}

*, *::before, *::after {
    box-sizing: border-box;
    font-family: sans-serif;
}

img[align="left"] {
    max-width: 100px;
    margin: 20px 10px 0 0;
}

img[align="left"] + h1 {
    margin: 40px 20px 20px 110px;
}

img[align="left"] + h1 .link {
    left: -130px;
}

*:is(h1, h2, h3) .link {
    position: absolute;
    left: -20px;
    font-size: 13px;
    opacity: 0;
    cursor: pointer;
    transform: rotate(-190deg);
}

*:is(h1, h2, h3):is(:hover, :focus) .link {
    opacity: 1;
}

body {
    background-color: var(--background);
    color: var(--text);
    margin: 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:is(:hover, :focus) {
    text-decoration: underline;
}

h1, h2 {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

h1, h2, h3 {
    position: relative;
    margin: 20px 0;
    cursor: pointer;
}

code {
    background-color: var(--highlight);
    padding: 2px 5px;
    border-radius: 5px;
}

pre:has(code) {
    background-color: var(--background-secondary);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

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

table {
    width: 100%;
    border: 1px solid var(--border);
    border-collapse: collapse;
}

tr:nth-child(even) {
    background-color: var(--background-secondary);
}

td, th {
    border: 1px solid var(--border);
    padding: 15px;
    text-align: left;
}

#content {
    position: fixed;
    display: none;
    top: 40px;
    left: 0;
    right: 0;
    height: calc(100vh - 40px);
    padding: 0 30px 50px 30px;
    line-height: 1.5em;
    overflow-y: auto;
}

#nav {
    position: fixed;
    top: 0; 
    bottom: 0;
    left: -280px;
    width: 280px;
    background-color: var(--background-nav);
    padding: 0 20px 50px 20px;
    transition: 0.5s;
    z-index: 1;
    overflow-y: auto;
}

#nav.open {
    left: 0;
}

#nav h2 {
    border-bottom: 1px solid var(--highlight-active);
    margin: 0;
    padding: 20px 0 0 0;
}

#nav details {
    margin: 5px 0;
    padding-left: 10px;
    user-select: none;
}

#nav details summary {
    padding: 5px;
    cursor: pointer;
}

#nav details > summary.highlight,
#nav details > a.highlight {
    background-color: var(--link-highlight);
    border-radius: 5px;
}

#nav details > a {
    display: block;
    padding: 5px;
    margin: 5px 15px;
}

#nav a {
    color: var(--text-secondary);
    transition: 0.5s;
}

#nav a:is(:hover, :focus),
#nav a.highlight,
#nav details > summary.highlight a,
#nav details[open] > summary a {
    color: var(--text);
    text-decoration: none;
}

#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: var(--background-secondary);
    padding: 7px 15px;
    transition: 0.5s;
}

#menu-bar.open {
    left: 280px;
}

#menu-bar .menu {
    font-size: 26px;
    cursor: pointer;
}

@media only screen and (min-width: 1000px) {
    #content {
        top: 0;
        left: 280px;
        height: 100vh;
        padding-top: 0;
    }

    #menu-bar {
        display: none;
    }

    #nav {
        left: 0;
    }
}