html {
    scroll-behavior: smooth;
}

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    line-height: 1.4rem;
    font-size: small;
}
/* skip to main */
.skip {
    position: absolute;
    top: -40px;
}

.skip:focus {
    position: relative;
    top: 0px;
}

*:focus {
    border: 4px solid white;
}

/* header */
header {
    background-color: #00274C;
}

header img {
    display: block;
    width: 90%;
    padding: 5% 0;
    margin: auto;
}

/* nav bar */
nav ul {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    background-color: #00274C;
}

nav .nav-item {
    flex-grow: 1;
    padding: 3% 0;
    border-radius: 10px 10px 0 0;
    text-align: center;
}

nav .nav-item a {
    font-size: 120%;
    font-weight: 600;
    color: #FFCB05;
    text-decoration: none;
}

nav .active {
    background-color: #FFCB05;
}

nav .active a{
    text-decoration: underline;
    text-underline-offset: 20%;
    text-decoration-thickness: 13%;
    color: #00274C;
}

/* hide dropdown in mobile view */
.dropdown {
    display: none;
}

/* h1 */
h1 {
    font-size: 220%;
    font-weight: 700;
    color: #00274C;
    padding: 3%;
    background-color: #FFCB05;
    text-align: center;
    line-height: 2rem;
}

/* main */
main {
    background-color: #FFCB05;
    padding-bottom: 3%;
}

/* overview */
.overview {
    background-color: #00274C;
    color: white;
    padding-bottom: 5%;
}

.overview img {
    display: block;
    width: 100%;
    /* https://developer.apple.com/library/archive/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Masks/Masks.html */
    -webkit-mask-box-image:
        -webkit-linear-gradient(
            top, transparent 0%, #00274C 40%, #00274C 60%, transparent 100%);
}

h2 {
    font-size: 200%;
    font-weight: 600;
    line-height: 2rem;
}

.overview h2 {
    margin: 3%;
    text-align: center;
}

.overview p {
    text-align: center;
    margin: 3% 13% 0 13%;
    font-size: 120%;
    line-height: 1.5rem;
}

.overview ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 5% 10%;
}

.overview li {
    border-radius: 50px;
    padding: 2%;
    text-align: center;
    background-color: #2F65A7;
    border: 1px solid white;
    font-size: 120%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overview a {
    text-decoration: none;
    color: white;
    font-weight: 600;
}

/* contents */
.contents article {
    background-color: #edecec;
    border: 2px solid #00274C;
    border-radius: 15px;
    box-shadow: 10px 10px 5px gray;
    padding: 3% 5%;
    margin: 5%;
}

.contents h2 {
    font-size: 250%;
    font-weight: 600;
    line-height: 2rem;
    text-align: center;
    padding-top: 3%;
}

h3 {
    font-size: 180%;
    font-weight: 600;
    line-height: 2rem;
}

.contents p {
    font-weight: 500;
    font-size: 130%;
    line-height: 2rem;
    margin: 3%;
}

.contents ul {
    margin: 3%;
    list-style: none;
}

.contents li {
    border-bottom: 1px solid gray;
    margin: 3%;
    font-weight: 500;
    font-size: 130%;
    line-height: 2rem;
}

.contents img {
    width: 90%;
    display: block;
    border: 4px solid black;
    border-radius: 20px;
    margin: 3% auto;
}

.contents a {
    font-weight: 600;
    color: #00274C;
}

/* outro */
.outro img {
    display: block;
    width: 100%;
    -webkit-mask-box-image:
        -webkit-linear-gradient(
            top, transparent 0%, #FFCB05 20%, #FFCB05 80%, transparent 100%);
}

.outro h3 {
    font-weight: 600;
    font-size: 180%;
    line-height: 2rem;
    display: block;
    text-align: center;
    color: #00274C;
    padding-bottom: 3%;
}

.outro p {
    font-weight: 500;
    font-size: 130%;
    line-height: 2rem;
    display: block;
    text-align: center;
    padding: 3%;
    color: #00274C;
}

/* footer */
footer {
    background-color: #00274C;
    padding: 10%;
    color: white;
    text-align: center;
    line-height: 2rem;
}

footer img {
    border: 2px solid white;
    display: block;
    margin: auto;
    width: 50%;
}

footer h3 {
    border-bottom: 2px solid white;
    margin: 0 20%;
    padding-bottom: 3%;
}

footer p {
    margin: 5% auto;
    font-weight: 500;
    font-size: 130%;
    line-height: 2rem;
}

footer a {
    color: white;
}

/* 404 style */
.error {
    padding: 5%;
    color: #00274C;
    text-align: center;
}

.error h2 {
    font-size: 220%;
}

.error p {
    padding-top: 5%;
    font-size: 180%;
    line-height: 3rem;
}

.error a {
    font-weight: 700;
    color: #00274C;
}

.error a:hover {
    border: 3px solid #00274C;
}

.button {
    display: inline-block;
    background-color: #00274C;
    padding: 15px 30px;
    margin: 5%;
    border-radius: 50px;
}

.button a {
    color: white;
    font-size: 180%;
    text-decoration: none;
}

.button a:hover {
    border: 3px solid white;
}

@media only screen and (min-width: 1200px) {
    /* header layout */
    header {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
    }

    /* logo */
    header img {
        grid-area: 1/1/2/4;
        max-width: 400px;
        margin-left: 5%;
        padding: 2% 0 2% 0;
    }

    header nav {
        grid-area: 1/4/2/7;
        display: flex;
    }

    /* navigation */
    header nav ul {
        flex-grow: 1;
        align-items: center;
    }

    nav .nav-item a {
        color: white;
        font-size: 180%;
        font-weight: 550;
    }

    nav .nav-item a:hover {
        border: 3px solid white;
    }

    nav .nav-item {
        border-right: 3px solid white;
        border-radius: 0;
        padding: 0;
    }

    nav .active {
        background-color: #00274C;
    }

    /* show dropdown menu when hove */
    li.nav-item {
        position: relative;
        padding: 2% 0;
    }

    li.nav-item:hover .dropdown {
        position: absolute;
        display: flex;
        flex-flow: wrap column;
        align-items: stretch;
        right: 0;
        top: 100%;
        width: 100%;
        background-color: white;
        /* the line below is from: https://www.w3schools.com/css/css3_shadows_box.asp */
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
        border: 2px solid #00274C;
    }

    .dropdown li {
        display: block;
        padding: 10% 0;
        border-bottom: 2px solid #00274C;
    }

    .dropdown li a {
        color: #00274C;
        font-size: 120%;
    }

    .dropdown li a:hover {
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    /* h1 */
    header h1 {
        grid-area: 2/1/3/7;
        padding: 2%;
        font-size: 380%;
        font-weight: 550;
    }

    /* overview */
    .overview {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding-bottom: 0;
        align-items: center;
    }

    .overview img {
        grid-area: 1/1/2/2;
        -webkit-mask-box-image: -webkit-linear-gradient(left, transparent 0%, #00274C 40%, #00274C 60%, transparent 100%);
    }

    .overview h2 {
        font-size: 250%;
        font-weight: 550;
        line-height: 3rem;
        margin: 3% 0 0 0;
    }

    .overview p {
        font-size: 150%;
        margin: 3% 8% 3% 8%;
        line-height: 2rem;
    }

    .overview a:hover {
        border: 2px solid white;
    }

    /* contents for home */
    #home {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    #home h2 {
        grid-column: 1/3;
    }

    #home article {
        display: block;
    }

    /* home outro */
    .outro {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        padding-top: 5%;
    }

    .outro img {
        grid-area: 1/4/3/6;
        -webkit-mask-box-image:
        -webkit-linear-gradient(
            left, transparent 0%, #FFCB05 20%, #FFCB05 80%, transparent 100%);
    }

    .outro h3, .outro p {
        grid-column: 2/4;
    }

    .outro h3 {
        display: grid;
        align-items: end;
    }

    /* contents for community, support, and health pages */
    .contents article {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
    }

    .contents article h3 {
        grid-column: 1/4;
    }

    .contents article img {
        grid-column: 1/2;
    }

    .contents article p {
        grid-column: 2/4;
    }

    /* footer */
    footer {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        padding: 3%;
        align-items: center;
    }

    footer img {
        grid-area: 1/1/4/2;
    }

    footer p:first-of-type {
        grid-area: 4/1/5/2;
        margin: 5% 1%;
    }

    footer p, footer h3 {
        grid-column: 2/4;
        margin: 1% 1% 1% 40%;
    }
}