@keyframes imageLoading {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.block_image_slide {
    > .wp-block-image {
        position: relative;
        display: grid;
        gap: 1em;

        &::after {
            animation: imageLoading 1s ease-in-out infinite;
        }

        &.processing {
            img {
                background-color: var(--wp--preset--color--primary-navy-900);
                filter: grayscale(1) brightness(0.5);
            }

            &::after {
                background-color: var(--wp--preset--color--primary-orange-900);
                transform: translate(-50%, -50%);
                content: "";
                width: 20px;
                height: 20px;
                border-radius: 4px;
                position: absolute;
                left: 50%;
                top: 50%;
            }
        }

        img {
            transition: filter 300ms ease-in-out;
            position: relative;
            border-radius: 8px;
            width: 100%;
        }

        figcaption {
            background-color: var(--wp--preset--color--primary-navy-900);
            color: var(--wp--preset--color--white);
            padding: 1.5em;
            border-radius: 8px;
            margin-block: 0;
            display: grid;
            gap: 0.6em;

            @media (width > 720px) {
                width: calc(100% - 5em);
                position: absolute;
                bottom: 1em;
                left: 1em;
            }
        }
    }

    > .wp-block-gallery {
        &.has-nested-images {
            display: grid;

            @media (width > 720px) {
                grid-template-columns: repeat(4, 1fr);
            }

            @media (width < 720px) {
                grid-auto-flow: column;
                grid-auto-columns: 40%;
                overflow-y: hidden;
                overflow-x: auto;
                scrollbar-width: none;
                justify-content: start;
                width: 100%;
            }

            @media (width < 500px) {
                grid-auto-columns: 80%;
            }
        }

        button {
            overflow: hidden;
            border-radius: 8px;
            cursor: pointer;
            border: none;
            padding: 0;

            figure {
                margin: 0;
                display: flex;
                justify-content: center;

                img {
                    display: block;
                }

                figcaption {
                    display: none;
                }
            }
        }
    }
}
