/**
 * CTA Large - Gallery Images Component
 * Disposition: center image (large) + left/right images (small)
 * Position: absolute at bottom - full width in row
 */

.cta-large {
    position: relative;
    background: linear-gradient(254deg, #A62351 0%, #3A1220 61.17%);
}

.cta-large .btn--primary {
    display: inline-flex;
}

.cta-large__container-description{
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(6px);
}

/* Content section with padding for gallery */
.cta-large.has-gallery > .px-container {
    padding-bottom: 80px !important;
}

.cta-large:not(.has-gallery) > .px-container {
    padding-bottom: 0 !important;
}

.cta-large__gallery {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding-bottom: 0;
    z-index: 2;
    transform: translateY(50%);
}

/*
 * Sans la marge décorative, on conserve uniquement la moitié de la hauteur
 * de la rangée qui dépasse du bloc. Les cartes sont alignées par le bas : la
 * carte centrale, plus haute, se développe donc vers le haut.
 */
.cta-large--flush-next.has-gallery {
    padding-bottom: 150px;
}

.cta-large--flush-next:not(.has-gallery) {
    margin-bottom: 0;
}

.cta-large--flush-next .cta-large__gallery-grid {
    align-items: flex-end;
}

.cta-large--flush-next .cta-large__gallery{
    transform: translateY(0);
}

.cta-large--flush-next .cta-large__container-description{
    padding-bottom: 8rem;
}

.cta-large__gallery-grid {
    display: flex;
    height: 234px;
    justify-content: center;
    gap: var(--space-24, 24px);
}

.cta-large__gallery-item {
    position: relative;
    display: flex;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.cta-large__gallery-item::before{
    content: '';
    width: 100%;
    height: 294px;
    position: absolute;
    overflow: hidden;
    border-radius: 12px;
    top: 0;
    left: 0;
    background: linear-gradient(0deg, rgba(217, 48, 107, 0.02) 0%, rgba(217, 48, 107, 0.02) 100%), linear-gradient(0deg, rgba(17, 24, 33, 0.40) 0%, rgba(17, 24, 33, 0.40) 100%);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Left image - small */
.cta-large__gallery-item--left {
    flex: 1 0 auto;
    height: 100%;
}

.cta-large__gallery-item--left .cta-large__gallery-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

/* Center image - large/tall */
.cta-large__gallery-item--center {
    flex: 1 0 auto;
    height: 100%;
    height: 294px;
}

.cta-large__gallery-item--center .cta-large__gallery-img {
    width: 100%;
    height: 294px;
    aspect-ratio: 9 / 12;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}


/* Right image - small */
.cta-large__gallery-item--right {
    flex: 1 0 auto;
    height: 100%;
}

.cta-large__gallery-item--right .cta-large__gallery-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}



/* Responsive Design */

/* Tablet (max 1024px) */
@media (max-width: 1024px) {
    .cta-large--flush-next.has-gallery {
        margin-bottom: 120px;
    }

    .cta-large__gallery-grid {
        gap: 1rem;
        height: 240px;
    }

    .cta-large__gallery-item--left .cta-large__gallery-img,
    .cta-large__gallery-item--right .cta-large__gallery-img {
        /*width: auto;*/
    }

    .cta-large__gallery-item--center .cta-large__gallery-img {
        /*width: auto;*/
        height: 320px;
    }
}

/* Mobile — galerie en flux normal sous le contenu */
@media (max-width: 768px) {

    /* La galerie est dans le flux mais son décalage bottom la descend de 20px. */
    .cta-large--flush-next.has-gallery {
        margin-bottom: 20px;
    }

    .cta-large--flush-next .cta-large__gallery-grid {
        align-items: flex-start;
    }

    svg[data-cta-large-pattern]{
        width: 500%;
    }

    /* Retire le positionnement absolu : la galerie s'empile sous le contenu */
    .cta-large__gallery {
        position: relative;
        margin-top: -50px;
        bottom: -20px;
        left: auto;
        right: auto;
        width: 100%;
        padding: 0 ;
        overflow: hidden;
        transform: none;
    }

    /* Supprime le padding-bottom de réserve du contenu */
    .cta-large > .px-container:first-of-type {
        padding-bottom: 24px !important;
    }

    .cta-large.has-gallery > .px-container {
        padding-bottom: 0 !important;
    }

    .cta-large__container-description h2 { font-size: 46px !important; }
    .cta-large__container-description p { font-size: 18px !important; line-height: 1.1 !important; }
    .cta-large__container-description .btn { width: 100%; justify-content: center; }

    .cta-large__gallery-grid {
        height: 294px;
        gap: 28px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 42px;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .cta-large__gallery-grid::-webkit-scrollbar { display: none; }

    /* Chaque item prend une fraction égale */
    .cta-large__gallery-item {
        position: relative;
        flex: 0 0 calc(100vw - 84px);
        height: 234px;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }

    /* Images : pleine largeur de leur colonne, hauteur fixe */
    .cta-large__gallery-item .cta-large__gallery-img {
        width: 100%;
        height: 234px;
        aspect-ratio: auto;
        border-radius: 10px;
    }

    .cta-large__gallery-item.is-active,
    .cta-large__gallery-item.is-active img{
        height: 294px;
    }


}

