/* --- 1. VARIABLES & SCOPE --- */
.synexta-gallery-wrapper {
    /* Variables dynamiques */
    --color-bg: #fff;
    --sky-blue: var(--sy-contrast); 
    --overlay-closed: rgba(var(--sy-overlay-rgb), 0.65); 
    --overlay-open: rgba(0, 0, 0, 0.1); 
    --btn-text: var(--sy-contrast);
    --text-main: var(--sy-text);
    
    --transition-smooth: cubic-bezier(0.25, 1, 0.5, 1);
    
    width: 100%;
    margin: 40px 0;
    box-sizing: border-box;
    display: block;
}

.synexta-gallery-wrapper * {
    box-sizing: border-box;
}

/* --- 2. CONTAINER (UL Reset) --- */
.synexta-gallery-wrapper .gallery-container {
    display: flex;
    width: 100%;
    height: 450px; 
    background: #000; 
    overflow: hidden;
    border-radius: 4px;
    
    /* RESET UL STRICT */
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    text-indent: 0 !important;
}

/* --- 3. CARTE (LI Reset) --- */
.synexta-gallery-wrapper .card {
    position: relative;
    height: 100%;
    border-right: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    cursor: pointer;
    
    /* Flex behavior */
    flex: 1; 
    min-width: 0; 
    transition: flex 0.6s var(--transition-smooth);
    background-color: var(--sky-blue); 
    
    /* RESET LI STRICT */
    margin: 0 !important; 
    padding: 0 !important;
    list-style-type: none !important;
    background-image: none !important; /* Pour thèmes qui mettent des puces en bg */
}

.synexta-gallery-wrapper .card:last-child {
    border-right: none;
}

.synexta-gallery-wrapper .card.active {
    flex: 0 0 30%;
    min-width: 200px;
}

/* --- 4. IMAGE --- */
.synexta-gallery-wrapper .card__bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: right center; 
    transform: scale(1.1); 
    transition: transform 1.2s var(--transition-smooth);
    
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.synexta-gallery-wrapper .card.active .card__bg {
    transform: scale(1);
}

/* --- 5. OVERLAY --- */
.synexta-gallery-wrapper .card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--overlay-closed);
    opacity: 1;
    transition: background-color 0.6s ease, opacity 0.6s ease;
    z-index: 2; 
    pointer-events: none;
}

.synexta-gallery-wrapper .card.active::after {
    background-color: var(--overlay-open); 
    opacity: 0.3;
}

/* --- 6. CONTENU --- */
.synexta-gallery-wrapper .card__content {
    position: absolute;
    z-index: 10; 
    transition: all 0.6s var(--transition-smooth);
    width: 100%;
}

/* ÉTAT FERMÉ */
.synexta-gallery-wrapper .card:not(.active) .card__content {
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    top: auto;
    
    display: flex;
    justify-content: flex-end; 
    flex-direction: column;
    height: auto;
}

.synexta-gallery-wrapper .card:not(.active) .card__title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    margin: 0 auto !important;
    
    /* Taille fixe fermée */
    font-size: 1.8rem !important; 
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    
    display: block;
}

.synexta-gallery-wrapper .card:not(.active) .title-break { display: none; }
.synexta-gallery-wrapper .card:not(.active) .card__btn { display: none; }

/* ÉTAT OUVERT */
.synexta-gallery-wrapper .card.active .card__content {
    top: auto;
    bottom: 40px;
    left: 40px;
    transform: none;
    
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - 80px);
    text-align: left;
}

/* TITRE (Hn Reset) */
/* On cible .card__title quelle que soit la balise (h1, h2, h3...) */
.synexta-gallery-wrapper .card__title {
    font-size: 2rem !important;
    text-transform: uppercase;
    font-weight: 800 !important; 
    color: var(--text-main);
    line-height: 1.1 !important;
    position: relative;
    width: fit-content;
    
    /* Reset strict des marges Hn du thème */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Trait bleu */
.synexta-gallery-wrapper .card.active .card__title::before {
    content: '';
    position: absolute;
    bottom: -15px; 
    left: -40px; 
    width: calc(100% + 40px);
    height: 4px;
    background-color: var(--sky-blue);
}

/* BOUTON */
.synexta-gallery-wrapper .card__btn {
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    margin-top: 30px;
    padding: 12px 28px;
    
    background-color: #fafafa;
    color: var(--btn-text);
    
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-radius: 8px;
    
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.synexta-gallery-wrapper .card.active .card__btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- 7. LIEN GLOBAL --- */
.synexta-gallery-wrapper .card__global-link {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 20; 
    cursor: pointer;
    background: transparent; /* Fix IE/Edge click issue sometimes */
}

/* Hover effect */
.synexta-gallery-wrapper .card.active:hover .card__btn {
    background-color: #fff;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* --- 8. RESPONSIVE --- */
@media (max-width: 782px) {
    .synexta-gallery-wrapper .gallery-container {
        flex-direction: column;
        height: auto;
        display: block; /* Reset flex container */
    }

    .synexta-gallery-wrapper .card {
        width: 100%;
        height: 70px; 
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        transition: height 0.4s ease;
    }
    
    .synexta-gallery-wrapper .card.active {
        height: 350px; 
        flex: none;
    }

    /* Texte Mobile Fermé */
    .synexta-gallery-wrapper .card:not(.active) .card__content {
        bottom: 0; top: 0; left: 20px;
        transform: none;
        width: auto;
        display: flex;
        flex-direction: row; 
        align-items: center;
        justify-content: flex-start;
    }

    .synexta-gallery-wrapper .card:not(.active) .card__title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 1.1rem !important;
        letter-spacing: 1px;
    }
    
    .synexta-gallery-wrapper .card.active .card__content {
        left: 20px; bottom: 30px;
    }
    
    .synexta-gallery-wrapper .card.active .card__title::before {
        left: -20px;
        width: calc(100% + 20px);
    }
}

/* File d'ariane */
.synexta-ariane-current {
    font-weight: 600;              /* Un peu plus gras pour marquer l'étape actuelle */
    text-decoration: underline;    /* Active le soulignement */
    text-decoration-style: dotted; /* Le rend pointillé */
    text-decoration-color: currentColor; /* Utilise la couleur exacte du texte/lien parent */
    text-decoration-thickness: 1px; /* Finesse du trait (élégance) */
    text-underline-offset: 4px;    /* Écarte le trait du texte pour ne pas "coller" aux lettres */
    opacity: 1 !important;         /* On s'assure qu'il est bien visible */
}
