/**
 * Timeline - Styles
 * Mobile-first
 *
 * @package Astra Child RGAA
 * @since 1.0.0
 */

/* ================================================
   VARIABLES
   ================================================ */

.timeline-section {
    /* Ligne + point (surchargées via style inline sur la section) */
    --tl-line-color: #0274be;
    --tl-line-thickness: 3px;
    --tl-dot-color: #0274be;
    --tl-dot-size: 18px;

    /* Espace réservé au-dessus des cartes pour la ligne + le point */
    --tl-header-height: 40px;

    --timeline-title-color: #1a1a1a;
    --timeline-text-color: #555555;
}

/* ================================================
   SECTION
   ================================================ */

.timeline-section {
    width: 100%;
    padding: 2rem 0;
}

.timeline-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

/* ================================================
   SWIPER OVERRIDES
   ================================================ */

.timeline-swiper {
    padding-top: var(
        --tl-header-height
    ); /* Espace pour la ligne + les points */
    padding-bottom: 2.5rem; /* Espace pour les dots */
    overflow: visible;
}

.timeline-swiper .swiper-wrapper {
    align-items: stretch;
}

/* ================================================
   LIGNE HORIZONTALE
   Absolute sur .timeline-container, centrée verticalement
   dans l'espace --tl-header-height créé par le padding-top du swiper.
   ================================================ */

.timeline-line-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tl-header-height);
    pointer-events: none;
    z-index: 1;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: var(--tl-line-thickness);
    background-color: var(--tl-line-color);
    transform: translateY(-50%);
}

/* ================================================
   POINT SUR LA LIGNE
   Dans chaque .timeline-slide (position relative).
   Centré horizontalement, verticalement centré sur la ligne.
   Se déplace avec la slide lors du défilement.
   ================================================ */

.timeline-slide {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: 2rem;
    top: calc(-1 * (var(--tl-header-height) / 2 + var(--tl-dot-size) / 2));
    width: var(--tl-dot-size);
    height: var(--tl-dot-size);
    background-color: var(--tl-dot-color);
    border-radius: 50%;
    z-index: 2;
    transform: translateX(-50%);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.timeline-slide:hover .timeline-dot {
    transform: translateX(-50%) scale(1.15);
}

/* Boutons navigation */
.timeline-btn-prev,
.timeline-btn-next {
    --swiper-navigation-size: 24px;
    color: var(--tl-line-color);
}

/* Dots */
.timeline-dots {
    bottom: 0;
}

.timeline-dots .swiper-pagination-bullet {
    background: #e2e6ea;
    opacity: 1;
    width: 10px;
    height: 10px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.timeline-dots .swiper-pagination-bullet-active {
    background: var(--tl-line-color);
    transform: scale(1.3);
}

/* ================================================
   CARTE D'ÉVÉNEMENT
   ================================================ */

.timeline-card {
    height: 100% !important; /* Swiper force height auto sur les slides */
    border: 2px solid #fff;
    transition: transform 0.3s ease;
}
.timeline-slide:hover .timeline-card {
    border: 2px solid #eee;
  border-radius: 8px;
}

.timeline-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ================================================
   IMAGE
   ================================================ */

.timeline-image {
    width: 100%;
    overflow: hidden;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

/* ================================================
   CONTENU
   ================================================ */

.timeline-content {
    flex: 1;
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600 !important;
    color: var(--timeline-title-color);
    margin: 0;
    line-height: 1.3;
}

.timeline-excerpt {
    color: var(--timeline-text-color);
}

/* ================================================
   RESPONSIVE — TABLET (min-width: 768px)
   ================================================ */

@media (min-width: 768px) {
    .timeline-title {
        font-size: 1.1rem;
    }
}

/* ================================================
   RESPONSIVE — DESKTOP (min-width: 1024px)
   ================================================ */

@media (min-width: 1024px) {
    .timeline-title {
        font-size: 1.2rem;
    }
}

/* ================================================
   ACCESSIBILITÉ
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .timeline-card-inner {
        transition: none;
    }

    .timeline-dots .swiper-pagination-bullet {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .timeline-title {
        font-weight: 700;
    }
}
