/* Makes padding and borders part of an element's total size. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: rgb(60, 38, 54);
    background-color: rgb(255, 248, 239);
    font-family: Arial, Helvetica, sans-serif;
}

header {
    color: white;
    background-color: rgb(234, 48, 96);
}

header > p:first-child, header nav {
    display: inline-block;
    vertical-align: middle;
}

header > p:first-child {
    width: 45%;
    margin: 0;
    padding: 18px 0 18px 16%;
    font-weight: bold;
    text-transform: uppercase;
}

header nav {
    width: 38%;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

nav li:last-child a {
    padding: 10px 20px;
    color: rgb(60, 38, 54);
    background-color: rgb(255, 207, 49);
    border-radius: 22px;
}

header > p:last-child {
    margin: 0;
    padding: 10px 20px;
    color: rgb(60, 38, 54);
    background-color: rgb(255, 207, 49);
    text-align: center;
}

/* Creates the hero image with a dark overlay so the text remains readable. */

main > section:first-child {
    padding: 70px 16%;
    min-height: 435px;
    color: rgb(255, 255, 255);
    background-image:
        linear-gradient(rgba(80, 18, 48, 0.72), rgba(80, 18, 48, 0.72)),
        url("../img/water-ice.jpg");
    background-size: cover;
    background-position: center 65%;
}

/* Keeps the header content on one row. */

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

header > p:first-child {
    width: auto;
    flex: 1;
}

header nav {
    width: auto;
    padding-right: 16%;
}

nav ul {
    flex-wrap: nowrap;
}

header > p:last-child {
    flex-basis: 100%;
}


/* Styles the main hero content. */

main > section:first-child h1 {
    max-width: 620px;
    margin: 28px 0 16px;
    font-size: 44px;
}

main > section:first-child > p {
    max-width: 570px;
    line-height: 1.5;
}

main > section:first-child > a {
    display: inline-block;
    margin: 12px 8px 12px 0;
    padding: 12px 20px;
    color: white;
    border: 2px solid white;
    border-radius: 24px;
    font-weight: bold;
    text-decoration: none;
}

main > section:first-child > a:first-of-type {
    color: rgb(60, 38, 54);
    border-color: rgb(255, 207, 49);
    background-color: rgb(255, 207, 49);
}


/* Creates the flavor-board layout. */

#flavors {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 65px 16%;
}

#flavors > h2, #flavors > p {
    flex-basis: 100%;
}

#flavors > h2 {
    max-width: 500px;
    margin: 8px 0;
    font-size: 34px;
}

#flavors > section {
    flex: 0 1 calc(25% - 12px);
    min-height: 150px;
    padding: 18px;
    border-top: 5px solid rgb(234, 48, 96);
    border-radius: 10px;
    background-color: white;
}

/* :nth-of-type selects a card according to its position, allowing each flavor to receive a different top-border color. */

#flavors > section:nth-of-type(2) {
    border-color: rgb(255, 207, 49);
}

#flavors > section:nth-of-type(3) {
    border-color: rgb(60, 165, 219);
}

#flavors > section:nth-of-type(4) {
    border-color: rgb(255, 145, 65);
}

#flavors > section:nth-of-type(5) {
    border-color: rgb(196, 116, 223);
}

#flavors h3, #flavors section p {
    margin: 0 0 12px;
}

#flavors > p:last-child {
    margin-top: 20px;
    text-align: center;
}

/* Highlights the changing weekly flavor like a small yellow label. */

#flavors > p:last-child strong {
    padding: 4px 7px;
    color: rgb(60, 38, 54);
    background-color: rgb(255, 207, 49);
    border-radius: 4px;
}

/* Creates the blue sizes section and cup cards. */

#sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 65px 16%;
    background-color: rgb(190, 229, 244);
}

#sizes > h2, #sizes > p {
    flex-basis: 100%;
}

#sizes > h2 {
    margin: 8px 0 20px;
    font-size: 34px;
}

#sizes > section {
    flex: 1;
    min-height: 145px;
    padding: 18px 12px;
    border-radius: 10px;
    background-color: white;
    text-align: center;
}

#sizes h3, #sizes section p {
    margin: 0 0 14px;
}

#sizes > section p:first-of-type {
    color: rgb(234, 48, 96);
    font-size: 22px;
    font-weight: bold;
}

#sizes > p:last-child {
    margin-top: 10px;
    text-align: center;
}


/* Creates the three stand-information cards. */

#stand {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 65px 16%;
}

#stand > h2, #stand > p {
    flex-basis: 100%;
}

/* #stand > h2 {
    max-width: 560px;
    margin: 8px 0 20px;
    font-size: 34px;
} */

/* The heading needs the entire row so all three information cards begin together on the next row. */

#stand > h2 {
    flex-basis: 100%;
    max-width: none;
    margin: 8px 0 20px;
    font-size: 34px;
}

#stand > section {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    background-color: white;
}

#stand h3 {
    margin-top: 0;
    color: rgb(210, 38, 81);
}

#stand address {
    font-style: normal;
}

#stand a {
    color: rgb(210, 38, 81);
    font-weight: bold;
}


/* Creates the dark footer. */

footer {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 38px 16%;
    color: white;
    background-color: rgb(60, 38, 54);
}

footer > section {
    flex: 1;
}

footer h3, footer p {
    margin: 0 0 12px;
}

footer address {
    font-style: normal;
}

footer a {
    color: white;
}

footer > p {
    flex-basis: 60%;
    padding-top: 18px;
    border-top: 1px solid rgb(104, 78, 97);
}

footer > a {
    margin-left: auto;
    padding-top: 18px;
}

