@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');


*{
    margin: 0;
    padding: 0;
}

:root{
    --header-height: 8rem;
    --header-padding: 10svw;
    --red: hsl(0, 90%, 40%);
    --mNav: hsl(0, 0%, 20%);
    --white: hsl(0, 0%, 90%);
    font-family: 'Comic Neue', cursive;
}

body{
    background-image: url("../img/Design/site-background.jpg");
    background-position-y: top;
    background-position-x: center;
    background-repeat: no-repeat;
    background-color: hsl(0, 0%, 20%);
    object-fit: cover;
    overflow-x: hidden;
    width: 100svw;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

/* Header */

header{
    margin: 6svh 0rem;
    position: relative;
    display: flex;
    align-items: center;
    width: calc(100svw - (var(--header-padding) * 2));
    padding: 0rem var(--header-padding);
}

header, .logo {
    height: var(--header-height);
}

.logo{
    z-index: 5;
    aspect-ratio: 1/1;
}

.logo>img{
    aspect-ratio: 1/1;
    width: 100%;
}

#login{
    position: absolute;
    right: 0px;
    height: 100%;
    background-color: var(--red);
}

li{
    list-style: none;
    position: relative;
}

ul{
    width: 100%;
    list-style-type: none;
    text-transform: uppercase;
    font-size: 24px;
}

nav{
    position: absolute;
    right: 10svw;
    display: flex;
    flex-grow: 1;
    height: 50%;
    margin: 0px auto;
    justify-content: flex-start;
    width: calc(100svw - (var(--header-padding) * 2) - var(--header-height));
    padding-left: 2rem;
    background-color: hsla(0, 0%, 0%, 0.7);
}

nav ul .submenu-btn ~ li ul{
    display: none;
}

nav ul li:hover
{
    background-color: hsla(0, 0%, 20%, 0.8);
}

nav ul li h2, nav ul li a
{
    color: var(--white);
    font-weight: 300;
    font-size: 24px;
    cursor: pointer;
    padding: 0 2rem;
    text-decoration: none;
}

/* Checkbox og hamburger menu ikon vises ikke på desktop */
nav .menu-btn ~ .menuicon, nav .menu-btn, nav .menu-btn ~ .closeicon
{
    display: none;
}

nav ul
{
    display: flex;
    justify-content:flex-start;
    gap: 1rem;
    height: auto;   
}

nav ul li
{
    display: grid;
    place-items: center;
    padding: 0;
}

nav ul li a
{
    color: var(--white);
}

/* Checkbox og pil ned ikon skal ikke vises i desktop visning */
nav ul li img, nav ul li input
{
    display: none;
}

/* Styling af dropdown menu. Den skal ikke vises (display: none), før man hover over det overliggende menupunkt */
nav ul li ul
{
    display: none;
    position: absolute;
    background-color: hsl(0, 0%, 50%);
    text-transform: none;
    top: 100%;
    left: 0px;
    width: 235px;
    font-size: 20px;
    text-align: left;
}

/* Når brugeren hover over det overliggende menupunkt, skal dropdown menuen vises */
nav ul li:hover ul
{
    display: block;
}

nav ul li ul li
{
    display: block;
    padding: 0 1rem;
}

nav ul li ul li:hover
{
    background-color: hsla(0, 0%, 20%, 0.6);
}

nav ul li ul li:hover a
{
    color: var(--white);
}

nav>ul>li>a{
    height: 100%;
    width: 100%;
    line-height: 270%;
    text-align: center;
}

nav>ul>li ul a{
    height: 3rem;
    width: 100%;
    line-height: 3rem;
    display: inline-block;
}



/* Main*/


main{
    display: grid;
    place-items: center;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    margin-top: calc(6rem -(var(--header-height) + 6svh));
    margin-bottom: 6rem;
}

h1{
    color: var(--white);
    font-size: clamp(2rem, 5vw, 4rem);
}

p{
    display: flex;
    justify-content: center;
    gap: 1svw;
    position: relative;
    height: clamp(1rem, 3vw, 2rem);
    font-size: clamp(1rem, 3vw, 2rem);
    font-weight: 400;
}

p::before, p::after{
    content: '';
    display: inline-block;
    align-self: center;
    background-image: url("../img/Design/dots.png");
    background-repeat: no-repeat;
    width: 72px;
    aspect-ratio: 18/5;
}




/* Footer */


footer{
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: hsla(0, 0%, 0%, 0.8);
    text-transform: uppercase;
    color: var(--white);
}

.lines{
    width: 100%;
    height: 1.5rem;
    background: repeating-linear-gradient(
        -45deg,
        red,
        red 20px,
        white 20px,
        white 40px
      );
}

.cardContainer{
    height: 100%;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 2rem 0rem;
}

.cardContainer>div{
    height: 23.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card{
    display: flex;
    height: 3.5rem;
    width: 17rem;
    gap: 0.5rem;
    padding: 0.6rem;
    background-color: hsla(0, 0%, 0%, 0.6);
    border-right: black solid 0.3rem;
}

.pic{
    aspect-ratio: 1/1;
    height: 100%;
    object-fit: cover;
}

.pic>img{
    aspect-ratio: 1/1;
    width: 100%;
}

.text{
    display: grid;
    flex-grow: 1;
    align-content: center;
}

h3{
    display: flex;
    font-size: 1.5rem;
    line-height: 200%;
}

h3::before{
    content: '';
    display: inline-block;
    aspect-ratio: 2/1;
    width: 5rem;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url("../img/Design/icon-stribes.png");
}

h4{
    font-size: 1.2rem;
}

h6{
    color: hsl(0, 0%, 40%);
    text-transform: capitalize;
    font-size: 1rem;
}

.drivers>.card:nth-of-type(1), .drivers>.card:nth-of-type(2){
    border-color: cyan;
}

.drivers>.card:nth-of-type(3), .drivers>.card:nth-of-type(4){
    border-color: var(--red);
}

.teams>.card:nth-of-type(1){
    border-color: cyan;
}

.teams>.card:nth-of-type(2){
    border-color: var(--red);
}

.teams>.card:nth-of-type(3){
    border-color: white;
}

.teams>.card:nth-of-type(4){
    border-color: hsl(270, 100%, 25%);
}



.track{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background-color: hsla(0, 0%, 0%, 0.6);
    flex-grow: 1;
    padding: 1rem;
    width: 15rem;
}

.trackPic{
    display: grid;
    place-items: center;
    height: 11rem;
    width: 100%;
    object-fit: contain;
    background-color: hsl(0, 0%, 20%);
}

.trackPic>img{
    height: 11rem;
    aspect-ratio: 259/200;
}

.trackText>h4{
    font-size: 1rem;
    margin: 0.5rem 0rem;
}

.trackinfo{
    display: flex;
}
.trackinfo>h6{
    text-transform: uppercase;
    font-size: 0.9rem;
}

.trackinfo>h6:nth-child(1){
    flex-grow: 1;
}


@media (max-width: 920px){

    :root{
        --header-padding: 5svw;
        --header-height: 4rem;
    }

    nav{
        width: calc(100svw - (var(--header-padding) * 2) - var(--header-height) * 1.5);
        padding-left: 3rem;
    }
    nav>ul>li>a{
        height: fit-content;
        line-height: normal;
    }
}


@media (max-width: 768px){
    
    /*Header*/
    
    nav ul li img, nav ul li input
    {
        display: initial;
    }

    #login{
        position: relative;
        right: initial;
        height: initial;
        background-color: var(--red);
    }

    header{
        display: block;
        margin: 0;
        margin-bottom: 2rem;
        padding: 0;
        width: 100svw;
    }

    nav{
        position: sticky;
        background-color: initial;
        margin: initial;
        width: initial;
        padding: 0;
    }

    .logo{
        display: none;
    }
    nav ul
    {
        display: none; /* I mobilvisning skal menuen ikke vises, før brugeren har klikket på hamburger menu ikonet */
        gap: initial;
    }
    nav:has(.menu-btn:checked){
        background-color: var(--mNav);
        height: 50px;
        width: 100%;
        z-index: 2;
    }
    nav .menu-btn:checked ~ ul{
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 50px;
        left: 0px;
        right: 0px;
    }
    nav ul li ul {
        width: 100%;
    }
    nav h2{
        height: 50px;
    }
    nav .menu-btn:checked ~ ul li{
        min-height: 50px;
        display: initial;
        background-color: var(--mNav);
    }
    nav .menu-btn:checked ~ ul li .submenu-btn:checked~ul{
        display: flex;
        flex-direction: column;
        position: relative;
    }
    nav ul li:hover ul{
        display: none;
    }
    nav .submenu-btn
    {
        top: 0;
        right: 0;
        display: block;
        width: 100%;
        height: 50px;
        z-index: 7;
        opacity: 0;
        cursor: pointer;
    }
    nav .submenu-btn, li>img
    {
        position: absolute;
    }
    li>img{
        height: 40px;
        top: 5px;
        right: 10px;
    }
    nav ul li img{
        height: 20px;
    }

    /* Fælles styling for checkbox og menuikoner */
    nav .menu-btn, nav>img
    {
        height: 40px;
        position: absolute;
        top: 5px;
        right: 10px;
    }

    /* Separat styling for checkbox */
    nav .menu-btn
    {
        display: block;
        width: 40px;
        z-index: 7;
        opacity: 0;
        cursor: pointer;
    }

    /* Separat styling for menuikoner */
    nav>img
    {
        z-index: 6;
    }

    /* Hamburger menu ikonen vises som default */
    nav .menu-btn ~ .menuicon, nav .menu-btn:checked ~ .closeicon
    {
        display: block;
    }

    /* Lukke ikonet til menuen skjules som default */
    nav .menu-btn ~ .closeicon, nav .menu-btn:checked ~ .menuicon
    {
        display: none;
    }


    /* Main */

    p::before, p::after{
        display: none;
    }

    /* Footer */

    
}