.base-slider {
    overflow: hidden;

    .swiper-slide {
        height: auto;

        img, video {
            height: 100%;
        }
    }
}

.base-slider:not(.swiper-initialized) {
    .swiper-wrapper {
        display: flex;
        flex-wrap: nowrap;
    }

    .swiper-slide {
        flex-shrink: 0;
        width: calc(100% - 20px);

        @media screen and (min-width: 1024px) {
            width: calc(50% - 1px);
        }

        @media screen and (min-width: 1024px) {
            width: 25%;
        }
    }
}

.base-slider-heading,
.section-heading {
    gap: 15px;
    padding: 15px 10px;
    overflow: hidden;

    &:not(:has(.card-slider__description, .section-heading__description)) {
        display: flex;

        @media screen and (min-width: 1024px) {
            justify-content: space-between;
        }
    }

    @media screen and (max-width: 1023.98px) {
        &:not(:has(.js-slider-nav)) {
            display: flex;
            flex-direction: column;
            justify-content: unset;
        }

        &:has(.js-slider-nav) .heading-controls {
            display: contents;

            .js-slider-nav {
                margin-left: auto;
            }
        }
    }

    @media screen and (min-width: 1024px) {
        padding: 20px;

        &:has(.card-slider__description, .section-heading__description) {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            align-items: center;

            .heading-controls {
                grid-column: 1 / 3;
            }

            .card-slider__description,
            .section-heading__description {
                grid-column: 3 / 8;
            }

            .card-slider__link {
                grid-column: 8 / 9;
                justify-self: end;
            }
        }
    }
}

.section-heading {
    @media screen and (max-width: 1023.98px) {
        padding-top: 0;
    }
}

.section-heading__description {
    font-size: var(--font-size-f0);

    @media screen and (min-width: 1024px) {
        font-size: var(--font-size-f1);
    }
}

.card-slider__link > a {
    position: relative;

    /* Extend the clickable area 10px beyond the link on every side */
    &::after {
        content: '';
        position: absolute;
        inset: -10px;
    }
}

.heading-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.js-slider-nav {
    display: flex;
    gap: 15px;

    .swiper-button-disabled {
        color: var(--secondary-foreground);
    }

    .swiper-button {
        position: relative;

        &::after {
            content: '';
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
        }
    }

    /* Bias the 44x44 tap target outward: prev extends left, next extends right */
    .slide-prev::after {
        right: 0;
    }

    .slide-next::after {
        left: 0;
    }
}