/* TDM Timeline block styles */

.tdm-timeline {
    --tdm-line-color: #e2e7ed;      /* default gray line + default dot border */
    --tdm-accent: #00a6a6;          /* teal - current dot border + active fill */
    --tdm-year-color: #1c2b39;
    --tdm-label-color: #6b7785;
    --tdm-line-width: 2px;
    --tdm-dot-size: 24px;
    --tdm-dot-gap: 28px;            /* gap between the connector line and each dot */

    position: relative;
    max-width: 900px;
    margin-inline: auto;
    padding-block: 20px;
}

/* Container for the JS-generated connector segments.
   No static background here - segments are positioned individually
   so each one stops 28px short of the dots on either side. */
.tdm-timeline__track {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    transform: translateX(-50%);
}

.tdm-timeline__connector {
    position: absolute;
    left: 0;
    width: var(--tdm-line-width);
    transform: translateX(-50%);
    background: var(--tdm-line-color);
    overflow: hidden;
}

.tdm-timeline__connector-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%; /* animated via JS as the user scrolls */
    background: var(--tdm-accent);
}

.tdm-timeline__items {
    display: flex;
    flex-direction: column;
}

.tdm-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr var(--tdm-dot-size) 1fr;
    align-items: center;
    column-gap: 32px;
    padding-block: 46px;
}

.tdm-timeline__dot {
    grid-column: 2;
    justify-self: center;
    box-sizing: border-box;
    width: var(--tdm-dot-size);
    height: var(--tdm-dot-size);
    border-radius: 50%;
    background: #fff;
    z-index: 1;

    /* Default (not yet reached): thin gray ring - matches Rectangle_6_(1).svg */
    border: 2px solid var(--tdm-line-color);

    transition: background-color 0.25s ease, border-color 0.25s ease, border-width 0.25s ease;
}

.tdm-timeline__content {
    grid-row: 1;
}

/* Content sits to the right of the line */
.tdm-timeline__item--right .tdm-timeline__content {
    grid-column: 3;
    text-align: left;
}

/* Content sits to the left of the line */
.tdm-timeline__item--left .tdm-timeline__content {
    grid-column: 1;
    text-align: right;
}

.tdm-timeline__year {
    display: block;
    margin: 0;
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--tdm-year-color);
}

.tdm-timeline__label {
    margin: 6px 0 0;
    color: var(--tdm-label-color);
    font-size: 16px;
    font-weight: 600;
}

/* Dot states, fully controlled by JS as the user scrolls:
   - default (no class): thin gray ring          -> Rectangle_6_(1).svg
   - is-current: thick teal ring, hollow inside   -> Rectangle_6_(2).svg
   - is-active: solid teal fill                    -> Rectangle_6_(3).svg */
.tdm-timeline__item.is-current .tdm-timeline__dot {
    border-width: 4px;
    border-color: var(--tdm-accent);
    background: #fff;
}

.tdm-timeline__item.is-active .tdm-timeline__dot {
    border-width: 0;
    background: var(--tdm-accent);
}

/* Mobile: single column, dot + line pinned to the left */
@media (max-width: 680px) {
    .tdm-timeline__track {
        left: calc(var(--tdm-dot-size) / 2);
        transform: none;
    }

    .tdm-timeline__connector {
        transform: translateX(-50%);
    }

    .tdm-timeline__item {
        grid-template-columns: var(--tdm-dot-size) 1fr;
        column-gap: 16px;
        padding-left: 0;
    }

    .tdm-timeline__dot {
        grid-column: 1;
        justify-self: start;
    }

    .tdm-timeline__item--right .tdm-timeline__content,
    .tdm-timeline__item--left .tdm-timeline__content {
        grid-column: 2;
        text-align: left;
    }
}