/* ─── Wrapper principal ─── */
.col-wrapper {
    max-width: 75rem;
    gap: 4.3rem;
    margin: auto;
    align-items: center;
    flex-flow: row wrap;
}

.col-row {
    flex: 1;
    padding: 1rem;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
}

.col-titles {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.col-button {
    background-color: var(--primary-500);
    padding: 0.5rem 1rem;
    color: var(--black-900);
    text-transform: uppercase;
    font-weight: 900;
    font-size: 1.68rem;
    transition: all 0.3s;
}
.col-button:hover { background-color: var(--primary-100); }

.col-row.col-image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
}
.col-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    vertical-align: middle;
}

svg { vertical-align: middle; }
span { font-weight: 700; }
p { padding: 0; margin: 0; line-height: 1rem; }

.col-title {
    text-align: center;
    font-style: normal;
    font-weight: 700;
    font-size: 3rem;
    letter-spacing: 0.13063rem;
    text-transform: uppercase;
}

.col-row:nth-child(1) { animation-delay: 0.1s; }
.col-row:nth-child(2) { animation-delay: 0.2s; }
.col-row:nth-child(3) { animation-delay: 0.3s; }
.col-row:nth-child(4) { animation-delay: 0.4s; }
.col-row:nth-child(5) { animation-delay: 0.5s; }

@media (max-width: 768px) {
    .col-wrapper {
        flex-wrap: wrap;
        flex-direction: column-reverse;
        gap: 0;
        padding: 0.5rem;
    }
    .col-row { flex: 0 1 40%; }
}

/* ─── Variables globales panels ─── */
.expandable-panels-container {
    --panels-height: 700px;
    --panels-gap: 1.75rem;
    --border-radius: 0;
    --animation-speed: 0.6s;
    --overlay-opacity: 0.3;
    --overlay-opacity-hover: 0.7;
    --text-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-hover-color: rgba(0, 0, 0, 0.4);
    --title-size-min: 2.5rem;
    --title-size-max: 4rem;
    --panel-padding: 1.875rem;
    width: 100%;
    padding: 2.5rem 1.25rem;
    margin: 0 auto;
}
.expandable-panels-container.alignwide { max-width: 75rem; }
.expandable-panels-container.alignfull { max-width: none; padding: 2.5rem; }

/* ─── Carousel dots ─── */
.carousel-dots { display: none; }
.carousel-dots.visible {
    display: flex;
    animation: fadeInDots 0.4s ease forwards;
}
.carousel-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}
.carousel-dot:hover { transform: scale(1.2); }
.carousel-dot.active { background: var(--primary-500); transform: scale(1.3); }

/* ─── Panels wrapper ─── */
.panels-wrapper {
    display: flex;
    max-width: 75rem;
    gap: 1.75rem;
    height: 37.5rem;
    min-height: 25rem;
    justify-content: center;
    margin: auto;
    padding: 1rem 0;
}

/* ─── Panneau individuel ─── */
.expandable-panel {
    position: relative;
    flex: 1;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: var(--panel-padding);
    width: 15rem;

    /* Animation d'entrée — transform géré uniquement ici */
    opacity: 0;
    animation: slideUp 0.6s ease forwards;

    /* Transition hover — séparée de l'animation */
    transition: flex 0.6s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Délais d'entrée */
.expandable-panel:nth-child(1) { animation-delay: 0.1s; }
.expandable-panel:nth-child(2) { animation-delay: 0.2s; }
.expandable-panel:nth-child(3) { animation-delay: 0.3s; }
.expandable-panel:nth-child(4) { animation-delay: 0.4s; }
.expandable-panel:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(3rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* État actif au chargement */
.expandable-panel.active-state {
    flex: 3;
    max-width: 72rem;
}
.expandable-panel.active-state .panel-overlay { opacity: 0; }

/* Hover */
.expandable-panel:hover,
.expandable-panel:focus {
    flex: 15;
    outline: none;
}
.expandable-panel:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

/* Fermer l'actif quand on survole un autre */
.panels-wrapper:not(.carousel-active) .expandable-panel:hover ~ .expandable-panel.active-state,
.panels-wrapper:not(.carousel-active) .expandable-panel:focus ~ .expandable-panel.active-state {
    flex: 1;
    max-width: none;
}
.panels-wrapper:not(.carousel-active) .expandable-panel:hover ~ .expandable-panel.active-state .panel-overlay,
.panels-wrapper:not(.carousel-active) .expandable-panel:focus ~ .expandable-panel.active-state .panel-overlay {
    opacity: 0.8;
}

/* ─── Overlay ─── */
.panel-overlay {
    position: absolute;
    inset: 0;
   /* background: color-mix(in srgb, var(--black-900) 50%, transparent); */
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.expandable-panel:hover .panel-overlay,
.expandable-panel:focus .panel-overlay { opacity: 0; }

/* ─── Titre ─── */
.panel-title {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    transform-origin: center center;
    z-index: 2;
    font-size: 2.125rem;
    font-weight: 900;
    line-height: 3.3125rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: margin 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.expandable-panel:hover .panel-title,
.expandable-panel:focus .panel-title { margin-bottom: 1.25rem; }

/* ─── Lien ─── */
.panel-link {
    color: var(--black-900);
    display: block;
    font-size: 0.75rem;
    max-width: 9.375rem;
    font-weight: 500;
    position: absolute;
    padding: 0.3rem;
    right: 1rem;
    background-color: var(--primary-100);
    text-transform: uppercase;
}

/* ─── Contenu caché ─── */
.panel-hidden-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    justify-content: flex-end;
    transition: all 0.4s ease 0.1s;
    max-width: 56.25rem;
    height: 100%;
}

/* ─── Responsive ─── */
@media (max-width: 72.625rem) {
    .expandable-panel { width: 11rem; }
}

@media (max-width: 36rem) {
    .expandable-panels-container { padding: 1.25rem 0.9375rem; }
    .expandable-panel { height: 15.625rem; min-height: 12.5rem; }
}



@media (max-width: 767px) {
    .carousel-dots {
        display: block;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        padding: 1.25rem 2rem;
        margin-top: 2px;
        position: relative;
    }
 .panels-wrapper {
    padding: 0;
    min-height: inherit;
    height: auto !important; /* ← le JS injecte la bonne hauteur */
  }

  .panels-wrapper.carousel-active {
    position: relative;
    width: 100%;
    overflow: hidden !important;
    display: block !important;
    touch-action: pan-y;
  }

  .carousel-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    height: 100%;
    touch-action: pan-y;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    align-items: stretch;
  }

  .carousel-track .expandable-panel {
    flex: 0 0 var(--panel-width, 88vw) !important;
    width: var(--panel-width, 88vw) !important;
    min-width: 0 !important;
    height: 100% !important; /* ← hérite du track qui hérite du wrapper */
    margin: 0 var(--panel-gap, 0.75rem) 0 0 !important;
    animation: none !important;
    opacity: 1 !important;
    border: none !important;
    transform: none !important;
    transition: opacity 0.3s ease;
    background-size: cover;
    background-position: center center;
  }

    .carousel-track .expandable-panel:not(.active-slide) { opacity: 0.72; }
    .carousel-track .expandable-panel .panel-overlay {
        background: linear-gradient(180deg, rgba(0, 24, 55, 0) 0%, #001837 100%);
        opacity: 0.8;
    }
    .carousel-track .expandable-panel.active-slide .panel-overlay { opacity: 0.3; }
    .carousel-track .panel-title { position: inherit; font-size: 2.875rem; }
    .carousel-track .expandable-panel:hover,
    .carousel-track .expandable-panel:focus {
        flex: 0 0 var(--panel-width, 88vw) !important;
        transform: none !important;
        max-width: none !important;
        opacity: 1;
    }
    .carousel-track .expandable-panel .panel-hidden-content {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        display: flex;
        flex-direction: column;
        padding: 2rem 0;
        position: relative;
        bottom: 3rem;
        max-width: inherit;
    }

    .col-title {
        font-size:2rem;
    }
}

@keyframes fadeInDots {
    from { opacity: 0; transform: translateY(0.625rem); }
    to   { opacity: 1; transform: translateY(0); }
}