/*
Theme Name: SFP i staden
Theme URI: 
Author: 
Description: SFP/RKP i staden. Based visually on sfp.fi.
Requires at least: 7.0.2
Tested up to: 7.0.3
Version: 2
Text Domain: sfp
Domain Path: /assets/languages
*/

:root {
    color-scheme: light dark;
    font-size: 125%;
    --header-height: calc(8rem / 2.4552417109);
    --main-padding-inline: clamp(.6rem, .6rem + 1vw, 2vw);
}

@view-transition {
    navigation: auto;
}

body {
    max-width: calc(3 * 65ch + 2vw);
    margin-inline: auto;
}

header,
main,
footer {
    margin-inline: auto;
}

footer {
    padding-inline: var(--main-padding-inline);
}

a:where(:link, :visited) {
    background-image: linear-gradient(90deg, var(--color-primary-hover), var(--color-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: center bottom;
    transition: all .15s ease;
}

a:where(:hover, :active, :focus) {
    color: var(--link-hover-color);
    background-size: 100% 2px;
}

a:has(img, svg) {
    display: block;
    background: none;

    & img,
    & svg {
        transition: scale .25s ease;
    }

    &:hover img,
    &:hover svg {
        scale: 1.025;
    }
}

.btn {
    font-family: var(--font-condensed);
    text-transform: uppercase;

    &::after {
        content: '\203A';
        font-size: 125%;
        padding-inline-start: 1ch;
    }
}

button,
input[type="submit"],
.btn-primary {
    padding: .5rem 2ch .35rem;
    border: none;
    background-color: var(--color-primary);
    color: var(--main-bg-light);
    border-radius: .1rem;
    transition: all .15s ease;

    background-image: linear-gradient(90deg, var(--color-primary-hover), var(--color-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: center bottom;
    transition: all .15s ease;

    &:focus {
        color: var(--link-hover-color);
        background-size: 100% 2px;
    }

    @media (hover: hover) {
        &:where(:hover, :active) {
            color: var(--link-hover-color);
            background-size: 100% 2px;
        }
    }

    &.btn-secondary,
    &.calendar {
        min-height: 1.2rem;
        padding: 0;
        background-color: transparent;
        color: var(--link-color);
        text-align: start;
        text-transform: uppercase;

        &:where(:hover, :active, :focus) {
            background-color: transparent;
            color: var(--link-hover-color);
        }
    }

    &.calendar {
        text-transform: none;
    }
}

button:not(.toggler, .btn-secondary):where(:hover, :active, :focus) {
    background-color: var(--color-primary-hover);
}

.eventover[popover]:popover-open {
    position-area: bottom;
    text-transform: none;
    padding-block: 1rem;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
    align-content: center;
    gap: 2vw;
    --min-col-size: 100%;
    grid-template-columns: repeat(auto-fit, minmax(var(--min-col-size), 1fr));

    @media (width > 640px) {
        --min-col-size: calc(100% / 2 - 2vw);
    }

    @media (width > 920px) {
        --min-col-size: calc(100% / 3 - 2vw);
    }
}

h1,
h2,
h3,
h4 {
    text-transform: uppercase;
}

h1,
.h1 {
    font-size: var(--font-size-h1);
}

h2,
.h2 {
    font-size: var(--font-size-h2);
}

h3,
.h3 {
    font-size: var(--font-size-h3);
}

h4,
.h4 {
    font-size: var(--font-size-h4);
}

h5,
.h5 {
    font-size: var(--font-size-h5);
}

h6,
.h6 {
    font-size: var(--font-size-h6);
}

/* Header */

header {
    position: sticky;
    inset: 0 auto auto;
    width: 100%;
    height: var(--header-height);
    margin: auto;
    z-index: 9999;
    transition: all .5s ease;

    background-color: var(--body-bg);
    font-family: var(--font-condensed-semibold);
    font-weight: normal;
    cursor: auto;

    anchor-name: --header;

    & a {
        color: var(--body-color);
    }

    & nav {
        padding-inline: var(--main-padding-inline);
    }

    & .flex {
        align-items: center;
        gap: 1vw;
        height: var(--header-height);
        font-size: clamp(.75rem, .75rem + .5vw, .875rem);
    }

    & ul,
    & li {
        margin: 0;
        background-color: var(--body-bg);

        & button {
            width: 100%;
            height: 100%;
            padding: 0;
            text-align: start;
            white-space: nowrap;
            color: var(--body-color);
            background-color: transparent;
            background-image: linear-gradient(90deg, var(--color-primary-hover), var(--color-primary));
            background-size: 0% 2px;
            background-repeat: no-repeat;
            background-position: center bottom;
            transition: all .15s ease;

            &:is(:hover, :active, :focus) {
                color: var(--color-primary-hover);
                background-color: transparent;
                background-size: 100% 2px;

                /* .js-popover & {
                    color: currentColor !important;
                    background: none !important;
                } */
            }

            /* .js-popover & {
                color: currentColor;
                background: none;
            } */
        }

        & a {
            display: flex;
            align-items: center;
            background-color: var(--body-bg);
        }
    }
}

.navbar-main-menu.flex {
    flex-direction: column;
    height: 0;
    max-height: 100svh;
    padding: 0;
    visibility: hidden;

    @media (width > 920px) {
        position: relative;
        visibility: visible;
        opacity: 1;
        height: var(--header-height);
        margin-inline: auto 0;
        border: 0;
        transform: none;
        flex-direction: row;
    }

    & li {
        height: 100%;
    }

    @media (width <=920px) {
        --anchor: --header;

        &>.flex {
            width: 100%;
            height: 100%;

            & li {
                width: 100%;
            }
        }
    }

    & .main-menu {
        background-color: var(--body-bg);

        @media (width <=920px) {
            flex-direction: column;
            align-items: start;
            gap: 1ch;
            padding: 1rem;
            margin-block-end: 1rem;
        }
    }

    & .nav-link {
        height: 100%;
        padding-block: .5rem;
        line-height: 1;
        white-space: nowrap;

        &:where(:hover, :active, :focus, .active) {
            color: var(--color-primary-hover);
        }

        @media (width > 920px) {
            padding-block: calc((var(--header-height) - .875rem) / 2 + .25rem) calc((var(--header-height) - .875rem) / 2 - .25rem);

            &.dropdown-link {
                padding-block: .5rem;
            }
        }

        .submenu & {
            white-space: wrap;
        }
    }

    & .dropdown {
        width: 100%;
    }
}

.navbar-brand {
    position: relative;

    & a {
        justify-content: start;
        gap: 1ch;
        font-size: .75rem;
        text-transform: uppercase;
    }

    & .header-logo {
        width: 8rem;
        min-width: 4.2rem;
        aspect-ratio: 600 / 225;

        &.header-logo-lokal {
            transform: translateY(-.5rem);
        }

        @media (prefers-color-scheme: dark) {
            & .blue {
                fill: #fff;
            }
        }
    }

    & span {
        position: absolute;
        inset: auto 0 2px;
        margin-inline-end: 3px;
        text-align: center;
    }
}

.toggler {
    height: var(--header-height);
    padding: .35rem .5ch 0;
    background-color: transparent;

    & label {
        cursor: pointer;
    }

    & svg {
        display: block;
        width: 1rem;
        height: 1rem;
        fill: var(--body-color);

        .menu-toggler & {
            stroke: var(--body-color);
        }
    }

    &:where(:hover, :active, :focus) {
        border-radius: 0;

        & svg {
            fill: var(--color-primary-hover);

            .menu-toggler & {
                stroke: var(--body-color);
            }
        }
    }
}

.search-toggler {
    anchor-name: --search-btn;
}

.menu-toggler {
    order: 3;
    transition: all .15s ease;


    @media (width > 920px) {
        display: none;
    }

    & svg path {
        transition: all .15s ease;
    }

    & .x {
        visibility: hidden;
        opacity: 0;
    }

    nav:has(.navbar-main-menu[popover]:popover-open) & {
        & .ham {
            visibility: hidden;
            opacity: 0;
        }

        & .x {
            visibility: visible;
            opacity: 1;
        }
    }
}

.lang-switcher {
    display: flex;
    gap: .5ch;
    anchor-name: --lang-switcher-btn;

    & span {
        font-family: var(--font-condensed-semibold);
        font-size: 1rem;
        font-weight: normal;
        color: var(--body-color);

    }

    &:is(:hover, :active, :focus-within) * {
        color: var(--color-primary-hover);
        stroke-color: var(--color-primary-hover);
    }
}

.meta-navbar.flex {
    gap: 1px;
    margin-inline-start: auto;

    @media (width > 414px) {
        gap: 1ch;
    }

    & .lang-switcher.flex {
        gap: .15rem;
    }

    @media (width > 920px) {
        margin-inline-start: 0;
    }
}

.searchform {
    --anchor: --header;

    @media(width > 414px) {
        --anchor: --search-btn;
    }

    & form {
        gap: 0;
        align-items: stretch;
        justify-content: start;

        .section-searchform & {
            justify-content: center;
        }
    }

    & label {
        display: none;
    }

    & input[type="text"] {
        padding: .45rem 1ch;
        border: none;
        border: 1px solid var(--color-gray-90);
        border-radius: .15rem;
    }

    &.section-searchform {
        padding-block-end: 2.5vw;
    }
}

.bogo-language-switcher {
    --anchor: --lang-switcher-btn;

    &[popover]:popover-open {
        display: grid;
    }

    & li {
        height: auto;
        order: 10;

        &.sv {
            order: 1;
            text-transform: lowercase;
        }

        &.fi {
            order: 2;
            text-transform: lowercase;
        }

        &.en {
            order: 3;
        }

        &.et {
            order: 4;
            text-transform: lowercase;
        }

        & a {
            padding-block: .25rem;
        }
    }
}

[popover] {
    /* opacity: 0; */
    padding-block: 0;
    transform: translateY(-5%);
}

[popover]:popover-open {
    inset: var(--header-height) anchor(var(--anchor) end, 0) auto auto;
    border: none;
    width: calc(100% - 2vw);
    max-width: fit-content;
    height: auto;
    max-height: calc(100dvh - var(--header-height));
    overflow: scroll;
    padding: .5rem 1rem 1rem;
    box-shadow: 0 .35rem .5rem var(--body-color-10);
    border-radius: 0 0 .15rem .15rem;
    /* opacity: 1; */
    visibility: visible;
    transform: translateY(0);
    transition: transform .25s ease, opacity .35s ease, padding-block .25s ease;
    cursor: auto;

    @media (width > 920px) {
        width: fit-content;
        max-width: 20rem;
    }

    &:where(.navbar-main-menu) {
        @media (width <=920px) {
            flex-direction: column;
            padding: .25rem 0 1rem;
            width: fit-content;
            max-width: 20rem;
        }

        @media (width <=576px) {
            width: 100%;
            max-width: 20rem;
        }
    }

    & [popover]:popover-open {
        top: anchor(var(--anchor) bottom, var(--header-height));
    }

    .rtl & {
        inset: var(--header-height) auto auto anchor(var(--anchor) end, 0);
    }

    .event-details & li {
        margin-block-end: .25rem;
    }

    & .submenu {
        width: auto;
        height: auto;
        max-height: 50%;
        margin-inline: 0 auto;
        overflow: auto;
    }
}

@media (width <=920px) {
    .submenu[popover]:popover-open {
        inset-inline-start: anchor(var(--anchor) start, 0);
        max-width: calc(100% - 2vw);
        border: 1px solid var(--color-primary-hover);

        & .nav-link {
            line-height: 1.2;
            white-space: wrap;
        }
    }
}

@starting-style {
    [popover]:popover-open {
        opacity: 0;
        padding-block: 0;
        transform: translateY(-5%);
    }
}

body:has([popover]:popover-open) {
    overflow: hidden;
    cursor: url('img/x-circle-fill.svg'), auto;

    @media (prefers-color-scheme: dark) {
        cursor: url('img/x-circle-fill-white.svg'), auto;
    }
}

/* Popover polyfill */
:is([popover].\:popover-open) {
    inset: var(--header-height, 3rem) 1rem auto auto;
    border: none;
    width: calc(100% - 2vw);
    max-width: fit-content;
    height: auto;
    max-height: calc(100dvh - var(--header-height));
    overflow: scroll;
    padding: .5rem 1rem 1rem;
    box-shadow: 0 .35rem .5rem var(--body-color-10);
    border-radius: 0 0 .15rem .15rem;
    visibility: visible;
    transform: translateY(0);
    transition: transform .25s ease, opacity .35s ease, padding-block .25s ease;
    cursor: auto;

    @media (width > 920px) {
        width: fit-content;
        max-width: 20rem;
    }

    &:is(.navbar-main-menu) {
        @media (width <=920px) {
            flex-direction: column;
            padding: .25rem 0 1rem;
            width: fit-content;
            min-width: 15rem;
            max-width: 20rem;
        }

        @media (width <=576px) {
            width: 100%;
            max-width: fit-content;
        }
    }

    & :is([popover].\:popover-open) {
        top: var(--header-height, 3rem);
    }

    .rtl & {
        inset: var(--header-height, 3rem) auto auto 1rem;
    }

    .event-details & li {
        margin-block-end: .25rem;
    }

    & .submenu {
        width: auto;
        height: auto;
        max-height: 50%;
        margin-inline: 0 auto;
        overflow: auto;
    }

    @media (width <=920px) {
        .submenu:is([popover].\:popover-open) {
            inset-inline-start: 1rem;
            max-width: calc(100% - 2vw);
            border: 1px solid var(--color-primary-hover);

            & .nav-link {
                line-height: 1.2;
                white-space: wrap;
            }
        }
    }
}

.navbar-bc {
    display: none;
    position: fixed;
    inset: auto auto 0 1rem;

    .breadcrumb {
        justify-content: start;
        width: fit-content;
        gap: .25rem;
        padding: .5rem 1ch;
        line-height: 1;
        background-color: hsl(0 0% 100% / 0.5);
        border-radius: .25rem;
        z-index: 9999;
        box-shadow: .15rem .5rem 1rem hsl(0 0% 0% / 0.25);

        @media (prefers-color-scheme: dark) {
            background-color: hsl(0 0% 0% / 0.5);
        }

        @supports (backdrop-filter: blur(.5rem)) {
            background-color: hsl(0 0% 100% / 0.5);
            backdrop-filter: blur(.5rem);

            @media (prefers-color-scheme: dark) {
                background-color: hsl(0 0% 0% / 0.25);
                backdrop-filter: blur(.5rem);
            }
        }

        & li,
        & a {
            font-family: var(--font-condensed);
            font-size: .75rem;
            font-weight: 400;
            text-transform: uppercase;
            white-space: nowrap;
            background-color: transparent;
        }
    }
}

.hero {
    position: relative;
    display: grid;
    place-content: center;
    height: calc(80cqb - var(--header-height));
    min-height: 15rem;
    background-color: var(--color-primary);
    color: var(--body-bg);
    overflow: hidden;

    & .hero-image {
        position: absolute;
        inset: 0;
        z-index: 0;
        margin: 0;

        & .hero-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: 50% 50%;
        }
    }

    & .hero-caption {
        z-index: 1;
        width: fit-content;
        margin: auto;
        padding: 5cqi var(--main-padding-inline);
        text-align: center;
        text-wrap: balance;
        color: var(--body-bg);
        filter: drop-shadow(-1px -1px 0 hsl(0 0% 0% / 0.25));
        hyphens: none;
        text-wrap: balance;

        @media (prefers-color-scheme: dark) {
            color: var(--body-color);
        }

        & h1 {
            font-size: clamp(3rem, 8vw, 5rem);
            color: var(--body-bg);

            @media (prefers-color-scheme: dark) {
                color: var(--body-color);
            }
        }

        & .lead {
            font-family: var(--font-head);
            font-size: var(--font-size-h3);
            text-transform: uppercase;
        }
    }
}

main {
    padding-inline: var(--main-padding-inline);
    background-color: var(--main-bg);
    text-wrap: balance;

    .wp-singular:not(.home) & {
        padding-inline: var(--main-padding-inline);

        @media (width > 920px) {
            padding-inline: 0;
        }
    }

    .hero+& {
        padding-top: 5vw;
    }
}

section,
.section {
    text-align: center;
    padding-block: 2.5vw;

    .home &:first-of-type,
    &:has(.has-post-thumbnail) {
        padding-top: 0;
    }

    & .page-title,
    & .section-title {
        margin-block: 2.5vw;
        padding-inline: var(--main-padding-inline);
    }

    & .grid {
        gap: 2vw;
    }
}

article,
.news-article {
    justify-content: space-between;
    flex-direction: column;
    width: 100%;
    margin: 1rem auto;
    padding: 0;
    text-align: start;
    text-wrap: wrap;
    border-radius: .15rem;

    .rtl & {
        text-align: end;
    }

    .wp-singular &,
    .news-articles.grid & {
        margin: 0 auto;
        max-width: 65ch;
    }

    &.flex {
        justify-content: start;
    }

    @media (width > 576px) {

        .news-articles.grid & {
            background-color: var(--main-bg-light);
        }
    }

    & h1 {
        margin-block-start: 5vw;
    }

    & .featured-img {
        width: 100%;
        height: auto;
        aspect-ratio: 1.75;
        margin: 0;
        background: var(--main-bg-light) url('img/logo.svg') no-repeat 50% 50%;
        background-size: 50%;
        border-radius: .15rem;

        &.first-img {
            background-size: cover;
        }

        & img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: 50% 25%;
        }

        &.default-img {
            background-size: 50%;
        }

        & img {
            border-radius: .15rem .15rem 0 0;
        }
    }

    & .news-meta {
        margin-block: 1rem;
        font-family: var(--font-condensed);
        font-size: 1rem;
        line-height: 1;
        text-transform: uppercase;

        .featured-img+.news-content & {
            margin-block: 0 .5rem;
        }

        h3+.content-text & {
            margin-block-start: .5rem;
        }

        &.tags {
            margin-block-start: 1.5rem;
        }

        @media (prefers-color-scheme: dark) {
            color: var(--body-color);
        }

        h1+&,
        h2+&,
        h3+& {
            margin-block-start: .5rem;
        }
    }

    & .news-content {
        width: 100%;
        padding: 1rem 0;

        @media (width <=920px) {
            max-width: 65ch;
        }

        @media (width > 576px) {
            padding: 1rem var(--main-padding-inline);
        }

        & p:last-of-type {
            margin-block-start: -.5rem;
            margin-block-end: 0;
        }
    }

    .news &:first-child {
        display: flex;
        align-items: center;
        justify-content: center;

        @media (width > 640px) {
            grid-column: 1 / span 2;
            max-width: none;
        }

        @media (width > 920px) {
            grid-column: 1 / span 3;
            flex-direction: row;
        }

        &>* {
            width: 100%;
            height: auto;

            @media (width > 920px) {
                width: 50%;
            }
        }

        & .featured-img {
            aspect-ratio: 1.75;

            @media (width <=920px) {
                background-image: none !important;
            }

            @media (width > 920px) {
                height: 100%;
                aspect-ratio: auto;
                border-radius: 0;

                & img {
                    display: none;
                }
            }
        }

        & .news-content {
            position: relative;

            @media (width > 920px) {
                padding: 5vw;

                &::after {
                    display: block;
                    content: " ";
                    width: 2rem;
                    height: 2rem;
                    background: var(--main-bg-light);
                    position: absolute;
                    top: 50%;
                    margin-block-start: -10px;
                    inset-inline-start: -20px;
                    inset-inline-end: auto;
                    transform: rotate(45deg);
                }
            }
        }
    }

    & .content-text {
        position: relative;

        .page:not(.home) &,
        .single & {
            padding: 0 0 2.5vw;
        }

        & figure,
        & img,
        & .wp-caption {
            border-radius: .15rem;

            &:where(.alignright, .alignleft, .aligncenter, .alignnone) {
                float: none;
                margin-block: .5rem .75rem;
            }

            & img,
            &:where(.size-medium, .size-medium_large, .size-large, .size-full) {
                width: 100% !important;
            }

            @media (width > 414px) {
                &.alignright {
                    float: inline-end;
                    max-width: calc(50% - 1rem);
                    margin-inline-end: 0;
                    margin-inline-start: 1rem;
                }

                &.alignleft {
                    float: inline-start;
                    max-width: calc(50% - 1rem);
                    margin-inline-end: 1rem;
                    margin-inline-start: 0;
                }
            }

            & .wp-caption-text {
                margin-block-end: 0;
                padding: .25rem;
                font-size: .875rem;
                line-height: 1.2;
                font-family: var(--font-condensed-italic);
                font-style: italic;
            }
        }
    }
}

.some {

    @media (width > 920px) {
        position: absolute;
        top: 0;
        inset-inline-start: -3rem;

        footer & {
            position: relative;
            inset: auto;
        }
    }

    & ul {
        display: flex;
        gap: 1ch;

        @media (width > 920px) {
            flex-direction: column;
        }

        footer & {
            row-gap: 0;
            flex-direction: column;
        }
    }

    & a {
        background: none;
        line-height: 1;
    }

    & svg {
        width: 1rem;
        height: 1rem;
    }

    & img {
        transform: translate(0, -.1rem);
    }
}

.highlight {
    max-width: 65ch;
    margin-block: 2.5vw;
    margin-inline: auto;
    padding-bottom: 2.5vw;
    font-size: var(--font-size-h5);
    --min-col-size: 100%;

    @media (width > 1200px) {
        max-width: none;
        --min-col-size: calc(100% / 3 - 2vw);
    }

    & article {
        flex-direction: column;
        padding-inline: 2vw;
        background-color: transparent;
        text-align: center;

        @media (width > 1200px) {
            &:not(:first-child) {
                border-inline-start: 1px solid var(--color-gray-90);
            }
        }

        & p {
            -webkit-line-clamp: 7;
            line-clamp: 7;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
    }

    & .highlight-img {
        width: 5rem;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        object-position: 50%;
        margin-block: 1vw 2rem;
    }

    & .highlight-text {

        & .btn {
            margin-block-start: auto;
        }
    }
}

.page-content {
    padding: 1rem var(--main-padding-inline);
    font-size: 1rem;
    text-align: start;
    text-wrap: wrap;

    & article {
        margin-block: 2.5vw;
        padding-bottom: 5vw;
        text-align: start;
        background-color: transparent;
    }

    & .highlight-title,
    & .wp-block-heading {
        text-align: center;
    }
}

.pagination {

    & .btn,
    & .navigation {
        display: inline-block;
        margin-block: 2.5vw;
    }

    & .nav-links {
        font-family: var(--font-head);
        display: flex;
        gap: 1ch;
    }
}

.post-navigation.grid {
    --min-col-size: 100%;
    gap: 1.5rem;
    row-gap: 1rem;
    max-width: 65ch;
    margin: 2.5vw auto -2.5vw;

    @media (width > 1200px) {
        --min-col-size: calc(100% / 2 - 2vw);
        max-width: none;
    }

    & article {
        align-items: stretch;
        gap: 1.5rem;
        max-width: none;

        &:only-of-type {
            flex-direction: column;
            max-width: 65ch;
        }

        & .content-text {
            max-width: 65ch;
        }

        @media (width > 1200px) {
            flex-direction: row;
        }

        & .post-img {
            aspect-ratio: 1.75;
            margin: 0;
            background-color: var(--body-bg);

            @media (width > 1200px) {
                aspect-ratio: auto;
            }

            & img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: 50% 25%;
            }

            & .default-img {
                width: 200%;
                height: 200%;
                object-position: 50% 50%;
            }
        }

        & .prev-post-content,
        & .next-post-content {
            padding-bottom: 1rem;
            font-size: .875rem;

            .next-post & {
                order: 1;
            }

            & .news-meta {
                margin-block: 0 .5rem;
            }
        }
    }

    @media (width > 1200px) {

        & .prev-post-content,
        & .next-post-content {
            width: 66%;
            position: relative;

            &::after {
                display: block;
                content: " ";
                position: absolute;
                top: 1rem;
                inset-inline-end: auto;
                inset-inline-start: -2.5rem;
                width: 0;
                height: 0;
                margin-block-start: 0;
                border-top: 1rem solid transparent;
                border-bottom: 1rem solid transparent;
                border-inline-end: 1rem solid var(--main-bg);
            }

            .next-post & {
                &::after {
                    inset-inline-end: -3.5rem;
                    inset-inline-start: auto;
                    border-inline-end: 1rem solid transparent;
                    border-inline-start: 1rem solid var(--main-bg);
                }
            }
        }

        & .post-img {
            width: 33%;
            aspect-ratio: auto;

            .next-post & {
                order: 2;
            }

            & img {
                height: 100%;
                object-fit: cover;
                object-position: 50% 0;

                &.default-img {
                    object-fit: contain;
                    object-position: 50% 50%;
                    padding: 1rem;
                }
            }
        }

        & article:only-of-type>* {
            width: 100%;
        }
    }
}

footer.footer {
    padding-block: 3rem;
    background-color: var(--color-primary);
    color: #fff;
    text-align: start;

    & .grid {
        --min-col-size: 100%;

        @media (width >=768px) {
            --min-col-size: calc(100% / 2 - 2vw);
        }

        @media (width > 920px) {
            --min-col-size: calc(100% / 4 - 2vw);
        }
    }

    @media (prefers-color-scheme: dark) {
        background-color: var(--body-bg);
        color: var(--body-color);
    }

    & h3,
    & h4 {
        color: var(--body-bg);

        @media (prefers-color-scheme: dark) {
            color: var(--body-color);
        }
    }

    & a {
        display: inline;
        color: var(--body-bg);
        background-image: linear-gradient(90deg, var(--main-bg-light), var(--body-bg));
        background-size: 100% 1px;
        background-repeat: no-repeat;
        background-position: center bottom;
        transition: all .15s ease;

        @media (prefers-color-scheme: dark) {
            color: var(--body-color);
            background-image: linear-gradient(90deg, var(--body-color), var(--body-color));
        }

        &:where(:hover, :active, :focus) {
            color: var(--body-bg);
            background-size: 0% 1px;

            @media (prefers-color-scheme: dark) {
                color: var(--color-primary-hover);
            }
        }

        &:has(.logo) {
            background-image: none;
        }

        &.flex {
            display: inline-flex;
            justify-content: start;
            gap: .25rem;
        }
    }

    & ul {
        margin-block-end: 1vw;

        & img {
            filter: invert(1);
        }
    }
}

.news-meta.event-details {
    display: flex;
    flex-direction: column;
    gap: 1ch;
    row-gap: 1cqh;
    margin-block-start: 0;
    text-wrap: balance;

    & .flex {
        align-items: start;
        justify-content: start;
        gap: 1ch;
        line-height: 1;
    }

    & svg {
        width: .875rem;
        height: .875rem;
    }
}

add-to-calendar-button {
    &::part(atcb-button-wrapper) {
        --wrapper-padding: 0;
    }

    &::part(atcb-button) {
        margin-inline-start: 0;
        padding: 0;
        font-family: var(--font-condensed);
        font-size: 1rem;
        font-weight: 400;
        color: var(--link-color);
        background-color: transparent;
        background-image: linear-gradient(90deg, var(--color-primary-hover), var(--color-primary));
        background-size: 0% 2px;
        background-repeat: no-repeat;
        background-position: center bottom;
        box-shadow: none;
        border-radius: 0;
        transition: all .15s ease;
    }

    &::part(atcb-button):where(:hover, :active, :focus) {
        color: var(--link-hover-color);
        background-color: transparent;
        background-size: 100% 2px;
    }
}

.stretch {
    position: relative;
    width: 100vw !important;
    max-width: none;
    height: auto;
    aspect-ratio: auto !important;
    inset-inline-end: 50%;
    inset-inline-start: 50%;
    margin-inline-end: -50vw !important;
    margin-inline-start: -50vw !important;
    background: none !important;

    & img {
        width: 100%;
        max-height: 66dvh;
        object-fit: cover;
        object-position: 50% 25%;
    }
}

.page:not(.home) .news-article,
.single .news-article {
    display: grid;
    grid-template-columns: 1fr min(65ch, 100%) 1fr;
    max-width: 110ch;

    &>* {
        grid-column: 2;
    }

    & figure.breakout {
        width: 100%;
        grid-column: 1 / -1;
        aspect-ratio: 2.25;
    }
}

/* https://piccalil.li/blog/styling-tables-the-modern-css-way/ */
table {
    border-collapse: collapse;
    max-width: 100%;
    table-layout: fixed;
}

th,
caption {
    text-align: start;
}

caption {
    margin-block: 0.75rem;
}

/* thead th:not(:first-child),
td {
  text-align: end;
} */

thead {
    background: whitesmoke;
}

tfoot {
    border-block: 2px solid;
    background: whitesmoke;
}

th,
td {
    width: auto;
    padding: 0.5vw;
    line-height: 1.2;
    border: none;
    vertical-align: baseline;

    tr:nth-child(even) & {
        background-color: rgb(200 200 200 / 0.1);
    }
}

th:first-child {
    position: sticky;
    inset-inline-start: 0;
}

tbody th {
    background: white;
}

thead th,
tfoot th {
    background: whitesmoke;
}

thead th {
    vertical-align: bottom;
}

th:first-child::after {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: 1px;
    height: 100%;
    background: lightgrey;
}

.wp-block-pdfemb-pdf-embedder-viewer {
    margin-block-end: 1rem;
}

@media (hover: hover) {
    [data-info] {
        position: relative;
    }

    [data-info]::after {
        display: block;
        position: absolute;
        content: attr(data-info);
        inset: -1.6rem auto auto 0;
        z-index: 100;
        width: fit-content;
        white-space: nowrap;
        font-size: .875rem;
        text-transform: none;
        padding: 1ch;
        color: var(--body-color);
        background: var(--body-bg);
        border-radius: .15rem;
        box-shadow: 0 .1rem .35rem #ccc;
        visibility: hidden;
    }

    [data-info]:hover::after {
        visibility: visible;
    }
}