@import "normalize.css";
@import "fonts.css";

:root {
    --accent-color: light-dark(oklch(0.78 33% 200), oklch(0.9 33% 200));
    --background-color: light-dark(oklch(1 0% 360), oklch(0.34 5% 294));
    --blockquote-grey: oklch(0.33 0% 280);
    --font-sans: OpenMoji, Atkinson Hyperlegible Next, ui-sans-serif, sans-serif;
    --font-serif: OpenMoji, Libertinus, ui-serif, serif;
    --font-mono:
        OpenMoji, Fantasque Sans Mono, Atkinson Hyperlegible Mono, Julia Mono, ui-monospace,
        monospace;
    --grey-borders: oklch(0.86 2% 277);
    --slate-text: light-dark(oklch(0.55 1% 251), oklch(0.9 1% 251));
    --text-color: light-dark(oklch(0 0% 360), oklch(1 0% 360));
    color-scheme: light dark;
}

html {
    background-color: var(--background-color);
    height: 100%;
}

body {
    color: var(--text-color);
    container: page / inline-size;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    height: 100%;
    hyphens: auto;
    justify-content: space-between;
    line-height: 1.5;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 100rex;
    padding-left: 2rem;
    padding-right: 2rem;
    text-align: justify;
    word-wrap: break-word;

    & > *:first-child {
        margin-top: 0;
    }
    & > *:last-child {
        margin-bottom: 0;
    }
}

#main {
    margin-top: 2rem;
}

#banner {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    padding-bottom: 0.3em;
    row-gap: 1em;

    #navbar {
        .nav-item {
            font-size: x-large;
            margin-inline: 0.25em;

			&.current-nav {
				font-weight: bold;
			}
        }
    }

    #subtitle {
        font-size: x-large;
        max-width: 28em;
        text-align: left;
    }
    #title {
        font-size: xxx-large;
        a {
            text-decoration: none;
            &:hover,
            &:focus {
                text-decoration: none;
            }
        }
    }
}

#content {
    p {
        min-width: 30ex;
    }
}

#page-footer {
    border-top: 1px solid var(--grey-borders);
    column-gap: 3ex;
    display: flex;
    filter: grayscale(0.25);
    font-size: small;
    justify-content: space-between;
    margin-bottom: 1rem;
    opacity: 0.625;
    padding: 1.5em;
    text-align: left;
}

p {
    margin-bottom: 0.75em;
    margin-top: 0;
}

blockquote {
    margin: 0;
    padding: 0 1em;
    color: var(--blockquote-grey);
    border-left: 0.25em solid var(--grey-borders);

    > :first-child {
        margin-top: 0;
    }

    > :last-child {
        margin-bottom: 0;
    }
}

code,
tt {
    background-color: oklch(from var(--background-color) calc(l - 0.05) c h);
    border-radius: 3px;
    font-family: var(--font-mono);
    margin: 0;
    padding: 0.125em 0.25em;

    br {
        display: none;
    }
    del & {
        text-decoration: inherit;
    }
}

pre {
    border-radius: 3px;
    font-family: var(--font-mono);
    margin-top: 0;
    margin-bottom: 0;
    overflow: auto;
    padding: 0.5em;
    word-wrap: normal;

    code,
    tt {
        background-color: transparent;
        border: 0;
        display: inline;
        max-width: auto;
        overflow: visible;
        padding: 0;
        white-space: pre;
    }
}

a {
    color: var(--accent-color);
    text-decoration: underline dotted;

    &:hover,
    &:focus {
        text-decoration: underline;
    }
    &:not([href]) {
        color: inherit;
        text-decoration: none;
    }
}

hr {
    background-color: var(--grey-borders);
    border: 0;
    height: 0.25rem;
    margin: 2rem 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
    line-height: 1.25;
    margin-bottom: 1rem;
    margin-top: 1.25rem;

    code,
    tt {
        font-size: inherit;
    }
}

h1 {
    border-bottom: 1px solid var(--grey-borders);
    font-size: xx-large;
    padding-bottom: 0.3em;
}
h2 {
    border-bottom: 1px solid var(--grey-borders);
    font-size: x-large;
    padding-bottom: 0.3em;
}
h3 {
    font-size: large;
}
h4 {
    font-size: large;
}
h5 {
    font-size: medium;
}
h6 {
    font-size: medium;
    color: var(--slate-text);
}

ul,
ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 0;
}

ol ol {
    list-style-type: lower-roman;

    ol {
        list-style-type: lower-alpha;
    }
}

li {
    word-wrap: break-all;
    & > p {
        margin-top: 1em;
    }
    & + li {
        margin-top: 0.25rem;
    }
}
dl {
    padding: 0;

    dt {
        font-style: italic;
        font-weight: 600;
        margin-top: 1em;
        padding: 0;
    }

    dd {
        margin-bottom: 1rem;
        margin-left: 0;
        padding: 0 1rem;
    }
}

table {
    display: block;
    overflow: auto;
    width: 100%;

    th {
        font-weight: 600;
    }

    th,
    td {
        border: 1px solid var(--grey-borders);
        padding: 0.5em 1em;
    }
    tr {
        border-top: 1px solid var(--grey-borders);

        &:nth-child(2n) {
            background-color: oklch(from var(--background-color) calc(l - 0.05) c h);
        }
    }
    img {
        background-color: transparent;
    }
}

img {
    box-sizing: content-box;
    max-width: 100%;

    &[align="right"] {
        padding-left: 1.25rem;
    }
    &[align="left"] {
        padding-right: 1.25rem;
    }
}

.inline-badge {
    max-height: 2em;
    vertical-align: middle;
}
