:root {
    --background: #efdecd;
    --text: #222;
    --dark: #3f392a;
    --accent: #193d12;
}

html {
    font-family: Inter, sans-serif;
    background-color: var(--background);
    color: var(--text);
}

h1,
h2,
h3,
legend,
dt {
    font-weight: bold;
    font-style: oblique;
}

dd {
    margin-top: 2px;
}

dt {
    margin-bottom: 2px;
}

nav>ul {
    list-style-type: none;
}

a {
    font-weight: bolder;
    color: var(--accent);
    text-decoration: wavy underline;
}

pre:has(> code),
code {
    background-color: var(--text);
    color: var(--background);
}

pre:has(>code) {
    padding-left: 10px;
    padding-right: 10px;
}

pre code {
    display: block;
    white-space: pre;
}

nav a,
header a,
h1,
h2,
h3,
legend,
dt {
    text-decoration: none;
    color: var(--dark);
}

header {
    text-align: center;
}

nav a:hover,
header a:hover {
    text-decoration: underline;
}

nav {
    text-align: center;
}

nav ul {
    padding-left: 0;
}

footer {
    margin-top: 1em;
    text-align: right;
}

img,
iframe.video {
    max-height: 100%;
    max-width: 100%;
    border: 1px solid var(--text);
}

td.notice {
    text-align: center;
    color: var(--accent);
    font-weight: bolder;
}

#table-div {
    overflow-x: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

#table-div>table {
    width: 100%;
}

#table-div>table .section-dates,
#table-div>table .section-times {
    min-width: 100px;
}

#table-div>table .title {
    min-width: 200px;
}

#table-div>table .description,
#table-div>table .eligibility,
#table-div>table .co-requisites,
#table-div>table .section-eligibility,
#table-div>table .section-notes {
    min-width: 400px;
}

fieldset {
    margin: 0;
    display: flex;
    flex-flow: row wrap;
    flex-wrap: wrap;
    row-gap: 0.5em;
    column-gap: 1em;
    justify-content: stretch;
}

input[type="text"],
input[type="submit"],
input[type="reset"],
input[type="time"],
select,
fieldset {
    border: 1px solid var(--text);
    background: none;
}

input[type="checkbox"] {
    appearance: none;
    height: 1em;
    width: 1em;
    margin: 0;
    background-clip: padding-box;
    border: 2px solid transparent;
    outline: 1px solid var(--text);
}

input[type="checkbox"]:checked {
    background-color: var(--text);
}

table {
    border-collapse: collapse;
}

table,
tr,
th,
td {
    border: 1px solid var(--text);
    padding: 5px 10px;
}

table>thead>tr>th {
    text-decoration: underline;
}

form#search-form {
    display: flex;
    flex-direction: column;
    row-gap: 0.25em;
    border: none;
}

.form-buttons {
    text-align: right;
}

@media (max-width: 1023px) {
    form>div>input[type="text"] {
        box-sizing: border-box;
        width: 100%;
    }

    label {
        margin-top: 5px;
    }
}

@media (min-width: 600px) {
    nav ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-around;
    }
}

@media (min-width: 1024px) {
    header>h1 {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
    }

    nav ul {
        flex-direction: column;
        padding-left: 2em;
    }

    nav {
        text-align: left;
    }

    #wrapper {
        display: grid;
        grid-template-columns: 170px auto;
        grid-template-rows: auto;
        width: 80vw;
        margin: auto;
    }

    #sidebar {
        grid-row: 1/2;
        grid-column: 1;
    }

    main {
        grid-row: 1;
        grid-column: 2;
        max-width: calc(80vw - 200px);
    }

    footer {
        grid-row: 2;
        grid-column: 2;
    }

    form#search-form {
        display: grid;
        grid-template-rows: auto;
        grid-template-columns: 1fr 2fr;
        grid-gap: 5px;
    }

    form#search-form>label {
        grid-column: 1/2;
    }

    form#search-form>select {
        grid-column: 2/3;
    }

    form#search-form>div {
        grid-column: 2/3;
        text-align: right;
    }

    form#search-form>fieldset {
        grid-column: 1/3;
    }
}