@font-face {
    font-family: "Fredoka";
    src: url("../../labo03/oplossing/fonts/Fredoka-VariableFont_wdth\,wght.woff2") format("woff2");
}

*, *::before, *::after{
    box-sizing: border-box;
}

:root {
    line-height: 1.6;
    --bg: oklch(0.99 0.003 325);
    --primary: oklch(0.25 0.01 325);
    font-family: "Fredoka", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

.container{
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

nav ul {
  padding: 0;
  margin: 0;
  list-style: none;
  margin-left: -2rem;
  display: flex;
  flex-wrap: wrap;
}

nav a{
    display: block;
    padding: 1rem 2rem;
    color: inherit;
    text-decoration: none;
}

.row {
    display: flex;
    gap: 2rem;

    > *{
        padding: 1rem;
        border: 1px dashed #3498db;
    }
    > *:first-child{
        flex: 2;
    }
    > *:last-child{
        flex: 1;
    }
}

.visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

main {
    nav {
        --text: oklch(0.99 0.003 325);
        --bg: oklch(0.45 0.32 40);

        ul{
            display: flex;
            flex-wrap: wrap;
        }
        
    }

    nav a {
        color: var(--text);
        background-color: var(--bg);
        transition: color .2s ease-in-out,
                    background-color .2s ease-in-out;

        &:hover, &:focus-visible {
            color: var(--bg);
            background-color: var(--text);
        }
    }

    nav li:first-child {
        margin-inline-end: auto;
    }

    nav li:first-child a {
        color: inherit;
        background-color: transparent;
        font-weight: bold;
    }
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        display: flex;
        flex-direction: column;
        flex-basis: 18rem;
        padding: 1rem;
        overflow: hidden;
        background-color: oklch(0.99 0 0);
        border-radius: .5em;
        box-shadow: 0 0 .2rem oklch(0 0 0 / .2),
                    0 0 2rem oklch(0 0 0 / .1);
        position: relative;
        isolation: isolate;
        transition: box-shadow .3s ease-in-out;

        /* Gekleurd vlak achter de inhoud */
        &::before {
            content: "";
            position: absolute;
            z-index: -1;
            inset: 0;
            background-color: oklch(0.72 0.18 35 / 0.8);
            border-radius: 50%;
            scale: 0;
            pointer-events: none;
            transition:
                scale .5s ease-in-out,
                border-radius .5s ease-in-out .1s;
        }

        &:hover {
            box-shadow: 0 0 .4rem oklch(0 0 0 / .3),
                        0 0 2.5rem oklch(0 0 0 / .2);
        }

        &:hover::before,
        &:has(a:focus-visible)::before {
            scale: 1.5;
            border-radius: 0;
        }

        /* Tekst en links boven het gekleurde vlak */
        h2,
        p,
        a {
            position: relative;
            z-index: 1;
        }
    }

    img {
        order: -1;
        width: calc(100% + 2rem);
        max-width: none;
        margin: -1rem -1rem 0;
        height: auto;
        position: relative;
        z-index: -2;
        mix-blend-mode: multiply;
    }

    h2 {
        margin-block-start: 0;
        font-size: 1.25rem;
    }

    a::after {
        content: "";
        position: absolute;
        inset: 0;
    }
}