/* ==========================================================
   FL Timeline Section — Styles
   ========================================================== */

/* ── Outer Section ── */
.fl-timeline-section {
    position: relative;
    padding: 60px 20px 80px;
    overflow: visible;
}

/* ── Vertical spine ──
   Faint track always visible; ::after fills downward as user scrolls
   via --spine-fill custom property set by JS
   ─────────────────────────────────────────────────────────────────── */
.fl-timeline-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.08);
    z-index: 0;
}

.fl-timeline-spine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--spine-fill, 0px);
    background: var(--wp--preset--color--accent-2);
    transition: height 0.12s linear;
}

/* ── Items wrapper ── */
.fl-timeline-items {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Individual Item ──
   3-col grid: [side A] [60px dot column] [side B]
   nth-child alternates which side gets image vs content
   ─────────────────────────────────────────────────── */
.fl-timeline-item {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: start;
    margin-bottom: 72px;
    position: relative;

    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.fl-timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Even: image LEFT, content RIGHT */
.fl-timeline-item:nth-child(even) .fl-timeline-card__image-wrap {
    grid-column: 1;
    grid-row: 1;
    padding-right: 40px;
}
.fl-timeline-item:nth-child(even) .fl-timeline-dot {
    grid-column: 2;
    grid-row: 1;
}
.fl-timeline-item:nth-child(even) .fl-timeline-card__body {
    grid-column: 3;
    grid-row: 1;
    padding-left: 40px;
}

/* Odd: content LEFT, image RIGHT */
.fl-timeline-item:nth-child(odd) .fl-timeline-card__body {
    grid-column: 1;
    grid-row: 1;
    padding-right: 40px;
}
.fl-timeline-item:nth-child(odd) .fl-timeline-dot {
    grid-column: 2;
    grid-row: 1;
}
.fl-timeline-item:nth-child(odd) .fl-timeline-card__image-wrap {
    grid-column: 3;
    grid-row: 1;
    padding-left: 40px;
}

/* ── Dot — 30x30, no border, gradient fill, aligned to top of item ── */
.fl-timeline-dot {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
    position: relative;
    z-index: 2;
}

.fl-timeline-dot-inner {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--wp--preset--gradient--custom-light-blue);
    border: none;
    flex-shrink: 0;
}

/* ── Image ── */
.fl-timeline-card__image-wrap {
    display: block;
}

.fl-timeline-card__image-wrap img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    box-shadow: 0 6px 28px rgba(13, 31, 60, 0.13);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.fl-timeline-card__image-wrap img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(13, 31, 60, 0.18);
}

/* ── Content body ── */
.fl-timeline-card__body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 8px;
    text-align: left;
}

.fl-timeline-card__title {
    font-family: var(--wp--preset--font-family--cinzel, 'Cinzel', Georgia, serif);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 700;
    color: var(--wp--preset--color--primary, #0d1f3c);
    margin: 0 0 12px;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
}

.fl-timeline-card__content {
    font-family: var(--wp--preset--font-family--montserrat, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    line-height: 1.75;
    color: #444;
    margin: 0;
    text-align: left;
}

.fl-timeline-card__content p {
    margin: 0 0 0.9em;
}

.fl-timeline-card__content p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   RESPONSIVE — Mobile: single column, spine at left:20px,
   dot at left:-8px, vertically centered on image by JS
   ========================================================= */
@media (max-width: 768px) {
    .fl-timeline-section {
        padding: 40px 16px 60px;
    }

    .fl-timeline-spine {
        left: 20px;
        transform: none;
    }

    .fl-timeline-item {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 52px;
        padding-left: 52px;
        position: relative;
    }

    /* Reset all desktop grid/padding */
    .fl-timeline-item:nth-child(odd) .fl-timeline-card__body,
    .fl-timeline-item:nth-child(even) .fl-timeline-card__body,
    .fl-timeline-item:nth-child(odd) .fl-timeline-card__image-wrap,
    .fl-timeline-item:nth-child(even) .fl-timeline-card__image-wrap {
        grid-column: unset;
        grid-row: unset;
        padding: 0;
    }

    /* Image always first, full width */
    .fl-timeline-card__image-wrap {
        order: -1;
        width: 100%;
    }

    .fl-timeline-card__image-wrap img {
        max-height: 220px;
    }

    /* Dot: left:-8px per spec, JS sets translateY to center on image */
    .fl-timeline-dot {
        position: absolute;
        left: -8px;
        top: 0;
        padding-top: 0;
        width: 30px;
        height: 30px;
        align-items: center;
        justify-content: center;
        transform: translateY(12px);
    }
}
