:root {
    color-scheme: light dark;
    --font-size: 1rem;
    --font-size-bigger: calc(1.5 * var(--font-size));
    --font-size-big: calc(1.3 * var(--font-size));
    --font-size-small: calc(0.8 * var(--font-size));
    --font-size-code: 1rem;
    --description_fg: light-dark(#848484, #848484);
    --code_fg: light-dark(#E0E0E0, #E0E0E0);
    --code_bg: light-dark(#454961, #2A2C3F);
    --link: light-dark(#6A1B9A, #BB9AF7);
    --heading_fg_h1: light-dark(#6B8DBE, #5A94C3);
    --heading_fg_h2: light-dark(#D5A128, #D65A31);
    --heading_fg_h3: light-dark(#29A873, #9ECE6A);
    --nav: light-dark(#000, #FFF);
    --text_bg: light-dark(#EFEDE9, #222233);
    --text_fg: light-dark(#4C4C4C, #D4BE98);
}

header {
    display: flex;
    border-bottom: 1px solid var(--text_fg);
    justify-content: space-between;
    margin: 0 0 20px 0;
}

.list-description {
    display: flex;
    color: var(--description_fg);
    font-style: italic;
    margin: 0 0 1rem 0;
}

.list-date-line {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
}

.list-date-line h4 {
    margin: 0 1rem;
    flex-shrink: 0;
}

.list-date-line span {
    flex-grow: 1;
    height: 1px;
    border-top: 2px dotted var(--heading_fg_h2);
}

body {
    color: var(--text_fg);
    background-color: var(--text_bg);
    font-size: var(--font-size);
    font-family: SauceCodePro, monospace;
    margin: auto;
    padding: 20px;
    max-width: 800px;
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

footer {
    padding: 25px;
    text-align: center;
}

nav a {
    font-size: var(--font-size);
    color: var(--nav);
    margin: 0 5px 0 5px;
    text-decoration: none;
}

time {
    font-weight: 350;
}

a {
    color: var(--text_fg);
    text-decoration: 1.5px underline var(--link);
}

a[rel="external"]:not(:has(img))::after {
    content: "\00A0↗";
    font-family: 'https://fontawesome.com/search?q=externalont Awesome 5 Free';
    font-weight: 600;
    margin-left: -5px;
}

.title {
    font-size: var(--font-size-big);
    font-weight: 600;
    text-decoration: none;
}

.title_wood {
    font-size: var(--font-size-bigger);
    font-weight: 600;
    text-align: center;
    margin: 0 auto 0 auto;
    text-decoration: none;
}

topic {
    display: flow;
    text-align: center;
    border: 1px dashed var(--text_fg);
    padding: 10px;
    margin-bottom: 2rem;
}

h1 {
    font-size: var(--font-size-bigger);
    color: var(--heading_fg_h1);
    margin-bottom: -1em;
}

h2::before {
    content: "╭── "
}

h3::before {
    content: "🢖"
}

h2 {
    font-size: var(--font-size-big);
    color: var(--heading_fg_h2);
    margin-left: -.2em;
}


h3 {
    font-size: var(--font-size-big);
    margin-left: 2.5em;
    font-weight: 600;
    color: var(--heading_fg_h3);
}

h4 {
    font-size: var(--font-size-big);
}

h5,
.title:hover {
    text-decoration: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* align: center; */
}

td,
th {
    border-bottom: 1px solid var(--text_fg);
    padding: .2em .2em;
    text-align: left;
}

pre {
    overflow: auto;
    overflow-wrap: normal;
    scrollbar-color: var(--heading_fg_h2) transparent;
}

code,
.copy_pre,
pre {
    font-size: var(--font-size-code);
    color: var(--code_fg);
    background-color: var(--code_bg) !important;
}

p code,
.copy_pre {
    padding: 0.1em 0.2em;
    border-radius: 4px;
}

code {
    padding: 0 0.3rem 0 0.3rem;
}

code span {
    padding-left: 0.5em;
}

img {
    max-width: 100%;
    display: block;
    margin: 2rem auto;
}

/* Why a figcaption class when there are regular figcaption elements? */
.figcaption {
    font-size: var(--font-size);
    margin-top: -2em;
}

.mastodon-comment-content {
    margin: 0 0 4em 0;
}

.copy_pre {
    border: none;
    font-weight: 500;
}

.pre_banner {
    display: flex;
    justify-content: space-between;
    flex-direction: row-reverse;
    margin: -0.5rem 0 -0.7rem 0;
    min-height: 1.5rem;
}


.blog-posts a {
    color: var(--text_fg);
    text-decoration: none;

    &:visited {
        color: var(--text_fg);
    }
}

.blog-posts {
    list-style-type: none;
    padding: unset;

    li {
        display: flex;

        span {
            flex: 0 0 130px;
        }
    }
}

.post-series-bottom {
    margin-top: 4rem;
}

.alert {
    display: flex;
    margin-bottom: 1rem;
    gap: 0.5rem;

    .alert__body {
        flex-grow: 1;

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

    &.alert--tip {
        color: var(--text_fg);
        border: 2px dashed;
    }

    &.alert--ok {
        color: #FFF;
        background-color: #2E7D32;
        font-weight: 600;
    }

    &.alert--warn {
        background-color: #D5A128;
        font-weight: 600;
    }

    &.alert--err {
        color: #FFF;
        background-color: #D32F2F;
        font-weight: 600;
    }

    &.alert--small {
        padding: 0.5rem 1rem;
        font-size: 0.88rem;
    }
}

.icon {
    display: flex;
    width: 24px;
    height: 24px;

    /* I have a feeling these do not need to be nested */
    &.icon--tip path {
        fill: #0085FD;
    }

    &.icon--ok path {
        fill: #FFF;
    }

    &.icon--warn path {
        fill: var(--text_fg);
    }

    &.icon--err path {
        fill: #FFF;
    }

    &.icon--current path {
        fill: currentColor;
    }

    &.icon--large {
        width: 32px;
        height: 32px;
    }

    &.icon--medium {
        width: 24px;
        height: 24px;
    }

    &.icon--small {
        width: 20px;
        height: 20px;
    }
}

.tabpane {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tabpane__input {
    position: absolute;
    opacity: 0;
}

.tabpane__label {
    position: relative;
    flex-shrink: 1;
    padding: 0.5rem 1rem;
    background-color: var(--text_bg);
    border: solid 2px var(--text_fg);
    border-left-width: 1px;
    border-right-width: 1px;
    border-bottom: none;
    cursor: pointer;
    z-index: 999;

    &:first-of-type {
        border-top-left-radius: 0.5rem;
        border-left-width: 2px;
    }

    &:last-of-type {
        border-top-right-radius: 0.5rem;
        border-right-width: 2px;
    }
}

.tabpane__panel {
    order: 999;
    display: none;
    width: 100%;
    margin-top: -2px;
    padding: 1rem;
    border: solid 2px var(--text_fg);
}

.tabpane__input:checked+.tabpane__label {
    background-color: var(--heading_fg_h2);
    font-weight: 700;
}

.tabpane__input:checked+.tabpane__label+.tabpane__panel {
    display: block;
}
