/* Common */

html.is-smooth-scroll {
    scroll-behavior: smooth;
}

/* Block helpers */

.wp-block-template-part:empty {
    display: none;
}

.wp-block-button__link {
    word-break: keep-all;
}

.wp-block-post-featured-image > a,
.wp-block-post-featured-image > img,
.wp-block-post-featured-image > a > img {
    aspect-ratio: inherit;
}

/* Post link blocks */

:root :where(.wp-block-post-title) > a {
    text-decoration-color: transparent;
    text-decoration-line: underline;
    text-decoration-thickness: 0.125em;
    transition: text-decoration-color 0.25s ease-out;
}

:root :where(.wp-block-post-terms) a {
    text-decoration-color: transparent;
    text-decoration-thickness: 0.125em;
    transition: text-decoration-color 0.25s ease-out;
}

:root :where(.is-style-no-underline) a {
    text-decoration-color: transparent;
    text-decoration-style: underline;
    text-underline-offset: 0.125em;
    transition: text-decoration-color 0.25s ease-out;
}

:root :where(.wp-block-post-title) > a:focus,
:root :where(.wp-block-post-title) > a:hover {
    text-decoration-color: var(--wp--preset--color--primary, currentColor);
}

:root :where(.wp-block-post-terms) a:focus,
:root :where(.wp-block-post-terms) a:hover {
    text-decoration-color: var(--wp--preset--color--primary, currentcolor);
}

:root :where(.is-style-no-underline) a:focus,
:root :where(.is-style-no-underline) a:hover {
    text-decoration-color: currentcolor;
}

.wp-block-cover.is-style-sticky ~ * {
    position: relative;
}

/* Header */

.is-style-header-fixed {
    position: fixed;
    width: 100%;
}

.js-transparent-header .is-style-header-fixed {
    transition: background-color 0.5s ease-out;
}

.js-transparent-header.js-scroll-top .is-style-header-fixed {
    background-color: transparent !important;
}

/* Footer */

.wp-block-slick-attribution {
    align-items: baseline;
    transform: translateY(0.25em);
}

/* Menu block */

.wp-block-menu .menu-item-title {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--20);
}

.wp-block-menu .menu-item-description {
    font-size: 0.875em;
}

.wp-block-menu .menu-item > a {
    font-weight: 500;
    text-decoration-color: transparent;
    text-underline-offset: 0.125em;
    transition: color 0.25s ease-out;
    transition-property: color, text-decoration-color;
}

.wp-block-menu .menu-item > a:focus,
.wp-block-menu .menu-item > a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration-color: currentcolor;
}

.wp-block-menu .menu-item > a > img {
    aspect-ratio: 1 / 1;
    border-radius: var(--wp--preset--spacing--30);
    box-sizing: border-box;
    height: 2em;
    object-fit: contain;
    width: auto;
}

.wp-block-menu .menu--header {
    --menu-gap: 2.5em;

    justify-content: flex-end;
}

.wp-block-menu .menu--header .menu-item {
    position: relative;
}

.wp-block-menu .menu--header .current-menu-item > a {
    text-decoration: underline;
}

.wp-block-menu .menu--header .menu-item > .sub-menu {
    --submenu-gap: var(--wp--preset--spacing--60);

    animation: header-submenu-appear 0.25s ease-out forwards;
    background-color: var(--wp--preset--color--contrast);
    border-radius: 0.375rem;
    display: none;
    left: calc(var(--wp--preset--spacing--60) * -1);
    margin-top: var(--wp--preset--spacing--60);
    min-width: 20rem;
    padding: var(--wp--preset--spacing--60);
    position: absolute;
    top: 100%;
    width: calc(100% + var(--wp--preset--spacing--60) * 2);
    z-index: 10;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu {
    border: 1px solid var(--wp--preset--color--primary);
}

.wp-block-menu .menu--header .menu-item > .sub-menu .menu-item {
    padding-bottom: var(--submenu-gap);
}

.wp-block-menu .menu--header > .menu-item > .sub-menu > .menu-item {
    border-bottom: 1px solid currentcolor;
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.wp-block-menu .menu--header .menu-item > .sub-menu .menu-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.wp-block-menu .menu--header .sub-menu .sub-menu {
    --submenu-gap: var(--wp--preset--spacing--50);

    border-radius: 0;
}

.wp-block-menu .menu--header .sub-menu .sub-menu .sub-menu {
    --submenu-gap: var(--wp--preset--spacing--40);

    margin-top: var(--wp--preset--spacing--50);
}

.wp-block-menu .menu--header .menu-item > a {
    align-items: center;
    display: flex;
    gap: var(--wp--preset--spacing--20);
}

.wp-block-menu .menu--header .sub-menu .menu-item-title {
    font-size: var(--wp--preset--font-size--small);
    gap: var(--wp--preset--spacing--40);
    line-height: 1.2;
}

.wp-block-menu .menu--header .sub-menu .menu-item-description {
    font-weight: 400;
    line-height: 1.5;
}

.wp-block-menu .menu--header .sub-menu .menu-item > a > img {
    background-color: rgba(245, 210, 46, 0.15);
    border: 2px solid currentcolor;
    border-radius: var(--wp--preset--spacing--40);
    height: 6em;
    padding: var(--wp--preset--spacing--50);
    width: 6em;
}

.wp-block-menu .menu--header > .menu-item-has-children > a {
    align-items: center;
    display: flex;
}

.wp-block-menu .menu--header > .menu-item-has-children > a::after {
    background-image: url('../icons/chevron-down-white.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: transparent;
    content: '';
    display: inline-flex;
    height: 1.5em;
    min-width: 1em;
    padding-inline-start: 1em;
    transition: transform 0.25s ease-out;
    width: auto;
}

.wp-block-menu .menu--header > .menu-item:last-of-type > .sub-menu {
    left: unset;
    right: calc(var(--wp--preset--spacing--60) * -1);
}

.wp-block-menu .menu--header .menu-item > .sub-menu a {
    box-sizing: border-box;
    gap: var(--wp--preset--spacing--60);
    width: 100%;
}

.wp-block-menu .menu--header .menu-item > .sub-menu:focus-within,
.wp-block-menu .menu--header > .menu-item > .sub-menu:hover,
.wp-block-menu .menu--header .menu-item-has-children:focus-within > .sub-menu,
.wp-block-menu .menu--header > .menu-item-has-children > a:focus + .sub-menu,
.wp-block-menu .menu--header > .menu-item-has-children > a:hover + .sub-menu {
    display: flex;
}

.wp-block-menu .menu--header .menu-item-has-children:focus-within > a::after,
.wp-block-menu .menu--header > .menu-item-has-children:hover > a::after,
.wp-block-menu .menu--header > .menu-item-has-children > a:focus::after,
.wp-block-menu .menu--header > .menu-item-has-children > a:hover::after {
    transform: rotateX(180deg);
}

.wp-block-menu .menu--header > .menu-item > .sub-menu::before {
    border-radius: inherit;
    box-sizing: border-box;
    content: '';
    display: block;
    height: var(--wp--preset--spacing--60);
    height: 100%;
    left: 0;
    opacity: 0.5;
    padding-bottom: var(--wp--preset--spacing--60);
    position: absolute;
    top: calc(var(--wp--preset--spacing--60) * -1 - 1px);
    width: 100%;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a > .menu-item-title {
    position: relative;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a > .menu-item-title::before {
    aspect-ratio: 1;
    background-color: var(--wp--preset--color--primary);
    border-radius: 50%;
    content: '';
    height: 0.25em;
    position: absolute;
    right: calc(100% + 0.5em);
    top: 50%;
    transform: translateY(-50%);
    width: 0.25em;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a > img + .menu-item-title::before {
    content: none;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu .menu-item-has-children .sub-menu {
    box-sizing: border-box;
    padding: 0;
    position: static;
    width: auto;
}

.wp-block-menu .menu--header > .menu-item > .sub-menu .menu-item-has-children > .sub-menu {
    padding-left: var(--wp--preset--spacing--60);
}

.wp-block-menu .menu--header > .menu-item > .sub-menu .menu-item-has-children > a::after {
    background-image: url('../icons/chevron-down-white.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: transparent;
    content: '';
    display: inline-flex;
    height: 1.125em;
    margin-inline-start: auto;
    min-width: 1em;
    padding-inline-start: 1em;
    transition: transform 0.25s ease-out;
    width: auto;
}

.wp-block-menu .menu--footer {
    --menu-gap: 1em;
}

@media screen and (max-width: 991px) {
    .wp-block-menu .menu--header {
        --menu-gap: 1em;

        row-gap: 0.75em;
    }

    .wp-block-menu .menu--footer {
        --menu-gap: 0.75em;
    }
}

@keyframes header-submenu-appear {
    from {
        opacity: 0;
        transform: translateY(-0.25rem) scale(0.975);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Button block */

.wp-block-button > .wp-block-button__link {
    transition: all 0.25s ease-out;
    transition-property: background-color, border-color, color;
}

.wp-block-button > .wp-block-button__link:focus,
.wp-block-button > .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--black) !important;
    border-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--base) !important;
}

.wp-block-button > .wp-block-button__link:focus {
    outline-offset: 0.125em;
}

.wp-block-button > .wp-block-button__link:active {
    background-color: var(--wp--preset--color--base) !important;
    border-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--black) !important;
    transition-duration: 10ms;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
    transition-property: background-color, color;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--black);
    color: var(--wp--preset--color--base);
}

/* Read More block */

:root :where(.wp-block-read-more) {
    transition: all 0.25s ease-out;
    transition-property: background-color, border-color;
}

:root :where(.wp-block-read-more):focus,
:root :where(.wp-block-read-more):hover {
    background-color: transparent !important;
    border-color: currentcolor;
}

/* Cover block */

.wp-block-cover__image-background--fallback {
    background-position: center;
    background-size: cover;
}

/* Post Link block */

.wp-block-post-link {
    height: 100%;
    transition: background-color 0.25s ease-out;
}

.wp-block-post-link:focus-within,
.wp-block-post-link:hover {
    background-color: #f5f5f5;
}

.wp-block-post-link .wp-block-post-featured-image {
    transition: transform 0.25s ease-out;
}

.wp-block-post-link:hover .wp-block-post-featured-image {
    transform: scale(1.025);
}

/* Social Links block */

.wp-block-social-link {
    transform-origin: left;
    transition-duration: 0.5s;
}

.wp-block-social-link-anchor {
    transition: color 0.5s ease-out;
}

.wp-block-social-link-anchor:focus,
.wp-block-social-link-anchor:hover {
    color: var(--wp--preset--color--primary) !important;
}

/* Splide Carousel block */

@media screen and (max-width: 781px) {
    .wp-block-cloudcatch-splide-carousel-item.is-style-wide {
        min-width: 200%;
    }
}

@media screen and (max-width: 599px) {
    .wp-block-cloudcatch-splide-carousel-item.is-style-wide {
        min-width: 400%;
    }
}
