.block {
    & .content {
        width: var(--max-width--content);
        margin-inline: auto;
    }
}

.detras-del-espejo:not(:has(header.block.entry-header)),
.post:not(:has(header.block.entry-header)) {
    opacity: 0;
    transform: translateY(60px);
    display: grid;
    border-radius: 1.6rem 1.6rem 1rem 1rem;
    transition: opacity .3s ease, transform .3s ease;

    &.animate-in {
        opacity: 1;
        transform: translateY(0);
    }

    &:is(.format-video, .format-image, .format-gallery) {
        & .post-body {
            grid-template-rows: 1fr auto auto;

            & .post-body__header {
                height: 100%;

                & .post--tags {
                    & .post-tag {
                        border-radius: .5rem;
                    }
                }
            }
        }
    }

    &:is(.format-aside, .format-quote) {
        & .post-body {
            grid-template-rows: 1fr auto;
            padding-top: 0;

            & .post-body__content {
                grid-template-rows: 1fr auto;

                & .post--content {
                    p {
                        font-size: clamp(2rem, 5vw, 2.2rem) !important;
                        line-height: 1.4;
                        font-weight: 500;

                        &:not(:last-child) {
                            margin-bottom: 1rem;
                        }

                        &.has-medium-font-size {
                            font-size: var(--wp--preset--font-size--medium) !important;
                        }
                    }
                }
            }
        }
    }

    & .post-body {
        border-radius: inherit;
        display: grid;
        grid-template-rows: auto 1fr auto;
        border: 1px solid light-dark(var(--wp--preset--color--accent-6), var(--wp--preset--color--accent-6));
        padding-top: .5rem;
        overflow: hidden;
        transition: box-shadow .3s ease;

        &:hover {
            box-shadow: 0 0 0 1px var(--wp--preset--color--main);
        }

        & .post-body__header {
            position: relative;
            width: calc(100% - 1rem);
            margin-inline: auto;
            padding: .9rem 1rem;
            border-radius: 1rem;
            overflow: hidden;
            aspect-ratio: 3 / 2;
            background-color: light-dark(var(--wp--preset--color--secondary), var(--secondary-dark));

            & :is(.wp-post-image, .post-video-wrapper video, .gallery-wrapper) {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: inherit;
                z-index: 0;
                box-shadow: inset 0 0 7px var(--wp--preset--color--main-alpha-10);
                transition: filter .3s ease;

                & img {
                    transition: filter .3s ease;
                }

                &:hover {
                    & img {
                        filter: brightness(1.05);
                    }
                }

                & .gallery {
                    border-radius: inherit;

                    & .slide {
                        perspective: 1000px;
                        border-radius: .75rem;
                        box-shadow: 0 0 7px var(--wp--preset--color--main-alpha-10);

                        & img {
                            border-radius: .75rem;
                            width: 100%;
                            height: 100%;
                            object-fit: cover;
                        }
                    }
                }

                & .gallery-navigation {
                    padding: .3rem;
                    position: absolute;
                    bottom: 0;
                    left: 0;

                    & .btn-pagination {
                        border-radius: .75rem;
                    }
                }
            }

            & .gallery-wrapper {
                padding: .3rem;
            }

            & .post--tags {
                position: relative;
                z-index: 1;
            }

            & .post--permalink {
                position: absolute;
                z-index: 2;
                top: .3rem;
                right: .3rem;
                border-radius: .75rem;
                transition: background-color .3s ease-in-out, backdrop-filter .3s ease-in-out;

                & svg {
                    filter: drop-shadow(0 0 0.1rem var(--wp--preset--color--main-alpha-50));
                    fill: var(--wp--preset--color--base);
                }

                &:hover {
                    backdrop-filter: blur(7px);
                    background-color: var(--wp--preset--color--contrast-alpha-50);
                }
            }
        }

        & .post-body__content {
            padding: .5rem;
            overflow: hidden;
            display: grid;
            grid-template-rows: auto 1fr auto;
            padding: .5rem;

            & .post--permalink {
                transition: color .3s ease;

                &:hover {
                    color: var(--wp--preset--color--main);
                }

                &:focus-visible {
                    outline: none;
                    color: orangered;
                }

                & .post--title {
                    font-weight: 600;
                }
            }

            & .post--excerpt {
                font-size: calc(var(--wp--preset--font-size--small) + 1.5px);
            }

            & .post--date {
                margin-top: 1rem;
                display: inline-flex;
                align-items: baseline;
                gap: .5rem;
                font-size: var(--wp--preset--font-size--small);
                opacity: .7;

                & svg {
                    width: 13px;
                    height: 13px;
                    position: relative;
                    top: 1px;
                }

                & p {
                    text-transform: capitalize;
                }
            }
        }

        & .post-body__footer {
            display: flex;
            align-items: center;
            overflow: hidden;
            height: 48px;
            position: relative;
            border-top: 1px dashed light-dark(var(--wp--preset--color--accent-6), var(--wp--preset--color--accent-6));

            & .post--tags {
                display: flex;
                padding: .5rem;
                gap: 3px;
                flex-wrap: nowrap;
                overflow-x: auto;
                scrollbar-gutter: stable;

                &::-webkit-scrollbar {
                    height: 6px;
                    background: transparent;
                }

                &::-webkit-scrollbar-thumb {
                    background-color: transparent;
                    border-radius: 3px;
                    transition: background-color .3s ease;
                }
            }

            &:hover .post--tags::-webkit-scrollbar-thumb {
                background-color: rgba(0, 0, 0, .3);
            }

            &::after {
                position: absolute;
                content: '';
                bottom: 6px;
                right: -.5rem;
                width: 20%;
                height: calc(100% - 6px);
                background: linear-gradient(to left,
                        light-dark(var(--wp--preset--color--base), #0c0e10) 0%,
                        transparent 100%);
                z-index: 1;
                border-radius: 1rem;
            }
        }
    }
}

.glass-backdrop {
    background-color: light-dark(var(--wp--preset--color--base-alpha-50), var(--wp--preset--color--contrast-alpha-50));
    backdrop-filter: blur(7px);
}

.glass-bright {
    position: relative;

    &::before,
    &::after {
        position: absolute;
        content: '';
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 1px solid light-dark(hsla(0, 0%, 100%, 0.849), hsla(0, 0%, 100%, 0.849));
        mask-image: linear-gradient(135deg, light-dark(hsla(0, 0%, 100%, 0.849), hsla(0, 0%, 100%, 0.849)), light-dark(hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0)) 50%);
        mask-position: 0 0;
        transition: mask-position .5s ease;
        border-radius: inherit;
        corner-shape: inherit;
        z-index: 1;
    }

    &::after {
        mask-image: linear-gradient(135deg, light-dark(hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0)) 76%, light-dark(hsla(0, 0%, 100%, 0.644), hsla(0, 0%, 100%, 0.644)));
    }
}

.glass-reflex {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transform: skewX(340deg) translateX(-70%);
    transition: transform .6s ease-in-out, filter .5s ease-in-out;
    filter: blur(5px);
    z-index: 1;

    &:hover {
        transform: skewX(340deg) translateX(70%);
        filter: blur(8px);
    }
}

.post-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: .438rem;
    height: 26px;
    border: 1px solid light-dark(var(--wp--preset--color--accent-6), var(--wp--preset--color--accent-6));
    transition: border-color .3s ease, box-shadow .3s ease;
    padding: 0 .7rem;
    border-radius: 6px;

    &.glass-backdrop {
        border-width: 0;
    }

    &.small {
        font-size: var(--wp--preset--font-size--small);

        &.post-format-label {
            & svg {
                width: 16px;
                height: 16px;
            }
        }

        & svg {
            width: 13px;
            height: 13px;
        }
    }

    &:hover {
        border-color: var(--wp--preset--color--main);
        box-shadow: var(--input-shadow);
    }

    &:focus {
        border-color: var(--wp--preset--color--main);
        box-shadow: 0 0 0 1px var(--wp--preset--color--main),
                    var(--input-shadow);
    }

    &:focus-visible {
        border-color: orangered;
        box-shadow: 0 0 0 .2rem #ff44007e;
        z-index: 1;
        outline: none;
    }

    &:active {
        transform: translateY(1px);
        box-shadow: 0 0 0 1px var(--wp--preset--color--main),
                    var(--input-shadow);
    }
}

ul {
    & li {
        & a {
            transition: color .3s ease;

            &:hover {
                color: var(--wp--preset--color--main);
            }

            &:focus-visible {
                outline: none;
                color: orangered;
            }
        }
    }
}

.social {
    & .menu {
        display: flex;
        align-items: center;
        gap: 2rem;

        & li {
            & a {
                position: relative;
                display: grid;
                font-size: 0;

                &::before {
                    position: relative;
                    content: '';
                    display: block;
                    width: 1rem;
                    height: 1rem;
                    transition: background-color .3s ease-in-out;
                    background-color: currentColor;
                }

                &:hover {
                    &::before {
                        background-color: var(--wp--preset--color--main);
                    }
                }

                &:focus-visible {
                    outline: none;

                    &::before {
                        background-color: orangered;
                    }
                }
            }
        }
    }
}

.gallery-navigation,
.slideshow-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    & .bullets {
        padding-left: 0;
        background-color: transparent;
        display: flex;
        align-items: center;
        gap: 20px;
        margin-inline: auto;
        list-style: none;
        border-radius: 9px;

        &:has(svg) {
            gap: .5rem;
            color: light-dark(var(--wp--preset--color--main), var(--main-light));
        }

        & .bullet {
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background-color: light-dark(var(--gallery-bullet), var(--dark-gallery-bullet));
            border: none;
            cursor: pointer;

            &.active {
                background-color: var(--wp--preset--color--main);
            }
        }
    }
}

.btn-pagination {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: grid;
    place-content: center;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 1rem;
    position: relative;
    transition: background-color .3s ease;
    background-color: transparent;

    & svg {
        width: 32px;
        height: 32px;
    }

    &.small-pagination {
        width: 46px;
        height: 46px;
        border-radius: .5rem;

        & svg {
            width: 24px;
            height: 24px;
        }
    }

    &:hover {
        cursor: pointer;
        background-color: light-dark(var(--hover-gallery-button), var(--dark-hover-gallery-button));
    }

    & svg {
        transition: fill .3s ease;
        fill: light-dark(var(--wp--preset--color--contrast), var(--wp--preset--color--base));
    }

    &.glass-backdrop {
        background-color: transparent !important;

        & svg {
            fill: var(--wp--preset--color--base);
        }

        &:hover {
            background-color: light-dark(var(--wp--preset--color--base-alpha), var(--base-alpha-dark)) !important;

            & svg {
                fill: light-dark(var(--wp--preset--color--contrast), var(--contrast-dark));
            }
        }
    }

    &:focus-visible {
        outline: none;
        background-color: orangered;

        & svg {
            fill: var(--wp--preset--color--base);
        }
    }

    &:active {
        transform: translateY(.5px);
    }
}

.wp-block-search__inside-wrapper {
    position: relative;

    & .wp-block-search__button {
        position: absolute;
        top: 2px;
        right: 2px;
        height: 34px;
        width: 38px;
        padding: 0;
        display: grid;
        place-content: center;
        box-shadow: none;
        background-color: transparent;
        color: light-dark(var(--wp--preset--color--contrast), var(--wp--preset--color--base));
        transition: background-color .3s ease;

        &:hover {
            filter: brightness(1) !important;
            background-color: light-dark(var(--hover-gallery-button), var(--dark-hover-gallery-button));
        }
    }
} 

@media (width < 600px) {
    .detras-del-espejo:not(:has(header.block.entry-header)),
    .post:not(:has(header.block.entry-header)) {
        &:is(.format-video, .format-image, .format-gallery) {
            & .post-body {
                & .post-body__header {
                    aspect-ratio: 4 / 5;
                }
            }
        }
    }

    .slideshow-navigation {
        & .bullets {
            display: none;
        }
    }
}

@media (width >=600px) {
    .detras-del-espejo:not(:has(header.block.entry-header)),
    .post:not(:has(header.block.entry-header)) {
        &:is(.format-video, .format-image, .format-gallery) {
            & .post-body {
                & .post-body__header {
                    min-height: 350px;
                }
            }
        }
    }
}

body.is-chromium {
    .detras-del-espejo:not(:has(header.block.entry-header)),
    .post:not(:has(header.block.entry-header)) {
        border-radius: 2.7rem 2.7rem 1.5rem 1.5rem;
        corner-shape: squircle;

        & .post-body {
            corner-shape: squircle;

            & .post-body__header {
                border-radius: 2rem;
                corner-shape: squircle;

                & .post--tags {
                    & .post-tag {
                        border-radius: 1rem;
                    }
                }

                & :is(.wp-post-image, .post-video-wrapper video, .gallery-wrapper) {
                    border-radius: inherit;
                    corner-shape: squircle;

                    & .gallery {
                        & .slide {
                            border-radius: 1.6rem;
                            corner-shape: squircle;

                            & img {
                                border-radius: 1.6rem;
                                corner-shape: squircle;
                            }
                        }
                    }

                    & .gallery-navigation {
                        & .btn-pagination {
                            border-radius: 2.5rem;
                        }
                    }
                }

                &>.post--permalink {
                    border-radius: 1.7rem;
                }
            }

            & .post-body__footer {
                & .post--tags {
                    &:has(:nth-child(3)) {
                        padding-bottom: .1rem;
                    }
                }
            }
        }
    }

    & .post-tag {
        border-radius: 1rem;
        corner-shape: squircle;
    }

    & .btn-pagination {
        border-radius: 2rem;
        corner-shape: squircle;

        &.small-pagination {
            border-radius: 1rem;
        }
    }
}

/* @keyframes slide-active {
    0% {
        opacity: .25;
        transform: scale(.5);
    }

    2% {
        opacity: 1;
        transform: scale(1);
    }

    99.99% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: .25;
        transform: scale(.5);
    }
} */