:root {
    --bg: #000;
    --fg: #fff;
    --link: #09f;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: sans-serif;
    max-width: 50rem;
    padding: 0 2rem;
    margin: 1rem auto;
    line-height: 1.6;
    display: flex;
    flex-direction: row-reverse;
}

#sidebar {
    position: sticky;
    top: 0.5rem;
    align-self:start;
    margin-left: 1.5rem;
    background: inherit;
    flex-shrink: 0;
    width: 8rem;
}

#sidebar ul {
    padding: 0;
    list-style: none;
}

#main {
    flex-grow: 999;
}

#title {
    border-bottom: 1px solid;
    padding-bottom: 0.25em;
    margin-bottom: 0.5rem;
}

footer p {
    margin: 2em 0 0;
}

#title h1 {
    display: inline;
    margin-right: 0.25em;
    margin-top: 0;
    font-size: 2em;
    font-style: normal;
}

#title p {
    display: inline;
}

header p {
    font-style: italic;
    font-weight: normal;
}

ul {
    margin: 0;
}

.post-list {
    list-style: "> " inside;
    padding-left: 1rem;
}

h1, h2, h3 {
    margin-bottom: 0.25em;
    line-height: 1.3;
}

p {
    margin-top: 0;
}

a {
    color: var(--link);
}

#sidebar a, #main-nav a:visited {
    color: inherit;
}

footer a {
    color: inherit; 
}

.icon svg {
    vertical-align: text-bottom;
}

.cc svg {
    margin-left: 3px;
}

.chroma {
    padding: 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
}

article img {
    max-width: 80%;
    padding: 1rem;
    display: block;
    margin: auto;
}

hr {
    height: 1px;
    border: 0;
    background: var(--fg);
}

.footnotes ol p {
    margin: 0
}

#toc-title {
    margin-top: 0;
}

#toc ol {
    list-style: inside;
    margin: 0;
}

#toc ol {
    padding-left:0;
}

#toc ol ol {
    padding-left:1em;
}

#toc ol > li::marker { 
    content: counters(list-item, '.') ' ';
}

.skip {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip:focus {
    position: static;
    width: auto;
    height: auto;
    display: block;
    color: var(--link);
}

@media screen and (max-width: 54rem) {
    body {
        flex-direction:column;
    }

    #sidebar {
        position: static;
        margin: 0 0 0.25rem;
        width: 100%;
    }

    #sidebar li {
        display: inline-block;
        margin-right: 0.5rem;
    }

    #title h1 {
        display: block;
        margin-bottom: 0;
    }
}

