/* --- HERO CAROUSEL (multi-slide hero, reuses .carousel-component JS/behavior) --- */

.hero-carousel {
    max-width: var(--hero-carousel-max-width, none);
    margin-left: auto;
    margin-right: auto;
}

/* The slide image is an <img> inside an absolutely-positioned <picture> filling
   the slide, not a CSS background — see the template's docblock for why. The
   slide itself stays the positioning + sizing box (min-height/padding via
   tokens); relative+overflow:hidden give the picture something to fill and
   clip to. */
.hero-carousel-slide {
    position: relative;
    overflow: hidden;
    align-items: flex-end;
    justify-content: flex-start;
    min-height: var(--hero-carousel-height, 780px);
    padding: var(--hero-carousel-padding, 60px);
}

.hero-carousel-slide__picture {
    position: absolute;
    inset: 0;
    display: block;
}

/* object-fit/object-position are the exact equivalents of the background-size/
   background-position this component used before, so the rendering is
   unchanged; both go through a token so a brand can ask for contain, or a
   different focal point, without touching the bundle. */
.hero-carousel-slide__img {
    width: 100%;
    height: 100%;
    object-fit: var(--hero-carousel-image-fit, cover);
    object-position: var(--hero-carousel-image-position, center);
}

.hero-carousel-slide__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    max-width: 460px;
    /* Has to outrank the absolutely positioned picture; .hero-carousel-slide
       is a flex container with no stacking context of its own. */
    position: relative;
    z-index: 1;
}

.hero-carousel-slide__subtitle {
    font-family: var(--type-hero-body-family, var(--font-family-body));
    font-size: var(--type-hero-body-size, 35px);
    font-weight: var(--type-hero-body-weight, 800);
    line-height: var(--type-hero-body-line-height, 35px);
    color: var(--color-text-dark, #000);
    margin: 0;
}

.hero-carousel-slide__cta {
    display: inline-block;
    background-color: var(--color-button-secondary-bg, rgba(255,255,255,0.7));
    border: var(--button-secondary-border, 2px solid #000);
    border-radius: var(--border-radius-button, 10px);
    padding: 5px 25px;
    font-family: var(--font-family);
    font-size: 20px;
    color: var(--color-text-dark, #000);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .hero-carousel-slide {
        min-height: var(--hero-carousel-height-mobile, 500px);
        /* Set this to the mobile image's own ratio to show it uncropped
           instead of letting cover trim it to a fixed height. */
        aspect-ratio: var(--hero-carousel-aspect-ratio-mobile, auto);
        padding: var(--hero-carousel-padding-mobile, 30px);
    }

    .hero-carousel-slide__subtitle {
        display: var(--hero-carousel-subtitle-display-mobile, block);
    }

    .hero-carousel-slide__cta {
        font-family: var(--hero-carousel-cta-family-mobile, var(--font-family));
        font-weight: var(--hero-carousel-cta-weight-mobile, inherit);
        font-size: var(--hero-carousel-cta-size-mobile, 20px);
        padding: var(--hero-carousel-cta-padding-mobile, 5px 25px);
        line-height: var(--hero-carousel-cta-line-height-mobile, normal);
        border: var(--hero-carousel-cta-border-mobile, var(--button-secondary-border, 2px solid #000));
    }
}
