:root {
    --background-color: #f2f2f2;
    --primary-color: #00354e;
    --secondary-color: #e55d3e;
    --tertiery-color: #31b7bc;

    --font-family: "IBM Plex Sans";
}

html {
    font-size: 1rem;
    line-height: 1.7;
    font-family: var(--font-family),
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
    accent-color: var(--primary-color);
}

@media (max-width: 500px) {
    html {
        font-size: 1rem;
    }

    main > article > .slide  {
        padding: 2rem;
    }

    .row {
        flex-wrap: wrap;
    }
}

body {
    margin: 0;
    color: var(--primary-color);

    overflow: hidden;
    background-color: var(--background-color);
}

span {

    color: var(--primary-color);
}

article {
    display: block;
    /* scroll-snap-type: y proximity; */
    scroll-snap-type: y mandatory;
    overflow: scroll;
    height: 100vh;

    &.reader-mode {
        scroll-snap-type: none;
        max-width: min(80ch, 100vw);
        margin: 0 auto;

        .slide {
            min-height: unset;
            padding: 4rem 1rem;
        }
    }

    .slide {
        /*display: block;*/
        min-height: 100vh;
        padding: 4rem;
        box-sizing: border-box;
        scroll-snap-align: start;
        position: relative;

        &.fs-img {
            padding: 0;

            img {
                max-height: 100vh;
                margin: auto;
                display: block;
            }
        }



        &::after {
            content: " ";
            width: 1rem;
            border-bottom: 0.08rem solid #5003;
            position: absolute;
            bottom: 0;
            left: 0;
        }

        &#title {
            display: flex;
            justify-content: center;
            align-items: center;

            > hgroup {
                text-align: center;
            }
        }

        &.section {
            display: flex;
            flex-direction: column;
            justify-content: end;
        }

        &.center {
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        footer,
        header {
            position: absolute;
            bottom: 0;
            left: 0;
            width: calc(100% - 3rem);
            padding: 1rem 1.5rem;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem 2rem;

            p {
                font-size: 1.3rem;
            }
        }

        header {
            top: 0;
            bottom: unset;
        }
    }
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
details,
summary,
td,
pre,
code {
    margin: 0;
    margin-top: 1em;
    color: var(--primary-color);
    line-height: 1.3;
}

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

.mt-0 {
    margin-top: 0;
}

pre {
    line-height: 1.7;
    overflow-y: scroll;
}

code, pre {
    background-color: #e4e4e4;
    border-radius: .3rem;
    padding: 0 .5ch;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

.hidden {
    visibility: hidden;
    height: 0;
}

table {
    margin-top: 1rem;

    td {
        vertical-align: top;
        padding-right: 2rem;
    }
}

:where(h1, h2, h3, h4, h5, h6):first-child {
    margin-top: 0;
}

p, li {
    font-size: 1.2rem;
}

blockquote {
    margin: 0;

    > p {
        font-size: 1.5rem;
        line-height: 1.3;
        font-weight: normal;
    }

    > p:last-child:not(:first-child) {
        font-size: 1rem;
    }
}

blockquote details {
    border: 1px solid grey;
    border-radius: 1rem;
    padding: 1rem;

    summary {
        margin-top: 0;
        border-bottom: 1px solid grey;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
}

img {
    max-height: calc(100vh - 8rem);
    max-width: 100%;
    display: block;

    &.small {
        height: 2rem;
    }

    &.large {
        height: 100%;
        width: auto;
        position: relative;
        margin: 0 auto;
    }
}

.row,
.col {
    display: flex;
    max-width: 100%;
    gap: 2rem;
}

.col {
    flex-direction: column;
}

.align-end {
    align-items: end;
}

.space-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

a {
    color: var(--primary-color);
    text-decoration-thickness: 0.2rem;
    text-decoration-color: var(--secondary-color);

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

hr {
    width: 100%;
    border: none;
    border-bottom: solid 0.4rem var(--secondary-color);

    &.secondary {
        height: 0.4rem;
        border-bottom-width: 0.2rem;
        border-top: solid 0.2rem var(--secondary-color);
        border-color: var(--tertiery-color);
    }
}

.emoji-large {
    text-align: center;
    font-size: 8rem;
    margin: 0;
}

.red {
    color: #C53A1B;
}

ul.no-deco {
    list-style-type: none;
    padding-left: 1ch;
}


.low-contrast {
    color: grey;
}

img.inline-small {
    display: inline-block;
    height: 1rem;
}

.inline {
    display: inline;
}


meter {
    width: 100%;
    height: 2rem;
}