  @import url('https://fonts.cdnfonts.com/css/d-din');

/* État initial : masqué au chargement */
.acf-block-tabs-animated {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
}

.tab-text.closing {
    opacity: 0;
    transform: translate(50px, -50%); /* Retour à droite */
    pointer-events: none;
}

.tabs-labels {
    position: relative;
    display: flex;
    width: 17rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.tab-label {
    position: relative;
    display: flex;
    flex: 1 1 15rem;
    justify-content: right;
    align-items: center;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'D-DIN Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.375rem;
    height: 3.875rem;
    color: white;

}

.tab-label:hover {
    font-size: 3.0625rem;
    transform: translateY(-2px);
}

.tab-label.active {
    font-size: 3.0625rem;
    color: white;
}

.tabs-images {
    display: flex;
    position: relative;
    flex: 0 1 23.375rem;
    overflow: hidden;
    height: 32.375rem;
}

.tab-image {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 1; /* Image toujours visible */
}

.tab-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #04326c; /* Couleur du masque */
    z-index: 2;
    transform: translateX(0); /* Masque présent par défaut */
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Masquer les images non actives */
.tab-image:not(.active) {
    opacity: 0;
    pointer-events: none;
}

/* Animation au scroll pour la première apparition */
.tab-image.active.scroll-triggered::before {
    transform: translateX(100%);
}

/* Animation normale pour les changements de tabs */
.tab-image.active::before {
    transform: translateX(100%);

}

/* Nouvel état de fermeture */
.tab-image.closing::before {
  transform: translateX(0); /* le masque revient couvrir l’image */
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-image.closing {
  opacity: 1; /* garde visible tant que le masque n’a pas fini */
}


.tab-image img {
    max-width: 23.375rem;
    width: 100%;
    max-height: 32.375rem;
    display: block;
}

.tabs-content-texts {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.tabs-texts {
    position: relative;
    display: block;
    width: 18.8125rem;
    height: 20.75rem;
    margin-left: 3rem;
  
}
.tabs-link {
    position: absolute;
    bottom: 0;
    display: block;
    color: white;
    width: 18.8125rem;
}

.tab-text {
    position: absolute;
    display: block;
    color: white;
    top: 50%;
    right: 0;
    width: 100%;
    height: auto;
    pointer-events: none; 
    opacity: 0;
    transform: translate(50px, -50%);
    transition: all .5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-text.active {
    opacity: 1;
    transform: translate(0, -50%);
    pointer-events: auto; /* Permet les interactions avec le texte actif */
}



.tab-text p {
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .acf-block-tabs-animated {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 15px;
    }
    
    .tabs-labels {
        flex-direction: row;
        overflow-x: none;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .tab-label {
        min-width: 120px;
        flex-shrink: 0;
    }
    
    .tabs-images,
    .tabs-texts {
        max-width: 100%;
    }
}

   

.indicator-column {
   position: absolute;
    left: 100%; /* juste à droite des labels */
    top: 12%;
    margin-left: 1rem;
    width: 4px;
}

.indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 1px;
    background-color: white;
    transition: top 0.3s ease;
}


/* --- ACCORDÉON MOBILE --- */
@media (max-width: 768px) {

    .acf-block-tabs-animated {
        flex-direction: column;
        gap: 0;
    }

    .tabs-labels {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        order: 1;
        height: inherit;
        justify-content: inherit;
         text-align: left;
    }

    .tab-label {
        display: block;
        padding: 1.19rem 0;
        font-size: 1.2rem;
        border-bottom: 1px solid var(--white);
        text-align: left;
        flex: inherit;
        height: inherit;
    }

      .tab-label::after {

        content: "";
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        width: 16px;
        height: 16px;

        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'><path d='M6.40237 16V0H9.5858V16H6.40237ZM0 9.5858V6.40237H16V9.5858H0Z' fill='%23D3D2D2'/></svg>");
        background-size: 16px;
        background-repeat: no-repeat;

        transition: transform .3s ease;
    
    }

    /* Icône – quand actif */
    .tab-label.active::after {
        display: none;
        content: "";  /* le tiret long, plus esthétique */
        transform: translateY(-50%);
    }

    .tab-label.active {
        background: none;
       font-size: 2.5rem;
        border: 0;

    }

    /* Le contenu (image + texte) devient un bloc accordéon */
    .accordion-content {
        display: none;
        padding: 1rem 0;
        animation: fadeIn .3s ease;
    }

    /* Image + texte */
    .accordion-content .tab-image img {
        display: none;
        width: 100%;
        height: auto;
        max-height: none;
    }

    .accordion-content .tab-text {
        transform: none;
        opacity: 1;
        position: relative;
        top: auto;
        margin-top: 1rem;
    }

    @keyframes fadeIn {
        from { opacity: 0 }
        to { opacity: 1 }
    }

    /* On cache la grille desktop */
    .tabs-images,
    .tabs-content-texts {
        display: none !important;
    }
}
