:root {
    --text-color: black;
    --hover-text-color: white;
    --hover-background-color: black;
    --secondary-text-color: #222;
    --block-background-color: #eee;
    --font-size-mobile: 1rem;
    --font-size-desktop: 1.25rem;
    --content-max-width: 640px;
    --content-bottom-margin: 1em; /* fallback */
    --content-bottom-margin: 0.8lh;
}
body {
    background-color: GhostWhite;
    display: grid;
    gap: 1rem;
    font-size: var(--font-size-mobile);
    color: var(--text-color);
    font-family: "TeX Gyre Heros", sans-serif;
    padding: 0.5rem 1rem;
    line-height: 1.5;
}
h1, h2, h3 {
    font-weight: bold;
    font-size: var(--font-size-mobile);
    padding: 0 0.25rem;
    &:before, &:after {
        font-weight: bold;
    }
    text-wrap: wrap;
}
h1 {
    &:before {
        content: "= ";
    }
    &:after {
        content: " =";
    }
}

h2 {
    &:before {
        content: "== "
    }
    &:after {
        content: " =="
    }
}
h3 {
    &:before {
        content: "=== "
    }
    &:after {
        content: " ==="
    }
}
hr {
    margin-bottom: 1rem;
    border: none;
    border-bottom: 1px solid darkgray;
    &.footnotes-sep {
        margin-bottom: 0;
    }
}
a {
    color: var(--text-color);
    &:hover {
        color: var(--hover-text-color);
        background-color: var(--hover-background-color);
    }
}
blockquote, pre {
    background-color: var(--block-background-color);
    color: var(--secondary-text-color);
}
blockquote {
    font-size: var(--font-size-mobile);
    padding: 0.75rem;
    font-size: 1.1rem;
    &:not(:last-child) {
        margin-bottom: var(--content-bottom-margin);
    }
}
nav, div.inline-list-container {
    ul li {
        display: inline;
        a {
            display: inline-block;
            padding: 0 0.25rem;

            div {
                display: inline-block;
                width: 1rem;
                height: 1rem;
                border: 1px solid var(--text-color);
                margin-right: 0.25rem;
            }
        }
    }
    ul li:not(:last-child) a:after {
        content: ",";
    }
}
nav + hr {
    margin-top: 1rem;
}
#main-image {
    max-width: min(24rem, 100%);
    height: auto;
    margin-top: 1rem;
}
div#webrings {
    display: flex;
    flex-direction: column;
    align-items: end;

    > p {
        padding: 0 0.25rem;
    }
}
div.post-container, div.page-container, div.project-container {
    article > div {
       display: flex;
       flex-direction: column;
       gap: var(--content-bottom-margin);
       &.reverse {
           flex-direction: column-reverse;
       }
    }
    section.content {
        max-width: var(--content-max-width);
        flex-shrink: 0;

        p {
            text-align: justify;
            > code {
                font-size: 1rem;
            }
            &:not(:last-child) {
                margin-bottom: var(--content-bottom-margin);
            }
        }
        pre {
            font-size: 1rem;
            background-color: var(--block-background-color);
            padding: 0.5rem 1rem;
            color: var(--secondary-text-color);
            margin-bottom: var(--content-bottom-margin);
        }
        ul, ol {
            margin-left: 1.5rem;
            &:not(:last-child) {
                margin-bottom: var(--content-bottom-margin);
            }
        }
        img {
            border: 1px solid black;
            object-fit: cover;
            width: 100%;
            height: auto;
    }
    }
    aside, section.footnotes {
        justify-items: end;
        font-size: var(--font-size-mobile);
        height: fit-content;
        p {
            width: fit-content;
        }
        blockquote {
            font-size: var(--font-size-mobile);
        }
    }
}
div.dim {
    opacity: 40%;
    filter: grayscale();
}
@media (min-width: 768px) {
    body {
        grid-template-columns: 3fr 1fr;
        font-size: var(--font-size-desktop);
        padding: 1rem 1.5rem;
    }
    h1, h2, h3 {
        font-size: var(--font-size-desktop);
    }
    div.post-container, div.page-container, div.project-container {
        article > div {
           display: flex;
           justify-content: space-between;
           flex-direction: row;

           &.reverse {
               flex-direction: row;
           }
        }
        aside, section.footnotes {
            margin-left: 3rem;
            max-width: 480px;
        }
        section.links {
            margin-top: 1rem;
        }
    }
}
