/* ============================================================
   TSI Timeline Carousel — Styles responsive
   ============================================================ */

/* ── Conteneur principal ── */
.tsi-tc {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Slides ── */
.tsi-tc__slide {
    display: none;
    width: 100%;
}

.tsi-tc__slide--active {
    display: block;
    animation: tsiTcFadeIn 0.5s ease forwards;
}

@keyframes tsiTcFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* ── Layout interne (desktop) : image gauche | contenu droite ── */
.tsi-tc__inner {
    display: flex;
    align-items: flex-start;   /* alignement en haut */
    gap: 48px;
    padding: 24px 0 16px;
}

/* ── Image ── */
.tsi-tc__img-wrap {
    flex: 0 0 46%;
    /* aspect-ratio adapte la hauteur automatiquement selon la largeur */
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 2px;
}

.tsi-tc__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tsi-tc__img-placeholder {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}

/* ── Contenu texte ── */
.tsi-tc__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;          /* micro-décalage pour aligner visuellement avec l'image */
}

.tsi-tc__year {
    font-size: 56px;
    font-weight: 400;
    line-height: 1;
    color: #1a1a1a;
    letter-spacing: -1px;
}

.tsi-tc__text {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0;
    max-width: 420px;
}

/* ── Navigation ── */
.tsi-tc__nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0px 0 20px;
}

/* Boutons flèches */
.tsi-tc__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: #999;
    padding: 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.tsi-tc__btn:hover {
    color: #1a1a1a;
    border-color: #1a1a1a;
    background: transparent;
}

.tsi-tc__btn:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 3px;
}

.tsi-tc__btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Dots */
.tsi-tc__dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tsi-tc__dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.tsi-tc__dot--active {
    background: #1a1a1a;
    transform: scale(1.25);
}

.tsi-tc__dot:hover {
    background: #888;
}

/* ============================================================
   Responsive — Tablette (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
    .tsi-tc__inner {
        gap: 28px;
        padding: 20px 0 0px;
    }

    .tsi-tc__img-wrap {
        flex: 0 0 44%;
        /* aspect-ratio garde son format, pas de hauteur fixe */
    }

    .tsi-tc__year {
        font-size: 44px;
    }

    .tsi-tc__text {
        font-size: 14px;
        max-width: 100%;
    }
}

/* ============================================================
   Responsive — Mobile (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
    .tsi-tc__inner {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0 8px;
        align-items: flex-start;
    }

    .tsi-tc__img-wrap {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 10;  /* conserve le format en mobile aussi */
    }

    .tsi-tc__year {
        font-size: 40px;
    }

    .tsi-tc__content {
        width: 100%;
        gap: 10px;
    }

    .tsi-tc__nav {
        justify-content: center;
        padding: 8px 0 16px;
    }

    .tsi-tc__btn {
        width: 40px;
        height: 40px;
    }

    .tsi-tc__btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
   Animations — direction sortante
   ============================================================ */
.tsi-tc__slide--exit-left {
    animation: tsiTcExitLeft 0.4s ease forwards;
}

.tsi-tc__slide--exit-right {
    animation: tsiTcExitRight 0.4s ease forwards;
}

@keyframes tsiTcExitLeft {
    from { opacity: 1; transform: translateX(0);    }
    to   { opacity: 0; transform: translateX(-24px); }
}

@keyframes tsiTcExitRight {
    from { opacity: 1; transform: translateX(0);   }
    to   { opacity: 0; transform: translateX(24px); }
}

/* Slide entrante depuis la droite */
.tsi-tc__slide--enter-right {
    animation: tsiTcFadeIn 0.5s ease forwards;
}

/* Slide entrante depuis la gauche */
.tsi-tc__slide--enter-left {
    animation: tsiTcFadeInLeft 0.5s ease forwards;
}

@keyframes tsiTcFadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0);     }
}
