@font-face {
    font-family: "Fredoka";
    src: url("home/Fredoka-VariableFont_wdth,wght.woff2") format("woff2");
    font-display: swap;
}

*, *::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);
    --accent: oklch(0.535 0.219 29.234);
    --text-muted: oklch(0 0 0);

    color: var(--primary);
    background-color: var(--bg);
}

body {
    margin: 0;
}

.container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

header {
    color: var(--bg);
    background-color: var(--primary);
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}


header nav a {
    display: inline-block;
    padding-block: 1rem;
    padding-inline: 2rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    font-weight: 600;
}

header nav a:hover,
header nav a:focus-visible {
    transform: scale(1.1);
    color: var(--accent);
}

main {
    padding-block: 2rem;
}

h1 {
    font-size: 2rem;
    margin-block: 1rem 2rem;
    color: var(--primary);
}

h2 {
    font-size: 1.25rem;
    color: oklch(0 0 0);
    margin-block: 1.25rem 1rem;
}

.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 40em) {
    .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 60em) {
    .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 75em) {
    .cards { grid-template-columns: repeat(4, 1fr); }
}

.cards li {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    background: oklch(0.97 0.01 325);
    box-shadow: 0 0 0.2rem oklch(0 0 0 / 0.2), 0 0 2rem oklch(0 0 0 / 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cards li:hover,
.cards li:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 0 0.3rem oklch(0 0 0 / 0.25), 0 0 2.5rem oklch(0 0 0 / 0.15);
}

.cards img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.cards li:hover img,
.cards li:focus-within img {
    transform: scale(1.05);
    filter: grayscale(100%);
}

.cards .content {
    padding: 1rem;
}

.cards h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.cards p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
}

.cards a:not(.overlay-link) {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.25s ease;
}

.cards a:not(.overlay-link):hover,
.cards a:not(.overlay-link):focus-visible {
    color: darkblue;
}

.cards .overlay-link {
    position: absolute;
    inset: 0;
    text-indent: -9999px;
    overflow: hidden;
}

.metadetails {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.content-text {
    max-width: 65ch;
}

.content-text .introduction {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.content-text h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.controls {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.mylink a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #c62828;
    text-decoration: underline;
    background: transparent;
    border: none;
    padding: 0;
    transition: color 0.25s ease;
}

.mylink a:hover,
.mylink a:focus-visible {
    color: #a11616;
    text-decoration-thickness: 2px;
}

.mybutton a {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background-color: #4a7c2b;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.15s ease;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15);
}

.mybutton a:hover,
.mybutton a:focus-visible {
    background-color: #3a661f;
    transform: translateY(-2px);
}

@media (max-width: 40em) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 40em) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls a {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 40em) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls a {
        width: 100%;
        text-align: center;
    }
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--primary);
    color: var(--bg);
}