/*
    Block: Blog Category Carousel
    Note: Selectors must start with .block-blog-category-carousel
*/

@layer blocks {
    .block-blog-category-carousel .swiper {
        overflow: visible;
    }

    .block-blog-category-carousel .swiper {
        display: grid;
        column-gap: 7.5rem;
        row-gap: 4.375rem;
        grid-template-columns: 738fr 413fr;
        align-items: end;
    }

    .block-blog-category-carousel .swiper-wrapper {
        grid-column: 1 / span 2;
    }

    .block-blog-category-carousel .actions {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .block-blog-category-carousel .category-tile {
        background: var(--c-white);
        border-radius: .5rem;
        border: 1px solid var(--c-dark-15-tint);
        padding: 1.875rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        aspect-ratio: 1.525;
        position: relative;
        overflow: clip;
        transition: background-color 200ms ease-out;
    }

    .block-blog-category-carousel .category-tile .category__icon {
        width: 2.5rem;
        height: 2.5rem;
        color: var(--c-feature);
        flex-shrink: 0;
    }

    .block-blog-category-carousel .category__title {
        text-decoration: none;
        margin: 0;
    }

    .block-blog-category-carousel .category-tile .data-wrapper {
        --pad: 1.25rem;
        transform: translateY(var(--pad));
        transition: transform 200ms ease-out;
        gap: 0;
    }

    .block-blog-category-carousel .category-tile .category__link {
        --pad: 1.25rem;
        margin-top: var(--pad);
        max-height: 0;
        transition: 200ms ease-out;
        transition-property: max-height, opacity;
        opacity: 0;
    }

    .block-blog-category-carousel .category-tile:is(:hover, :focus-within) .data-wrapper {
        transform: translateY(0);
    }

    .block-blog-category-carousel .category-tile:is(:hover, :focus-within) .category__link {
        max-height: var(--max-height, 10rem);
        --max-height: .75rem;
        opacity: 1;
    }

    .block-blog-category-carousel .category-tile:is(:hover, :focus-within) {
        background-color: var(--c-dark-15-tint)
    }


    @media screen and (width <= 920px) {
        .block-blog-category-carousel .swiper {
            grid-template-columns: 1fr;
            row-gap: 1.5625rem;
            column-gap: 0;
        }
        .block-blog-category-carousel .actions {
            order: 3;
            flex-direction: column-reverse;
        }
        .block-blog-category-carousel .actions .buttons {
            justify-content: space-between;
            gap: 1rem;
            width: 100%;
        }
        .block-blog-category-carousel .swiper-pagination-progressbar {
            margin-block: 0 1.5625rem;
            width: 100%;
        }
        .block-celebrity-reels-carousel .swiper-navigation {
            gap: 0.4375rem;
        }
        .block-blog-category-carousel .category-tile {
            aspect-ratio: 1.444;
        }
        .block-blog-category-carousel .text-content {
            margin-bottom: .9375rem;
        }
    }
}
