* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /*font-family: 'Open Sans', sans-serif;
    font-family: 'Orbit', sans-serif;
    font-family: 'Press Start 2P', cursive;
    font-family: 'Roboto Mono', monospace;*/
    --headerbackground: #3AB0FF;
    --containerbackground: #F9F2ED;
    --headingcolor: #ef4444;
    --buttoncolor: #ef4444;
    --buttonhover: #dc2626;
    --tile1st: #78C8FF;
    --tile2nd: #3AB0FF;
    --tile3rd: #0073CE;
    --textcolor: #0073CE;
    --tiletext: #320265;
}

p {
    color: var(--textcolor);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--headingcolor);
    font-family: 'Press Start 2P';
}

h3 {
    text-align: center;
    margin: 0 auto 3vh auto;
}

/* header/navbar ---------------------------------------------------------------------------*/
header {
    width: 100%;
    height: 12vh;
    background-color: var(--headerbackground);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

.headercontainer {
    max-width: 1000px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    /*centering*/
}

.logodiv {
    position: relative;
    max-width: 0%;
    /*oherwise consuming too much space in flexcontainer, hamburger menu gets pushed outside*/
    /*extra div necessary to act as an rel anchor for car3*/
}

#headerimage {
    /*height: 100%;
    object-fit: contain;*   set automatically in flex if is part of flex. here is block.*/
    max-height: 100%;

}

ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin-right: 2%;
}

li {
    font-family: 'Press Start 2P';
    color: white;
    padding: 15px;
}

#hamburgermenu {
    display: none;
}

li:hover {
    transform: translate(4%, 6%);
    cursor: pointer;
}

/* news ---------------------------------------------------------------------------*/

#news {
    margin-top: 12vh;
    background-color: var(--containerbackground);
    display: flex;
    max-height: 40vh;
    width: 100%;
    border-radius: 25px;
    margin-bottom: 1vh;
}

#news_left {
    display: flex;
    /* so rechts kleben*/
    width: 50%;
    justify-content: flex-end;
}

#news_left img {
    padding: 3%;
    max-height: 100%;
    /*beides max nötig, so kein object-fit nötig*/
    max-width: 100%;
    border-radius: 25px;
}

#news_right {
    display: flex;
    padding: 3%;
    width: 50%;
    flex-direction: column;
    justify-content: center;
}

#news_right h2 {
    margin-bottom: 0.8em;
}

#news_right p {
    font-family: 'Open Sans', sans-serif;
}

#poll_closed {
    font-size: 0.7em;
    margin-bottom: 8%;
}

button {
    background-color: var(--buttoncolor);
    color: white;
    border: 0;
    max-width: 10em;
    padding: 0.5em 2em 0.5em 2em;
    border-radius: 30px;
}

button:hover {
    background-color: var(--buttonhover);
    cursor: pointer;
    position: relative;
}

.car1anchor {
    position: relative;
}

/* quest ---------------------------------------------------------------------------*/
.quest {
    background-color: var(--containerbackground);
    border-radius: 25px;
    text-align: center;
    padding: 1em;
    margin-bottom: 5vh;
}

.quest p {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9em;
}

.hidden_car_sample {
    width: 2.5rem;
    margin: 5px 0;
    vertical-align: middle;
}

.car1 {
    width: 2.5rem;
    position: absolute;
    /*anchor is span under button*/
    right: 5rem;
    top: 0;
    filter: opacity(0%);
}

.car1:hover {
    filter: opacity(100%);
    transition: 1s ease;
}

.car2anchor>img.car2 {
    width: 2.5rem;
    height: 2.5rem;
    position: absolute;
    /*anchor is div from giana sisters*/
    right: 1rem;
    top: 4rem;
    filter: opacity(0%);
}

.car2anchor>img.car2:hover {
    filter: opacity(100%);
    transition: 1s ease;
    /*filter: brightness(100%); interferes with opacity, with both no transition effect.*/
}

.car3 {
    width: 2.5rem;
    position: absolute;
    /*anchor is .logodiv*/
    left: 17rem;
    top: 1rem;
    filter: opacity(0%);
    z-index: 2;
}

.car3:hover {
    filter: opacity(100%);
    transition: 1s ease;
}

/* cardgrid ----------------------------------------------------------*/

.cardgrid {
    background-color: var(--containerbackground);
    display: grid;
    max-width: 1000px;
    padding: 2%;
    margin: 0 auto 3vh auto;
    border-radius: 25px;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 350px);
    gap: 0.5em;
    /* % does not provide suff space at bottom*/
}

.cardgrid div {
    padding: 7%;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    /*justify-content: center;      useless, no space left*/
    /*align-items: start;   already std-setting*/
}

.cardgrid div:nth-child(3n+1) {
    background-color: var(--tile1st);
}

.cardgrid div:nth-child(3n+2) {
    background-color: var(--tile2nd);
}

.cardgrid div:nth-child(3n+3) {
    background-color: var(--tile3rd);
}

.cardgrid img {
    height: 80%;
    width: 100%;
    padding-bottom: 1em;
}

.cardgrid img:hover {
    filter: brightness(120%);
}

.cardgrid p {
    color: var(--tiletext);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9em;
}

.car2anchor {
    position: relative;
}

/* footer ----------------------------------------------------------*/
#footerdiv {
    text-align: left;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8em;
}

div#footerdiv p {

    display: inline-block;
    padding: 10px;
}

/* @media ----------------------------------------------------------*/
@media (max-width: 1023px) {
    .cardgrid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 350px);
        max-width: 500px;
    }

    #news_left img {
        padding: 5%;
    }

    #news_right h2 {
        font-size: 1.2em;
    }

    #news_right p {
        font-size: 0.9em;
    }

    p#poll_closed {
        font-size: 0.6em;
    }

    #heading_grid {
        font-size: 1em;
    }
}

@media (max-width: 668px) {

    body {
        min-width: 300px;
    }

    header {
        height: 7vh;
    }

    .headercontainer {
        height: 100%;
    }

    ul {
        display: none;
    }

    #hamburgermenu {
        display: unset;
        padding: 15px;
    }

    #news {
        margin-top: 7vh;
    }

    #news {
        flex-direction: column;
        max-height: unset;
    }

    #news_left,
    #news_right {
        width: 100%;
    }

    #news_left img {
        padding: 10%;
        border-radius: 70px;
    }

    .cardgrid {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: repeat(12, 350px);
        max-width: 250px;
        padding: 3%;
    }

    #news_right p {
        font-size: 0.8em;
    }

    p#poll_closed {
        font-size: 0.6em;
    }
}