/* Bloc ACF — Timeline verticale */

.block-timeline-verticale {
    --dgs-tl-line: #3a3a3a;
    --dgs-tl-node: #2c2c2c;
    --dgs-tl-text: #1a1a1a;
    --dgs-tl-muted: #4a4a4a;
    --dgs-tl-track: 56px;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 0 2.5rem;
}

.dgs-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 1rem;
}

/* Ligne verticale centrée (axe des colonnes milieu) */
.dgs-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    background: var(--dgs-tl-line);
    border-radius: 999px;
    z-index: 0;
}

.dgs-timeline__row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--dgs-tl-track) minmax(0, 1fr);
    column-gap: clamp(1rem, 3vw, 1.75rem);
    align-items: flex-start;
    padding-bottom: clamp(2rem, 5vw, 3rem);
}

.dgs-timeline__row:last-child {
    padding-bottom: 0;
}

.dgs-timeline__cell--empty {
    min-height: 1px;
}

.dgs-timeline__cell--track {
    display: flex;
    justify-content: center;
    padding-top: 0.15rem;
}

.dgs-timeline__node {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--dgs-tl-track);
    height: var(--dgs-tl-track);
    border-radius: 50%;
    background: var(--dgs-tl-node);
    color: #fff;
    box-sizing: border-box;
    padding: 4px;
    text-align: center;
    line-height: 1.05;
}

.dgs-timeline__node--empty {
    background: var(--dgs-tl-line);
    width: 18px;
    height: 18px;
    margin-top: calc((var(--dgs-tl-track) - 18px) / 2);
}

.dgs-timeline__year {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(11px, 2.4vw, 15px);
    letter-spacing: 0.02em;
    word-break: break-word;
}

.dgs-timeline__title {
    margin: 0 0 0.65rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(1.15rem, 2.2vw, 1.75rem);
    line-height: 1.25;
    color: var(--dgs-tl-text);
}

.dgs-timeline__title--rich > p {
    margin: 0 0 0.4em;
}

.dgs-timeline__title--rich > p:last-child {
    margin-bottom: 0;
}

.dgs-timeline__desc {
    margin: 0;
    font-family: 'Raleway', system-ui, sans-serif;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    font-weight: 300;
    line-height: 1.55;
    color: var(--dgs-tl-muted);
}

.dgs-timeline__desc p {
    margin: 0 0 0.5em;
}

.dgs-timeline__desc p:last-child {
    margin-bottom: 0;
}

.dgs-timeline__row--left .dgs-timeline__cell--text {
    text-align: right;
}

.dgs-timeline__row--right .dgs-timeline__cell--text {
    text-align: left;
}

.dgs-timeline-placeholder {
    padding: 2.5rem 1.25rem;
    text-align: center;
    background: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 4px;
    color: #888;
}

/* ——— Mobile : ligne à gauche, contenu empilé à droite ——— */
@media (max-width: 767px) {
    .block-timeline-verticale {
        --dgs-tl-track: 48px;
        padding-left: 0;
        padding-right: 0;
    }

    .dgs-timeline::before {
        left: calc(var(--dgs-tl-track) / 2);
        margin-left: -1.5px;
        transform: none;
    }

    .dgs-timeline__row {
        grid-template-columns: var(--dgs-tl-track) minmax(0, 1fr);
        column-gap: 1rem;
    }

    .dgs-timeline__cell--empty {
        display: none !important;
    }

    /* Rangée gauche : DOM = texte, piste → afficher piste puis texte */
    .dgs-timeline__row--left .dgs-timeline__cell--track {
        order: -1;
    }

    .dgs-timeline__row--left .dgs-timeline__cell--text,
    .dgs-timeline__row--right .dgs-timeline__cell--text {
        text-align: left;
    }

    .dgs-timeline__node--empty {
        margin-top: calc((var(--dgs-tl-track) - 18px) / 2);
    }
}
