@font-face {
        font-family: "Fredoka";
        src: url("./fonts/Fredoka-VariableFont_wdth\,wght.ttf") format("truetype")
}

::before, ::after{
    box-sizing: border-box;
}

:root {
    font-family: "Fredoka", sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
    --bg: oklch(0.99 0.003 325);
    --primary: oklch(0.25 0.01 325);
    background-color: var(--bg);
    color: var(--primary);
}

body {
    margin: 0;
}

.container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

nav{
    background-color: darkblue;
    ul{
        padding: 0;
        margin: 0;
        list-style: none;
        display: flex;
        flex-wrap: wrap;
    }

    a {
        padding-block: 1rem;
        padding-inline: 2rem;
        text-decoration: none;
        color: var(--bg)
    }
    
    li {
        padding-left: -2rem;
    }
}

.row {
    display: flex;
    gap: 2rem;
    * {
        flex: 1;
        border: dashed 1px;
        padding: 1rem;
        color: darkblue
    }

    *:first-child {
        flex: 2;
    }
}

main {
    nav {
        --text: oklch(0.99 0.003 325);;
        --bg: oklch(0.45 0.32 40);
        background-color: transparent;
    }

    nav a{
        color: var(--text);
        background-color: var(--bg);
        transition: 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{
        background-color: var(--text);
        color: var(--primary);
        font-weight: bold;
    }
}

.visually-hidden{
    border: 0;
    position: absolute; 
    clip-path: inset(50%);
    height: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cards li {
    display: flex;
    flex-direction: column;
    flex: 1 1 calc(20% - 1rem);
    position: relative; 
    border: 1px solid #ccc;
    padding: 1rem;
}

.cards img {
    order: -1;
    width: 100%;
    height: auto;
}

.cards .overlay-link {
    position: absolute;
    inset: 0;
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.cards li a:not(.overlay-link) {
    z-index: 1;
}