@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    --nav-primary: 195, 84%, 15%;
    --nav-height: 60px;

    --nav-text-color: 190, 5%, 94%;
    --red: 345, 100%, 38%;

    --background-color: 0, 0%, 93%;
}

body{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100svh;
    overflow-x: hidden;
    font-family: 'Open Sans', sans-serif;
    background-color: hsl(var(--background-color));
}

/* Header */

header{
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 5;
}

nav{
    position: relative;
    width: 100%;
    height: 100%;
    color: hsl(var(--nav-text-color));
}


/* Creates a top bar for the nav */
nav::before{
    content: "";
    display: block;
    width: 100%;
    height: 100%;  
    background-color: hsl(var(--nav-primary));  
}
nav::after{
    position: absolute;
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    bottom: 0;
    background-color: hsla(0, 0%, 100%, 0.1);
}

/* Click animation and style for the hamburger menu */
nav .hamburger{
    position: absolute;
    top: 0rem;
    right: 0.5rem;
    aspect-ratio: 10/14;
    height: 100%;
    will-change: transform;
    transform: rotate(0deg);
    transition: transform 0.5s ease-in-out;
}

nav .hamburger.active{
    transform: rotate(-360deg);
}

nav .hamburger>svg{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease-in-out;
}

/* Display the right menu items when the hamburger is clicked */
nav .hamburger>svg:nth-child(1){ opacity: 1;}
nav .hamburger.active>svg:nth-child(1){ opacity: 0;}
nav .hamburger>svg:nth-child(2){ opacity: 0;}
nav .hamburger.active>svg:nth-child(2){ opacity: 1;}

nav .hamburger, nav li{
    cursor: pointer;
}

nav ul{
    position: absolute;
    display: flex;
    flex-direction: column;
    list-style: none;
    opacity: 0;
}

/* Slide Effect for the nav menu */
nav ul, nav::before{
    will-change: transform;
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);
}

nav .hamburger.active+ul,nav h5.active+ul, nav:has(.hamburger.active)::before{
    transform: translateX(0%);
}

/* Side-step effect for undermenus */
nav li{
    padding-left: 1rem;
    font-size: 1.5rem;
}

nav li h5.active+ul, nav .hamburger+ul{
    position: relative;
    opacity: 1;
}

nav li>h5,nav li:not(:has(h5)), li#login{
    position: relative;
    height: 3rem;
    width: 100%;
    display: flex;
    align-items: center;
}

nav li>h5, nav li:not(:has(h5)), nav>ul li:not(:has(h5))>a{
    color: hsl(var(--nav-text-color));
    text-decoration: none;
    font-weight: 600;
}

nav li:not(:last-child){
    position: relative;
}

nav li:not(:last-child)::after{
    position: absolute;
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    bottom: 0;
    background-color: hsla(0, 0%, 100%, 0.1);
}


/* Login Button */
li#login{
    cursor: pointer;
    background-color: hsl(var(--red));
}

li#login button{
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    color: hsl(var(--nav-text-color));
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    font-size: 1rem;
    cursor: pointer;
}

/* Icon popin animation */
nav>ul:first-of-type>li:not(:has(h5))>a::before{    
    --transition-time: 0.425s;
    --size: 1.25rem;
    --minus-size: calc(var(--size) * -1);
    content: '';
    display: inline-block;
    width: var(--size);
    height: var(--size);
    background-image: url('https://img.icons8.com/ios-filled/50/ffffff/chevron-right.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    transform: scale(0);
    margin-right: var(--minus-size);
    opacity: 0;
    transition: transform var(--transition-time) ease-out, margin-right var(--transition-time) ease-out, opacity var(--transition-time) ease-out;
}

/* Icon background */
nav>ul:first-of-type>li:not(:has(h5))>a[href="#home"]::before{
    background-image: url(../Materialer/ic_home_white_24px.svg);
}
nav>ul:first-of-type>li:not(:has(h5))>a[href="#forhandlere"]::before{
    background-image: url(../Materialer/ic_directions_car_white_24px.svg);
}
nav>ul:first-of-type>li:not(:has(h5))>a[href="#priser"]::before{
    background-image: url(../Materialer/ic_euro_symbol_white_24px.svg);
}
nav>ul:first-of-type>li:not(:has(h5))>a[href="#events"]::before{
    background-image: url(../Materialer/ic_event_white_24px.svg);
}
nav>ul:first-of-type>li:not(:has(h5))>a[href="#members"]::before{
    background-image: url(../Materialer/ic_person_white_24px.svg);
}

main{
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

/* Content container ither 90% or 1280px */
.container{
    display: flex;
    flex-direction: column;
    width: min(90%, 1280px);
}

footer .container{
    flex-direction: row;
}

section.nissan{
    position: relative;
    padding: 6rem 0rem;
    padding-bottom: 20rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    
}

section.nissan::before{
    content: "";
    position: absolute;
    top: 0;
    width: 100svw;
    height: 100%;
    background-image: url(../Materialer/large-nissan-leaf-bg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -1;
}

section.nissan button{
    margin: 1rem 0rem;
    border: none;
    background-color: hsl(var(--red));
    color: hsl(var(--nav-text-color));
    width: 9rem;
    height: 2.5rem;
}

button{
    font-family: 'Open Sans', sans-serif;    
    cursor: pointer;
}

section.nissan h4{
    font-size: 0.8rem;
}

section.nissan h2{
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
}
section.nissan h1{
    font-size: 4rem;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
}

section.nissan h1 span.extra{
    font-weight: 800;
}

section.nissan a{
    position: absolute;
    background-color: hsla(0, 0%, 20%, 0.1);
    background-image: url(../Materialer/ic_keyboard_arrow_down_white_24px.svg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    width: 3rem;
    height: 3rem;
    border-radius: 5rem;
    bottom: 0rem;
    will-change: scale;
    animation: bubble 2.5s ease-in-out infinite;
}

/* make the scroll arrow breathe */
@keyframes bubble {
    from{
        scale: 0.9;
    }

    40%{
        scale: 1.1;
    }

    to{
        scale: 0.9;
    }    
}

section.equipment{
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10rem;
    margin-bottom: 2rem;
    gap: 2rem;
}

section.equipment article.col-4{
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

section.equipment article.col-4>div{
    position: relative;
    width: 100%;
    aspect-ratio: 6/9;
    background-color: white;    
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem;
}

section.equipment article{
    position: relative;
}

/* Makes the hastags go in the top right corner */
section.equipment h5.hashtag{
    position: absolute;
    top: 0;
    right: 0;
    background-color: hsl(var(--red));
    color: hsl(var(--nav-text-color));
    padding: 0.25rem 0.5rem;
    font-weight: 400;
}

section.equipment article.col-4 div.info{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 60%;
    padding: 0.5rem;
    background-color: white;
    margin-bottom: 0%;
    z-index: 2;
    transition: margin-bottom 0.3s ease-in-out;
}

section.equipment article.col-4 div:hover div.info{
    margin-bottom: 5%;
}

section.equipment article.col-4 div.info h6{
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

section.equipment article.col-4 div.info p{
    font-size: clamp(0.8rem, calc(2vw + 0.4rem), 1rem);
    font-weight: 400;
}

section.equipment article.col-4 div.info button{
    border: none;
    font-size: 0.8rem;
    height: 1.75rem;
    background-color: hsl(var(--background-color));
    color: hsl(0, 0%, 20%);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

section.equipment article.col-4 div:hover div.info button{
    background-color: hsl(var(--nav-primary));
    color: white;
}

@media screen and (min-width: 585px) {
    section.equipment article.col-4{
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1175px) {
    section.equipment article.col-4{
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mini info cards */
section.equipment article.col-4>div::before{
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    background-image: url(../Materialer/small-model.jpg);
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-size 0.3s ease-in-out;
}

section.equipment article.col-4>div:hover::before{
    background-size: 120%;
}

section.equipment article.col-4>div.udstyr::before{
    background-image: url(../Materialer/small-interior.jpg);
}
section.equipment article.col-4>div.elbiler::before{
    background-image: url(../Materialer/small-electric.jpg);
}
section.equipment article.col-4>div.fjernbetjening::before{
    background-image: url(../Materialer/small-connect.jpg);
}

section.equipment .info-board{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    grid-template-areas: "picture info";
    width: 100%;
    aspect-ratio: 5/1;
    padding: 2rem;
    background-color: white;
}

section.equipment .info-board.reversed{
    grid-template-areas: "info picture";
}

section.equipment .info-board .side-picture{
    grid-area: picture;
    width: 100%;
    height: 100%;
}

section.equipment .info-board .side-picture img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

section.equipment .info-board .infomation{
    grid-area: info;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

section.equipment .info-board .infomation h3{
    font-size: 2rem;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

section.equipment .info-board .infomation p{
    font-size: 1.2rem;
}

footer{
    padding: 2rem 0rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: hsl(195, 72%, 8%);
    color: hsl(0, 0%, 50%);
}

footer a{
    color: hsl(0, 0%, 50%);
    text-decoration: none;
}

footer a, footer p{
    font-size: 0.8rem;
}

footer h3{
    margin-bottom: 0.3rem;
}

footer .col-3{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

footer .col-3>div{
    display: flex;
    flex-direction: column;
}

footer div.icons{
    display: flex;
    gap: 0.5rem;
    height: 2.5rem;
}

footer div.icons a{
    height: 100%;
    aspect-ratio: 1/1;
}

footer div.icons a img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media screen and (min-width: 768px) {
    footer{
        height: 10rem;
    }
    footer .col-3{
        display: grid;
        grid-template-columns: 1fr 1fr 1.5fr;
        gap: 1rem;
    }
    
}


@media screen and (min-width: 900px) {
    :root{
        --nav-height: 3rem;
    }
    nav .hamburger{
        display: none;
    }
    nav::before,nav::after{
        display: none;
    }
    nav>ul:first-of-type{        
        display: flex;
        position: relative;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        top: 0;
    }
    nav>ul:first-of-type li:not(:has(h5)){
        width: 10rem;
    }
    nav>ul:first-of-type li:not(:has(h5))>a{
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        text-decoration: none;
    }

    nav li>h5, nav li:not(:has(h5)), nav>ul li:not(:has(h5))>a{
        font-size: 1.2rem;
        color: hsla(var(--nav-text-color), 0.6);
    }    

    /* Makes the nisan logo in the nav */
    nav>ul:first-of-type::before{
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        height: 100%;
        aspect-ratio: 1/1;
        background-image: url(../Materialer/nissan-logo-square.jpg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    li.currentPage{
        position: relative;
    }

    li.currentPage::before{
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: hsl(var(--nav-text-color));
    }

    li.currentPage a{
        color: hsl(var(--nav-text-color));
    }

    li#login{
        position: absolute;
        right: 0;
        bottom: 0;
        height: 100%;
        width: 8rem;
        background-color: hsl(var(--red));
    }

    li#login button{
        width: 100%;
        height: 100%;
        border: none;
        background: none;
        color: hsl(var(--nav-text-color));
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.2rem;
        font-size: 1rem;
    }

    li#login button::before{
        content: '';
        display: inline-block;
        position: relative;
        width: 1.25rem;
        height: 1.25rem;
        background-image: url(../Materialer/ic_lock_white_24px.svg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    nav li{
        padding-left: 0;
        width: 6rem;
        text-align: center;
        transition: background-color 0.3s ease-in-out;
        position: relative;
    }
    nav li:hover{        
        background-color: hsla(0, 0%, 100%, 0.2);
    }
    nav li:hover>ul{
        display: flex;
    }
    nav li h5{
        justify-content: center;
    }
    nav ul{
        transform: initial;
        display: none;
        opacity: 1;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        min-height: var(--nav-height);
        width: 100%;
    }

    nav ul ul {
        width: 125%;
    }
    nav ul ul li{
        padding-left: 1rem;
        width: 100%;
    }
    nav ul ul li h5{
        justify-content: flex-start;
    }
    nav ul ul ul{
        top: 0;
        left: 100%;
    }
    
}

@media screen and (min-width: 1100px){
    nav>ul:first-of-type>li:not(:has(h5)):hover>a::before{
        transform: scale(1);
        margin-right: 0.5rem;
        opacity: 1;
    }
    /* Makes the ul take into account the nissan logo and the login button */
    nav>ul:first-of-type{
        padding-left: var(--nav-height);
        padding-right: 8rem;
    }
}

@media screen and (max-width: 1100px) and (min-width: 900px) {
    header nav li#login{
        display: block;
        position: relative;
        right: initial;
        bottom: initial;
        height: var(--nav-height);
    }

    header nav>ul:first-of-type li:not(:has(h5)), li#login{
        width: 8rem;
    }

    nav>ul:first-of-type{
        padding-left: var(--nav-height);
    }

}

@media screen and (min-width: 1300px){
    section.equipment .info-board .infomation h3{
        font-size: 3rem;
    }
    
    section.equipment .info-board .infomation p{
        font-size: 1.65rem;
    }

    section.equipment article.col-4 div.info h6{
        font-size: 1.35rem;
    }
    
    section.equipment article.col-4 div.info p{
        font-size: 1.1rem;
    }

    section.equipment article.col-4 div.info button{
        font-size: 1rem;
        height: 2.5rem;
    }

    section.nissan button{
        width: 14rem;
        height: 4rem;
        font-size: 1.2rem;
    }

    section.nissan h4{
        font-size: 1.2rem;
    }
    
    section.nissan h2{
        font-size: 1.8rem;
    }
    section.nissan h1{
        font-size: 7rem;
    }
}