@import url('https://cdn.jsdelivr.net/gh/vsalvino/computer-modern@main/fonts/sans.css');
@import url('https://cdn.jsdelivr.net/gh/vsalvino/computer-modern@main/fonts/serif.css');
@import url('https://cdn.jsdelivr.net/gh/vsalvino/computer-modern@main/fonts/bright.css');

@import url('./styles/chevron-left.css');
@import url('./styles/chevron-right.css');
@import url('./styles/calendar.css');

*,
*::before,
*::after {
    font-family: inherit;
    color: inherit;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

img {
    display: block;
}

button,
.button {
    cursor: pointer;
}

a,
.link {
    text-decoration: none;
    color: #a00;

    padding: 0.125rem 2px;
    border-radius: 4px;

    &:hover {
        background-color: #a00;
        color: #fff;
    }
}

h1,
h2,
h3,
h4 {
    font-weight: 400;
    font-family: 'Computer Modern Bright', sans-serif;
}

table {
    margin: 0 auto;

    width: 30rem;
    max-width: 100%;
    border-collapse: collapse;

    th,
    td {
        border: 1px solid #333;
        padding: 0.25rem;
        min-width: 6rem;
    }

    th {
        font-weight: bold;
    }

    @media screen and (max-width: 50rem) {
        width: 100%;
        max-width: auto;

        th,
        td {
            min-width: auto;
        }
    }
}

/* Components */

/* Layout */

body {
    font-family: 'Computer Modern Serif', sans-serif;
    text-rendering: optimizeLegibility;

    font-size: 20px;
    line-height: 1;
    color: #333;
    background-color: #f3f0f0;

    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;

    gap: 8rem;
    padding-bottom: 8rem;

    header {
        user-select: none;

        width: 100%;

        background-color: #a00;
        color: #fff;

        display: grid;
        grid-template-rows: auto auto;

        place-items: center;

        gap: 2rem;

        padding: 6rem 1rem 1.25rem;

        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.125);

        > h1 {
            line-height: 1.125;
            font-family: 'Computer Modern Serif', sans-serif;
            text-align: center;
        }

        nav {
            display: flex;
            justify-content: space-between;

            width: 100%;
            max-width: 64rem;

            .row {
                display: grid;
                grid-auto-flow: column;
                gap: 1rem;
            }

            > .course-navigation {
                display: flex;
                flex-wrap: wrap;
                gap: 1rem;

                > .last {
                    order: 1;
                }
            }
        }

        a,
        .link {
            display: grid;
            place-content: center;

            color: #fff;

            padding: 0.5rem;

            &:hover {
                background-color: #fff;
                color: #a00;
            }

            font-weight: bold;
            font-size: 22px;

            border-radius: 2px;

            &.disabled {
                color: #420000;

                &:hover {
                    background: none;
                }
            }
        }

        h1 > a {
            font-size: 42px;
        }

        @media screen and (max-width: 64rem) {
            gap: 1rem;
            padding: 2rem 1rem 1rem;

            nav {
                flex-direction: column;
                align-items: center;
                gap: 1rem;

                > .course-navigation {
                    justify-content: center;
                }

                a,
                .link {
                    font-size: 18px;
                    padding: 0.25rem;
                }
            }
        }
    }

    main {
        width: 50rem;
        max-width: 100%;

        background-color: #fff;
        border: 4px solid #a00;
        border-radius: 2px;

        padding: 2rem;

        place-self: center;

        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.1);

        /* text-align: justify; */
        hyphens: auto;

        line-height: 1.65;

        > * + * {
            margin-top: 1rem;
        }

        ul {
            list-style: disc;
            padding-left: 2rem;

            li {
                margin-bottom: 1rem;
            }

            li + li {
                margin-top: 1rem;
            }
        }
    }
}

/* Mobile */

@media screen and (max-width: 50rem) {
    table {
        font-size: 15px;
        line-height: 1.25;
    }

    body {
        gap: 3rem;
        padding-bottom: 3rem;

        > main {
            width: calc(100vw - 2rem);
            padding: 1rem;
        }
    }
}
