:root {
    --primary-color: #f36f21;
    --dark-background: #1a1a1a;
    --container-width: 1200px;
}

* {
    position: relative;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/*
    utilties
*/
.center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.container {
    margin: 0 auto;
    padding: 0 1rem;
    max-width: var(--container-width);
}

.button {
    display: inline-block;
    padding: .5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
}

.outline.button {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.course-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding-top: 1em;
}

.topics {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topics > .topic {
    flex-shrink: 1;
    width: 150px;
    text-align: center;
    padding: .5rem;
}

.day-selector .item {
    display: inline-block;
    cursor: pointer;
    width: 100px;
    border: 1.5px solid black;
    padding: .5rem;
}

.day-selector[data-day="1"] .item:nth-child(1),
.day-selector[data-day="2"] .item:nth-child(2),
.day-selector[data-day="3"] .item:nth-child(3) {
    border-width: 3px;
    border-color: var(--primary-color);
}

.day-selector[data-day="1"] ~ .table-wrapper:not([data-day="1"]),
.day-selector[data-day="2"] ~ .table-wrapper:not([data-day="2"]),
.day-selector[data-day="3"] ~ .table-wrapper:not([data-day="3"]) {
    display: none;
}

.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    border-radius: 5px;
}

table th,
table td {
    padding: .75rem;
    border: 1px solid var(--primary-color);
}

#course-content table thead tr {
    background-color: var(--primary-color);
}

#course-content table tr td:first-child {
    background-color: var(--primary-color);
    width: 0;
}

#course-content table tr td:last-child {
    width: 0;
}

.feedbacks {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.feedback {
    max-width: 400px;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 1rem;
}

.feedback .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.feedback .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feedback .content {
    padding: .5rem;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, .1);
    text-align: left;
}

.feedback .content .author {
    text-align: right;
}

.feedback .content p {
    margin: 0;
}

.trainer {
    padding: 1em 0;
}

.trainer > h3 {
    text-align: center;
    margin-bottom: .5em;
}

.trainer > p {
    margin: auto;
    width: 72%;
    white-space: pre-line;
}

.organizations {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 1rem;
}

.organization {
    text-align: center;
}

.organization .logo {
    display: inline-flex;
    width: 300px;
    height: 150px;
    border-radius: 5px;
    padding: 1rem 2rem;
    box-shadow: 0 0 5px rgba(0, 0, 0, .1);
}

.organization .logo:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}

.organization .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.avatars {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 1rem;
}

.avatar {
    width: 100px;
}

.avatar img {
    width: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: .5rem;
}

/*
    nav
*/
nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--dark-background);
    width: 100%;
}

nav {
    white-space: nowrap;
    color: white;
}

nav .navbar {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    max-width: var(--container-width);
    margin: auto;
    padding: 1rem;
}

nav .navbar > * {
    display: flex;
    align-items: center;
}

nav .logo a {
    font-size: 1.5em;
    font-weight: bold;
}

nav .menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
}

nav .menu .active {
    color: var(--primary-color);
    font-weight: bold;
}

nav .select {
    display: flex;
    align-items: center;
    justify-content: center;
}

nav .action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

/* 
    header
*/
header {
    display: flex;
    align-items: center;
    background-color: lightgray;

    min-height: calc(100% - 71px);
    padding: 1rem;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/bg.webp');
    background-size: cover;
    background-position: center;
    filter: brightness(.75) blur(1px);
}

header > #header-content {
    display: grid;
    grid-template-columns: 1fr min-content;
    width: var(--container-width);
    margin: auto;
    padding: 1rem;
}

header .header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

header h1 {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 3.5rem;
}

header .info {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    border-radius: 1rem;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

header .info a {
    color: hsl(211, 80%, 60%);
}

/*
    main
*/
main > section {
    padding: 1rem 0;
    text-align: center;
}

main > section:first-child {
    padding-top: 2em;
}

main > section:last-child {
    padding-bottom: 2rem;
}

main > section > * > h2 {
    margin-bottom: 1rem;
}

/*
    footer
*/
footer {
    background-color: var(--dark-background);
    color: white;
    padding: 3rem 0;
    white-space: nowrap;
}

footer .footer {
    display: grid;
    grid-template-columns: minmax(0, 200px) min-content 1fr min-content min-content;
    gap: 20px;
}

footer .footer .logo {
    text-align: center;
    padding-right: 1rem;
}

footer .footer .logo img {
    width: 100%;
}

@media screen and (min-width: 768px) {
    nav .logo a > br {
        display: none;
    }

    br.is-mobile {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    header {
        height: calc(100% - 90px);
    }

    header #header-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        height: 100%;
        padding: .5rem;
    }

    header .header {
        text-align: center;
        justify-content: flex-end;
    }

    header .header h1 {
        margin-bottom: 1em;
    }

    header .info {
        order: -1;
        flex-direction: row;
        padding: 0;
        background-color: transparent;
        color: white;
        white-space: unset;
    }

    header .info > div {
        width: 50%;
    }

    header .info > div:first-child {
        align-self: flex-start;
        text-align: start;
    }

    header .info > div:last-child {
        align-self: flex-start;
        text-align: end;
    }

    nav .logo a {
        font-size: 1.25rem;
    }

    nav .select select {
        display: none;
    }

    footer .footer {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    footer .footer .placeholder {
        display: none;
    }

    footer .footer .placeholder ~ div {
        grid-column: 1 / -1;
    }

    .course-overview {
        padding-top: 0;
        grid-template-columns: 1fr;
    }

    .feedback {
        width: 100%;
    }

    .trainer > p{
        width: 100%;
    }
}