@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&family=Saira:ital,wght@0,100..900;1,100..900&display=swap');

:root {
   -–f1-red: #e10600;
   --aston-martin: #229971;
   --ferrari: #e8002d;
   --williams: #1868db;
   --mclaren: #ff8000;
   --redbull: #3671c6;
   --bg: #111;
   --info: #ccc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Saira;
    min-height: 100dvh;
    background-color: var(--bg);
}

header {
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    margin-bottom: 4rem;
    background-image: url('../img/design/hero-banner.jpeg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    & h1, h2, h3 {
        margin: 0;
        color: white;
    }
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    width: 100%;
    top: -2.5rem;
    height: 15rem;
}

.menu {
    display: flex;
    width: 92.5vw;
    height: clamp(3rem, 5vw, 3.6rem);
    border-radius: 0.5rem;
    justify-content: space-between;
    background-color: var(--bg);
    box-shadow: 0 0 30px #555;
    &::before, &::after {
        content: '';
        display: block;
        width: 3.6rem;
        height: 100%;
        aspect-ratio: 1;
        background-image: url('../img/design/squares.webp');
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
    }
    &&::before {
        border-radius: 0.5rem 0 0 0.5rem;
    }
    &&::after {
        border-radius: 0 0.5rem 0.5rem 0;
    }
}

.menu__logo {
    aspect-ratio: 1;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    border-radius: 100%;
    border-color: var(--bg);
    border-width: 0.75rem;
    border-style: solid;
    background-color: white;
    z-index: 1;
    & img {
        display: block;
        width: 80%;
    }
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

ul li a {
    text-decoration: none;
}

#menu__state {
    display: none;
}

.menu__button {
    display: none;
}

.menu__items {
    display: flex;
    align-items: center;
    font-weight: 500;
    gap: 3rem;
    z-index: 1;
}

.menu__items li:nth-of-type(2) {
    padding-right: clamp(1rem, 35vw, 32.5rem);
}

.menu__items li a {
    color: white;
}

.titles {
    position: relative;
    margin: 10.5rem 0;
    & h1 {
        position: absolute;
        top: -3.75rem;
        transform: translateX(-50%);
        left: 50%;
        font-size: 5.5rem;
    }
    & h2 {
        display: flex;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        position: absolute;
        top: 2.5rem;
        font-size: 2.5rem;
        &::before, &::after {
            content: '';
            display: block;
            width: 7rem;
            filter: invert();
            height: auto;
            background-image: url('../img/design/dots.png');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }
    }
}

.overview-wrapper {
    display: flex;
    justify-content: center;
    height: 100%;
    position: relative;
    background-color: rgba(0, 0, 0, 87.5%);
    &::before {
        content: '';
        position: absolute;
        display: block;
        width: 100%;
        height: 1rem;
        top: -1rem;
        background-image: url('../img/design/stripes.webp');
        background-size: contain;
        background-position: center;
    }
}

.overview {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
    max-width: 1080px;
    width: 100%;
    & h3 {
        font-size: 1.5rem;
        text-align: left;
    }
}

.overview section {
    display: flex;
    flex-direction: column;
}

.drivers, .teams, .track {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    height: 100%;
}

.driver, .team {
    width: 100%;
    transition: transform .3s;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    border-radius: 0.5rem;
    border-right-width: 5px;
    border-right-style: solid;
    position: relative;
    &:hover {
        transform: translateX(10px)
    }
}

.driver, .team, .track__content {
    background-color: rgba(100, 100, 100, 25%);
}

.driver, .team, .track__content {
    & h4, h5 {
        text-align: left;
        margin: 0;
    }
    & h4 {
        color: white;
    }
    & h5 {
        color: var(--info);
        font-weight: 500;
    }
}

.driver__image, .team__image {
    width: 4rem;
    height: 4rem;
    margin: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    overflow: hidden;
}

.driver__image img {
    width: 100%;
}

.team__image img {
    width: 75%;
}

.driver__info, .team__info, .team__image {
    place-content: center;
}

.driver__info, .team__info {
    padding-right: 1rem;
}

.drivers .driver:nth-of-type(1) {
    border-right-color: var(--aston-martin);
    & .driver__image {
        background-color: #036d72;
    }
}

.drivers .driver:nth-of-type(2) {
    border-right-color: var(--redbull);
    & .driver__image {
        background-color: #444c56;
    }
}

.drivers .driver:nth-of-type(3) {
    border-right-color: var(--mclaren);
    & .driver__image {
        background-color: #feb041;
    }
}

.drivers .driver:nth-of-type(4) {
    border-right-color: var(--ferrari);
    & .driver__image {
        background-color: #b8232b;
    }
}

.drivers .driver:nth-of-type(2) {
    border-right-color: var(--redbull);
    & .driver__image {
        background-color: #444c56;
    }
}

.drivers .driver:nth-of-type(3) {
    border-right-color: var(--mclaren);
    & .driver__image {
        background-color: #feb041;
    }
}

.drivers .driver:nth-of-type(4) {
    border-right-color: var(--ferrari);
    & .driver__image {
        background-color: #b8232b;
    }
}

.teams .team:nth-of-type(1) {
    border-right-color: var(--ferrari);
    & .team__image {
        background-color: var(--ferrari);
    }
}

.teams .team:nth-of-type(2) {
    border-right-color: var(--aston-martin);
    & .team__image {
        background-color: var(--aston-martin);
    }
}

.teams .team:nth-of-type(3) {
    border-right-color: var(--redbull);
    & .team__image {
        background-color: var(--redbull);
    }
}

.teams .team:nth-of-type(4) {
    border-right-color: var(--mclaren);
    & .team__image {
        background-color: var(--mclaren);
    }
}

.track {
    display: flex;
}

.track__content {
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
}

.track__image, .track__info h5:nth-child(even) {
    background-color: rgba(0, 0, 0, 35%);
}

.track__image {
    height: auto;
    aspect-ratio: 3 / 2;
    margin: 0.5rem;
    & img {
        display: block;
        width: 100%;
    }
}

.track__info {
    margin-bottom: .5rem;
    & h4 {
        margin: 0;
        margin-left: 1rem;
    }
    & h5 {
        margin: 0 1.25rem;
        padding-left: 0.25rem;
    }
}

main {
    width: 100%;
}

.newsletter-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.newsletter {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1080px;
    & .form label, h2 {
        color: white;
    }
    & h2 {
        text-align: ce;
        font-size: 2.5rem;
    }
}

.newsletter__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 10rem;
    height: 10rem;
    border-radius: 100%;
    background-color: #e63128;
    & img {
        display: block;
        width: 80%;
    }
}

.newsletter-wrapper, footer {
    background-color: #e10700;
}

.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    width: 75%;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: 1 / -1;
}

.form input, .form textarea {
    padding-left: 1rem;
    color: white;
    border-radius: .5rem;
    border-style: none;
    background-color: black;
}

.form input {
    height: 2rem;
}

.form textarea {
    padding-top: 1rem;
    resize: none;
}

.form button {
    cursor: pointer;
    padding: .75rem;
    font-size: 1rem;
    font-weight: 600;
    border-style: none;
    border-radius: .25rem;
}

.races-wrapper {
    display: flex;
    justify-content: center;
    background-color: var(--bg);
}

.upcoming-races {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 4rem;
    max-width: 1080px;
    width: 100%;
    & h2 {
        font-size: 3rem;
        margin: 0 0 2rem 0;
        color: white;
    }
}

.races__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 10rem;
    height: 10rem;
    margin: 4rem 0 2rem 0;
    border-radius: 100%;
    background-color: #292929;
    & img {
        display: block;
        width: 80%;
    }
}

.races {
    display: grid;
    grid-template-columns: repeat(auto-fit, 240px);
    place-content: center;
    gap: 2rem;
    width: 100%;
}

.race {
    display: flex;
    flex-direction: column;
    aspect-ratio: 1;
    width: 240px;
    /* width: 15rem; */
    /* height: 15rem; */
    position: relative;
    cursor: pointer;
    &:hover {
        & .race__image img {
            filter: brightness(150%);
            transform: scale(1.1);
        }
    }
}

.race__image {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 66%;
    position: relative;
    border-radius: 1rem 1rem 0 0;
}

.race__image img {
    display: block;
    width: 100%;
    object-fit: cover;
    transition: 
        filter .3s,
        transform .3s;
}

.race__date {
    color: white;
    top: .75rem;
    left: .75rem;
    margin: 0;
    font-weight: 400;
    padding: 0.1rem 0.2rem;
    position: absolute;
    border-radius: 0.25rem;
    background-color: black;
}

.race__country {
    top: 142px;
    left: 50%;
    position: absolute;
    border-radius: .25rem;
    border-width: 1px;
    border-style: solid;
    border-color: black;
    transform: translateX(-50%);
}

.race__info {
    height: 33%;
    text-align: center;
    border-radius: 0 0 1rem 1rem;
    background-color: white;
}

.race__description {
    padding: .25rem .25rem 0 .25rem;
    height: 100%;
}

footer {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.footer__content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    justify-content: center;
    gap: 3rem;
    max-width: 1080px;
    width: 100%;
}

.footer__content section {
    text-align: center;
    width: 100%;
    & h3 {
        margin: 0 0 1rem 0;
        color: white;
    }
    & ul {
        display: flex;
        flex-direction: column;

    }
    & li a {
        color: black;
        transition: color .3s;
    }
    & li:not(:last-child) {
        border-bottom: 2px dotted black;
    }
}

.footer__content section li:hover {
    & a {
        color: white;
    }
}

@media (max-width: 768px) {
    .overview {
        justify-items: center;
        grid-template-columns: 1fr;
        margin: 2rem 2rem;
    }


    .menu {
        &::before, &::after {
            width: 0;
        }
    }

    .menu :checked ~ .menu__items {
        transform: translateX(0);
    }

    .menu__items {
        padding-top: 4rem;
        width: 100%;
        height: 472dvh;
        text-align: center;
        background-color: rgba(0, 0, 0, 80%);
        backdrop-filter: blur(10px) saturate(50%);
        position: absolute;
        left: 0;
        z-index: 100;
        top: 10.7rem;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform .3s;
        overflow: hidden;
    }

    .menu__logo {
        width: 7.5rem;
        border: none;
        top: 3.5rem;
        right: 1rem;
        margin: 0;
    }

    .menu {
        width: 100%;
        border-radius: 0;
        position: absolute;
        top: 2.5rem;
        height: 10rem;
        box-shadow: none;
    }

    .titles {
        margin-bottom: 0;
        & h1 {
            margin-top: -6rem;
            font-size: 3.5rem;
        }
        & h2 {
            margin-top: -8rem;
            font-size: 1.75rem;
            &::before, &::after {
                display: none;
            }
        }
    }

    .menu :checked ~ .menu__button {
        background-image: url(../img/close-menu.svg);
        background-size: 3rem;
        display: flex;
    }

    .menu__button {
        position: absolute;
        left: 2rem;
        top: 1.5rem;
        display: inline-block;
        width: 7rem;
        height: 7rem;
        background-color: white;
        border-radius: 100%;
        background-image: url(../img/hamburger-menu.svg);
        background-size: 6rem;
        background-repeat: no-repeat;
        background-position: center;
        cursor: pointer;
    }

    .menu__items li:nth-of-type(2) {
        padding-right: 0;
    }

    .footer__content {
        grid-template-columns: 1fr;
        margin: 0 5rem;
    }
}