/* main */
main {
    display: flex;
    flex-direction: column;

    margin-top: 1em;
    margin-left: 1em;
}

.skip-link {
    position: absolute;
    left: 15em;
    opacity: 0;
    background-color: var(--highlight);
    color: rgb(255, 138, 0);
    padding: 0.5em;
    border-radius: 15px;
    transition: opacity 0.3s ease;

    /* kan niet geklikt worden met een muis */
    pointer-events: none;

    &:focus {
        opacity: 1;
        /* nu kan je weer interacten met de link */
        pointer-events: auto;
        outline: 2px solid rgb(255, 138, 0);
    }
}

.hidden {
    display: none;
}

/* hamburger menu */
.open-menu {
    border: none;
    margin-right: auto;
    background-color: inherit;

    cursor: pointer;

    &:hover {
        scale: 1.2;
        transform-origin: left;
    }
}

.close-menu {
    border: none;
    margin-right: auto;
    background-color: inherit;

    cursor: pointer;

    @media (min-width: 1250px) {
        display: none;
    }
}

/* styling voor open en close menu button als JS niet inlaad */
#menu-checkbox-toggle {
    position: absolute;
    right: 100vw;
}

/* hamburger button wanneer JS niet inlaad */
label {
    cursor: pointer;
    width: min-content;
    transition: 1s ease-in-out;

    cursor: pointer;

    &:hover {
        scale: 1.2;
        transform-origin: left;
    }
}

[type="checkbox"]:checked {
    & ~ .menu {
        left: 0;

        /* animatie */
        /* dit gebeurt na de overlay animatie */
        transition: left 1s ease-in-out;
    }

    & + label {
        margin-left: 12em;
        rotate: 90deg;
        transition: 1s ease-in-out;
        transform-origin: left;
        transition-delay: 120ms;
    }
}

/* menu zonder js */
.menu {
    display: flex;
    flex-direction: column;

    margin-bottom: 3em;

    @media (min-width: 750px) {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        background-color: var(--background-secondary);
        padding: 1em;

        z-index: 150;
    }

    h3 a {
        cursor: pointer;
        border: none;
        background-color: inherit;
    }

    .menu-title {
        white-space: nowrap;

        @media (min-width: 750px) {
            margin-top: 1em;
            margin-bottom: 2.5em;
        }

        h2 > a {
            color: var(--highlight);
            font-size: var(--font-size-headings);
            font-weight: var(--font-weight-bold);
        }

        svg {
            margin-right: 0.5em;
        }
    }

    ul {
        margin-bottom: 1em;

        li {
            margin-bottom: 0.4em;

            &:hover {
                scale: 1.1;
                transform-origin: left;
                text-decoration: underline;
            }

            /* li 1 voor 1 in het menu */
            &.li-animation {
                /* dit gebeurt nadat het menu background op beeld is */
                animation: li-slide 1s ease-in;
            }
        }
    }

    .links {
        display: flex;
        flex-direction: column;

        @media (min-width: 750px) {
            margin-top: auto;
        }
    }
}

/* menu layout for hamburgermenu */
.menu-hamburger {
    /* hamburger menu alleen voor kleine schermen */
    @media (max-width: 1250px) {
        position: fixed;
        top: 0;
        /* off screen linker kant */
        left: -100%;
        padding: 1em;
        height: 100dvh;
        z-index: 200;

        background-color: var(--background-secondary);

        /* animatie */
        /* dit gebeurt als het menu dicht gemaakt wordt */
        transition: left 750ms ease-in-out;

        .menu-title {
            display: flex;
            flex-direction: row;
            margin-bottom: 2.5em;

            h2 {
                margin-right: 1em;
            }

            .close-menu {
                margin-top: 0.65em;
            }
        }

        .links {
            margin-top: auto;
        }

        /* delay op elke li in het menu, elke li is 50ms langzamer dan de vorige */
        /* als er een element is met de class menu-hamburger & de class active  */
        /* dan komt het element met de class overlay op beeld. */
        &.active ~ .overlay {
            display: block;
        }

        .menu-title li:nth-child(1), .menu-title li:nth-child(2) {
            animation-delay: 0ms;
        }

        /* dashboard links */
        .dashboard-links li:nth-child(1) {
            animation-delay: 25ms;
        }
        .dashboard-links li:nth-child(2) {
            animation-delay: 50ms;
        }
        .dashboard-links li:nth-child(3) {
            animation-delay: 75ms;
        }
        .dashboard-links li:nth-child(4) {
            animation-delay: 100ms;
        }
        .dashboard-links li:nth-child(5) {
            animation-delay: 125ms;
        }
        .dashboard-links li:nth-child(6) {
            animation-delay: 150ms;
        }

        /* nieuwekijk links */
        .nieuwekijk-links li:nth-child(1) {
            animation-delay: 175ms;
        }
        .nieuwekijk-links li:nth-child(2) {
            animation-delay: 200ms;
        }
        .nieuwekijk-links li:nth-child(3) {
            animation-delay: 225ms;
        }
        .nieuwekijk-links li:nth-child(4) {
            animation-delay: 250ms;
        }
        .nieuwekijk-links li:nth-child(5) {
            animation-delay: 275ms;
        }
        .nieuwekijk-links li:nth-child(6) {
            animation-delay: 300ms;
        }
        .nieuwekijk-links li:nth-child(7) {
            animation-delay: 325ms;
        }

        /* links (2 links onderaan) */
        .links li:nth-child(1) {
            animation-delay: 350ms;
        }
        .links li:nth-child(2) {
            animation-delay: 375ms;
        }
    }

    &.active {
        left: 0;
    
        /* animatie */
        /* dit gebeurt na de overlay animatie */
        transition: left 0.8s ease-in-out;
    }
}

/* div over de hele pagina */
.overlay {
    display: none;
    position: fixed;
    /* top, right, bottom and left = 0 */
    inset: 0;

    background-color: rgba(0, 0, 0, 0.5);

    /* achter het hamburger menu */
    z-index: 199;

    /* animatie */
    /* dit gebeurt als eerst */
    animation: overlay-transition 500ms ease-in;
}

/* overzicht & details pagina heading */
.pagina-heading {
    margin-top: 1em;
    margin-right: auto;

    @media (min-width: 750px) {
        position: absolute;
        top: 2em;
        left: 15em;
    }

    h1 {
        margin-bottom: 1em;
    }

    h2 {
        margin-top: 0;
    }

    &.metHamburger {
        @media (max-width: 1250px) {
            top: 3em;
            left: 1em;
            margin-left: 0;
        }
    }
}

/* overzicht pagina */
.overzicht-main-content {
    @media (min-width: 750px) {
        display: flex;
        flex-direction: column;

        margin-top: 7em;
        margin-left: 15em;
    }

    @media (min-width: 1250px) {
        display: grid;
        grid-template-columns: min-content min-content;
        grid-template-rows: min-content min-content;
        grid-gap: 1em;
    }

    article {
        display: grid;
        grid-template-columns: min-content 18.5em 1fr;
        grid-template-rows: min-content 1fr;
        grid-template-areas:
        "image title progress"
        ". button progress"
        ;

        background-color: var(--background-secondary);
        height: 10.5em;
        min-width: 17em;
        max-width: 29.8em;
        border-radius: 15px;

        margin-top: 1em;
        margin-bottom: 1em;
        margin-right: 1em;

        @media (max-width: 510px) {
            grid-template-columns: min-content min-content 1fr;
            grid-template-rows: min-content 1fr;

            height: 15em;
        }

        @media (max-width: 430px) {
            grid-template-columns: min-content 1fr;
            grid-template-rows: min-content min-content 1fr;
            grid-template-areas:
            "image title"
            ". button"
            ". progress"
            ;

            height: 20em;
        }

        img {
            grid-area: image;

            justify-self: center;
            align-self: center;

            margin-left: 0.5em;
            margin-right: 0.5em;


            border-radius: 50%;
            height: 2.5em;
            width: 2.5em;
        }

        h3 {
            grid-area: title;

            white-space: nowrap;
            margin-top: 0.9em;
            margin-bottom: 0.9em;
        }

        .site-link {
            grid-area: title;

            /* link onder de h2 */
            align-self: end;
        }

        .button {
            grid-area: button;

            cursor: pointer;

            /* center svg en tekst */
            display: flex;
            align-items: center;
            justify-content: center;

            margin-top: 1em;
            margin-left: 0.5em;
            margin-right: 1em;
            
            @media (max-width: 430px) {
                justify-self: center;
            }

            svg {
                margin-right: 1em;
            }
        }

        progress {
            grid-area: progress;

            justify-self: center;
            align-self: center;
            margin-right: 1em;
        }
    }
    
    /* heading en main content positie als er een hamburger menu is */
    &.metHamburger {
        @media (min-width: 1020px) and (max-width: 1250px) {
            display: grid;
            grid-template-columns: min-content min-content;
            grid-template-rows: min-content min-content;
            grid-gap: 1em;
    
            top: 3em;
            left: 1em;
            margin-left: 0;
        }

        @media (max-width: 1250px) {
            top: 3em;
            left: 1em;
            margin-left: 0;
        }
    }
}

/* details pagina: top content */
.details-top-content {
    margin-top: 1em;

    @media (min-width: 750px) {
        margin-top: 7em;
        margin-left: 15em;
    }

    @media (min-width: 1340px) {
        display: flex;
        flex-direction: row;
        gap: 1em;
    }

    /* kaart toegankelijkheid */
    .kaart-toegankelijkheid {
        display: grid;
        grid-template-columns: min-content 1fr;
        grid-template-rows: min-content 1fr;
        grid-template-areas:
        "title title"
        "progress niveau"
        ;

        background-color: var(--background-secondary);
        height: 13.8em;
        width: 17.8em;
        border-radius: 15px;

        margin-bottom: 1em;

        @media (max-width: 320px) {
            width: 17em;
        }

        /* toegankelijkheid */
        h3 {
            grid-area: title;

            margin-top: 0.8em;
            margin-bottom: 1.3em;
            margin-left: 1.5em;
        }

        progress {
            grid-area: progress;

            margin-left: 1.5em;
        }

        p {
            grid-area: niveau;

            margin-left: 1em;

            span {
                display: flex;
                white-space: nowrap;
                margin-bottom: 0.4em;
            }
        }
    }

    /* kaart automatische scan */
    .kaart-automatische-scan {
        display: grid;
        grid-template-columns: min-content 1fr 1fr;
        grid-template-rows: min-content 1fr;
        grid-template-areas:
        "title title title"
        "progress nfo aandacht"
        ;

        background-color: var(--background-secondary);
        min-height: max-content;
        max-height: 13.8em;
        min-width: 17em;
        max-width: 54.94em;
        border-radius: 15px;

        margin-bottom: 2em;
        margin-right: 0.5em;

        @media (min-width: 320px) and (max-width: 1030px) {
            display: flex;
            flex-direction: column;
        }

        @media (min-width: 580px) and (max-width: 1030px) {
            display: grid;
            grid-template-columns: min-content 1fr;
            grid-template-rows: min-content min-content 1fr;
            grid-template-areas:
            "title title"
            "progress nfo"
            "aandacht aandacht"
            ;
        }

        /* automatische scan */
        h3 {
            grid-area: title;

            white-space: nowrap;
            margin-top: 0.8em;
            margin-left: 1em;
        }

        .time-stamp {
            grid-area: title;

            justify-self: end;
            text-align: end;
            margin-top: 0.8em;
            margin-right: 1em;

            @media (min-width: 320px) and (max-width: 600px) {
                margin-right: auto;
                margin-left: 2em;
            }

            @media (min-width: 580px) and (max-width: 600px) {
                margin-top: 2.5em;
            }
        }

        progress {
            grid-area: progress;

            margin-left: 1em;
            margin-top: 1em;

            @media (min-width: 320px) and (max-width: 750px) {
                margin-left: 3em;
            }
        }

        .nfo-tekst {
            grid-area: nfo;

            max-width: 18em;
            margin-top: 1em;
            margin-left: 2em;
            margin-bottom: 1em;

            @media (min-width: 320px) and (max-width: 750px) {
                min-width: 15em;
                margin-left: 1em;
            }

            button {
                /* center svg en tekst */
                display: flex;
                align-items: center;
                justify-content: center;
                margin-bottom: 1em;
                width: 25em;

                svg {
                    margin-right: 1em;
                }
            }
        }

        /* aandacht vereist */
        h4 {
            grid-area: aandacht;

            font-weight: var(--font-weight-bold);
            white-space: nowrap;

            margin-top: 1em;
            margin-left: 1em;
        }

        ul {
            grid-area: aandacht;

            align-self: end;
            margin-bottom: 2em;

            /* split ul in 3 kolommen */
            column-count: 3;

            @media (min-width: 320px) and (max-width: 475px) {
                align-self: start;
                margin-top: 1em;
                margin-left: 2em;

                column-count: 2;
            }

            @media (min-width: 475px) {
                align-self: start;
                margin-left: 2em;
            }

            @media (min-width: 580px) {
                margin: 2.5em;
            }

            li {
                white-space: nowrap;
                margin-bottom: 0.5em;
                margin-right: 1em;
            }
        }
    }

    &.metHamburger {
        @media (min-width: 420px) and (max-width: 1250px) {
            position: relative;
            top: 3em;
            left: 1em;
            margin-left: 0;
        }
    }
}

/* details pagina: zoek en filters */
.details-search-filters {
    display: grid;
    grid-template-columns: min-content;
    grid-template-rows: min-content;
    grid-template-areas:
    "zoek filters"
    ;

    @media (min-width: 320px) {
        display: flex;
        flex-direction: column;
    }

    @media (min-width: 750px) {
        margin-left: 13.5em;
    }

    @media (min-width: 915px) {
        flex-direction: row;
    }

    /* search bar */
    .search-bar {
        display: flex;
        flex-direction: column;
        gap: 0;

        svg {
            z-index: 100;

            position: relative;
            top: 1em;
            left: 1em;
        }

        input[type="text"] {
            position: relative;
            top: -0.5em;

            border: none;
            border-radius: 15px;

            height: 2.1em;
            width: 13.3em;
        }

        input::placeholder {
            padding-left: 3em;
        }
    }

    /* filter buttons */
    .filters-buttons {
        ul {
            display: flex;
            flex-direction: row;
            gap: 2em;
            margin-top: 0.8em;
            margin-left: 1em;
            margin-right: 1em;

            column-count: 2;

            @media (max-width: 520px) {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                margin-left: 0.5em;
                gap: 1em;
            }

            @media (min-width: 520px) and (max-width: 1370px) {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
            }

            li {
                button {
                    border: none;
                    border-radius: 5px;

                    height: 2em;
                    width: 9em;
                }

                &:last-child {
                    button {
                        height: 2.3em;
                        width: 12.6em;
                        
                        @media (max-width: 520px) {
                            width: 9em;
                        }
    
                        svg {
                            fill: var(--text-light);
                        }
                    }
    
                    button:hover {
                        svg {
                            fill: var(--highlight);
                        }
                    }
                }
            }
        }
    }

    &.metHamburger {
        @media (min-width: 420px) and (max-width: 1250px) {
            position: relative;
            top: 3em;
            left: 1em;
            margin-left: 0;
        }
    }
}

/* details pagina: web pagina kaartjes */
.details-pagina-kaartjes-container {
    margin-right: 1em;

    @media (min-width: 750px) {
        margin-left: 13.5em;
    }

    @media (min-width: 990px) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 1360px) {
        grid-template-columns: repeat(3, 1fr);
    }

    .pagina-kaartje {
        display: flex;
        flex-direction: column;

        background-color: var(--background-secondary);

        border-radius: 15px;
        min-width: 17em;
        max-width: 23.8em;

        margin-top: 1em;
        margin-bottom: 1em;
        margin-right: 0.5em;

        .kaart-title {
            display: flex;
            flex-direction: row;
            justify-content: space-between;

            margin-top: 0.8em;
            margin-left: 1em;
            margin-right: 1em;
        }

        /* link */
        a {
            margin-left: 1.6em;
        }

        meter {
            align-self: center;
            width: 21.5em;
            
            @media (max-width: 440px) {
                width: 16em;
            }
        }

        button {
            display: flex;
            /* positie van de button */
            align-self: center;
            /* content binnen de button */
            align-items: center;
            justify-content: center;

            margin-top: 1em;
            margin-left: 0.5em;

            width: 25em;

            svg {
                margin-right: 0.4em;
            }
        }

        .kaart-footer {
            display: flex;
            flex-direction: row;
            margin-top: auto;
            margin-bottom: 1em;

            @media (max-width: 440px) {
                flex-direction: column;
            }

            .icon-text {
                margin-top: 1.2em;
                margin-left: 1em;
                margin-right: 1em;
                white-space: nowrap;
            }
        }
        
        /* height van de kaartjes als het wel of niet een button heeft */
        /* https://developer.mozilla.org/en-US/docs/Web/CSS/:not */
        /* https://developer.mozilla.org/en-US/docs/Web/CSS/:has */
        &:not(:has(button)) {
            height: 8.7em;
            
            @media (max-width: 440px) {
                height: 12em;
            }
        }

        &:has(button) {
            height: 11.8em;

            @media (max-width: 440px) {
                height: inherit;
            }
        }
    }

    /* add pagina kaart */
    .pagina-kaartje-add {
        display: flex;
        align-items: center;
        justify-content: center;

        margin-bottom: 1em;

        background-color: var(--background-secondary);

        border-radius: 15px;
        height: 6.2em;
        min-width: 17em;
        max-width: 23.8em;
        margin-right: 0.5em;
    }

    &.metHamburger {
        @media (min-width: 420px) and (max-width: 1250px) {
            position: relative;
            top: 3em;
            left: 1em;
            margin-left: 0;
        }
    }
}

/* construction pagina */
.construction-info {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* keyframe animations */
/* opacity die over de pagina komt als het menu open gemaakt wordt */
@keyframes overlay-transition {
    from {
        background-color: rgba(0, 0, 0, 0);
    }

    to {
        background-color: rgba(0, 0, 0, 0.5);
    }
}

/* li delay animation */
@keyframes li-slide {
    from {
        opacity: 0.5;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}
