:root {
    --ink: #2e281f;
    --muted: #766e63;
    --background: #f3fff9;
    --line: #bbd2cb;
    --accent: #153b2e;
    --first-grid-column: 3;
}

@font-face {
    font-family: "Dancing Script";
    src: url("fonts/DancingScript-VariableFont_wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

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

body {
    min-height: 100dvh;
    background: var(--background);
    background: linear-gradient(to bottom right, var(--background), var(--line));
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-header {
    font-family: "Dancing Script", cursive;
}

h1 {
    font-size: clamp(2rem, 7vw, 4rem);
}

video {
    width: 100%;
    max-height: 60dvh;
}

.site-header {
    display: grid;
    padding: 2em 0;
    grid-template-columns: repeat(3, 1fr);

    h1 {
        display: grid;
        place-content: center;
        padding: 0;
        margin: 0;
        text-align: center;
        line-height: 0.8em;
        position: relative;

        &::before,
        &::after {
            position: absolute;
            content: '';
            height: 1px;
            background-color: currentColor;
            top: 50%;
            width: 25%;
        }

        &::before {
            left: 0;
            width: 23%;
        }

        &::after {
            right: 0;
            width: 27%;
        }
    }

    nav {
        display: grid;
        place-content: center;

        a {
            text-decoration: none;
            color: var(--ink);
            font-size: 1.58rem;

            &:hover {
                text-decoration: underline;
            }
        }
    }

}

.category-menu {
    position: relative;

    &>summary {
        color: var(--ink);
        cursor: pointer;
        font-size: 1.58rem;
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: "▾";
            font-family: Arial, sans-serif;
            font-size: 0.55em;
            margin-inline-start: 0.35em;
        }
    }

    &[open]>summary::after {
        content: "▴";
    }

    summary:focus-visible,
    a:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 3px;
    }

    &>.category-menu__list {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 10;
        width: max-content;
        min-width: 100%;
        max-width: min(80vw, 24rem);
        max-height: 70dvh;
        overflow: auto;
        padding: 0.5em 1em;
        border: 1px solid var(--line);
        border-radius: 0.5em;
        background: var(--background);
        box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
        list-style: none;
    }

    .category-menu__list {
        a {
            display: block;
            padding: 0.15em 0;
            color: var(--ink);
            font-size: 1.1rem;
            overflow-wrap: anywhere;
            text-decoration: none;

            &:hover {
                text-decoration: underline;
            }
        }

        .category-menu__list {
            position: static;
            width: auto;
            min-width: 0;
            max-width: none;
            max-height: none;
            overflow: visible;
            padding: 0 0 0 1em;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }
    }
}

.hero {
    background-color: var(--muted);
    text-align: center;
    padding: 1em;
    color: var(--background);

    h2 {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }
}

.eyebrow,
.meta {
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22em, 1fr));
    gap: 2em;
    padding-inline: 2em;
    padding-block: 3em;

    &>article:first-child {
        grid-column: 1 / var(--first-grid-column);

        h2 {
            font-size: 3rem;
        }
    }
}

.card {
    border: 1px solid var(--line);
    padding: 1em;
    border-radius: 1em;
    box-shadow: 1px 2px 6px color-mix(in srgb, var(--line) 44%, transparent);
    transition: box-shadow 380ms ease, background-color 380ms ease;
    background-color: color-mix(in srgb, var(--line) 44%, transparent);
    position: relative;

    &:hover {
        border: 1px solid var(--background);
        background-color: var(--line);
        box-shadow: 1px 4px 8px color-mix(in srgb, var(--accent) 40%, transparent);

        .card-image img {
            transform: scale(1.1);
        }
    }

    h2 {
        font-size: 2rem;
        text-align: center;
        text-wrap: balance;
        line-height: 1.1;
        margin: 0.25em 0;
        color: var(--accent);
    }

    a {
        text-decoration: none;
        color: var(--ink);
    }

    .card-image {
        display: block;
        width: 100%;
        aspect-ratio: 4/3;
        max-height: 8em;
        overflow: hidden;
    }

    img {
        display: block;
        width: 100%;
        aspect-ratio: 4/3;
        object-fit: cover;
        max-height: 8em;
        transition: transform 280ms ease;
        border-radius: 0.4em;
        height: 100%;
        max-height: none;
    }

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

    .meta {
        text-align: end;
    }

    .tags {
        font-size: 0.55em;
        text-align: end;
        position: absolute;
        bottom: 0.5em;
        left: 1em;
        right: 1em;
    }
}


.article {
    max-width: 900px;
    margin: 0px auto;
}

.lead {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 50px;
}

.prose {
    font-size: 1.12rem;

    h1 {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    h2 {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }

    img {
        max-width: 100%;
        width: 8em;
        height: 8em;
        object-fit: cover;
        border-radius: .5em;
        box-shadow: 0px 3px 8px rgb(0 0 0 / 40%);
    }

    p {
        margin: 1.3em 0;
        text-align: justify;
    }

    figure {
        margin: 0.5em 0;
        text-align: center;
    }

    figcaption {
        font-size: 0.9rem;
        color: var(--muted);
        font-style: italic;
        width: 100%;
        text-align: center;
    }
}

.search-result {
    display: block;
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

input {
    width: 100%;
    max-width: 600px;
    padding: 1em 3em;
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    font: inherit;

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

.site-footer {
    max-width: 1180px;
    margin: auto;
    padding: 30px 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.scroll-to-top {
    position: fixed;
    z-index: 1000;
    inset-inline-end: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3dvh, 2rem);
    display: grid;
    place-items: center;
    width: 3rem;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;

    &.is-visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0s;
    }

    &:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 3px;
    }

    &::before {
        content: '';
        width: 0;
        height: 0;
        border-inline: 0.7rem solid transparent;
        border-bottom: 1.2rem solid var(--ink);
    }

    &:hover::before {
        border-bottom-color: var(--accent);
    }
}

.aligncenter {
    text-align: center;
}

.lightbox3-overlay {
    --lb-backdrop-color: rgb(24 20 17 / 94%);
    --lb-chrome-bg: rgb(46 40 31 / 92%);
    --lb-chrome-text: var(--background);
    --lb-chrome-font-size: 14px;
    --lb-chrome-padding: 16px;
    --lb-chrome-border-radius: 8px;
    --lb-image-border-radius: 4px;
    --lb-image-padding: clamp(16px, 4vw, 48px);
}

blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1em;
    margin: 1.5em 0;
    color: var(--accent);
    font-style: italic;
}

.has-nested-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;

    &>* {
        flex: 1 1 6em;
    }

    &>figcaption:last-child {
        flex-basis: 100%;
    }
}

.article-nav {
    float: inline-end;
    padding: 1em;
    border-inline-start: solid 1px var(--line);
    border-block-start: solid 1px var(--line);
    margin-inline-start: 1em;
    background: linear-gradient(to bottom, var(--background), transparent);

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    li {
        padding-inline-start: calc((var(--level) - 1) * 1em);
        max-width: 15em;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    a {
        text-decoration: none;
        color: var(--ink);
    }

    a:hover {
        text-decoration: underline;
    }
}

.article-header {
    position: relative;
    overflow: hidden;

    min-height: 17em;
    margin-bottom: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--muted);


    .lead {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        z-index: 0;
        filter: opacity(40%);
    }

    a {
        text-decoration: none;
        color: var(--line);
    }

    h1 {
        color: var(--background);
        z-index: 0;
        max-width: 90%;
        text-align: center;
        text-wrap-style: balance;
    }

    .meta {
        padding-inline: 2em;
        position: absolute;
        bottom: 1em;
        left: 1em;
        right: 1em;
        color: var(--line);
        display: flex;
        justify-content: space-between;
    }
}

.wp-block-media-text {
    display: grid;
    grid-template-rows: auto;
    align-items: center;

    .wp-block-media-text__content {
        li {
            list-style: none;
        }
    }
}

.has-vivid-red-color {
    color: #cf2e2e;
}

.has-vivid-green-cyan-color {
    color: #00d084;
}

.has-black-color {
    color: black;
}

.has-luminous-vivid-amber-color {
    color: #fcb900;
}

@media (max-width: 700px) {
    .grid {
        --first-grid-column: 2;
        grid-template-columns: 1fr;
        
    }

    .article {
        margin: 45px auto;
    }

    .article h1 {
        font-size: 3.2rem;
    }
}