:root {
    color-scheme: light dark;
    --background-color: #ffffff;
    --text-color: #111111;
    --accent-color: #0000ee;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --text-color: #eeeeee;
        --accent-color: #4da6ff;
    }
}

html {
    height: 100%;
    min-height: 100%;
    scrollbar-gutter: stable both-edges;
}

body {
    width: 100%;
    max-width: 60%;
    margin: 0 auto;
    height: 100%;
    min-height: 100%;

    display: flex;
    flex-direction: column;

    background-color: var(--background-color);
    color: var(--text-color);
    transition:
        background-color 0.3s,
        color 0.3s;
}

#header-visible {
    visibility: visible;
    pointer-events: auto;
}

#header-invisible {
    visibility: hidden;
    pointer-events: none;
}

nav {
    text-align: center;
    font-family: "Courier New", Courier, monospace;
    font-size: large;
    margin-bottom: 0.25em;
}

#headertext-container {
    margin-top: 2%;
    margin-bottom: 2%;
    text-align: center;
    font-family: "Courier New", Courier, monospace;
    font-size: xx-large;
    font-weight: bold;
}

#headertext {
    user-select: none;
    color: var(--text-color);
    text-decoration-line: none;
}

img {
    max-width: 75%;
    height: auto;
    display: block;
    margin: 0 auto;
}

figure {
    font-size: small;
    text-align: center;
}

sup {
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
}

main {
    font-family: "Times New Roman", Times, serif;
    flex: 1 0 auto;
}

h1 {
    font-family: "Courier New", Courier, monospace;
}

h2 {
    font-family: "Courier New", Courier, monospace;
}

h3 {
    font-family: "Courier New", Courier, monospace;
}

#tagcontainer {
    margin-top: -1em;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
}

ol,
ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footnote p {
    margin: 0;
}

.footnote-backref {
    text-decoration: none;
}

li {
    margin-right: 2%;
    line-height: 1.5;
}

p {
    line-height: 1.5;
}

article p {
    margin-left: 2%;
    margin-right: 2%;
}

footer {
    text-align: center;
    color: darkgray;
    font-size: small;
    flex-shrink: 0;
}

a {
    color: var(--accent-color);
    overflow-wrap: break-word;
}

@media screen and (max-width: 768px) {
    body {
        width: 96%;
        max-width: 96%;
        margin: 0 auto;
        padding-left: 2%;
        padding-right: 2%;
    }

    img {
        max-width: 100%;
    }

    #header-invisible {
        visibility: visible;
        pointer-events: auto;
    }

    #homepage-header {
        display: none;
    }
}
