.timeline-outer {
    width: 100%;
    padding: 0.5rem 0 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.timeline-steps {
    --timeline-count: 4;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
    width: 100%;
    min-width: max(100%, calc(var(--timeline-count) * 78px));
}

.timeline-steps::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 13px;
    left: calc(50% / var(--timeline-count));
    right: calc(50% / var(--timeline-count));
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(23, 55, 110, 0.28),
        rgba(155, 27, 34, 0.52),
        rgba(23, 55, 110, 0.28)
    );
}

.timeline-step {
    position: relative;
    z-index: 1;
    flex: 1 0 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 0 0.25rem 0.35rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    appearance: none;
}

.timeline-dot {
    position: relative;
    z-index: 2;
    display: block;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border: 4px solid #b9c3d1;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.92);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.timeline-year {
    display: block;
    margin-top: 0.65rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    color: currentColor;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease;
}

.timeline-step:hover {
    color: hsl(var(--brand-accent));
}

.timeline-step:hover .timeline-dot {
    border-color: hsl(var(--brand-accent));
    transform: scale(1.08);
}

.timeline-step.active {
    color: hsl(var(--brand-accent));
}

.timeline-step.active .timeline-dot {
    border-color: #ffffff;
    background: hsl(var(--brand-accent));
    box-shadow:
        0 0 0 5px rgba(255, 255, 255, 0.96),
        0 0 0 8px rgba(155, 27, 34, 0.15),
        0 7px 18px rgba(155, 27, 34, 0.28);
    transform: scale(1.12);
}

.timeline-step.active .timeline-year {
    font-size: 1rem;
    color: hsl(var(--brand-accent));
    transform: translateY(1px);
}

.timeline-step:focus-visible {
    outline: 3px solid rgba(155, 27, 34, 0.28);
    outline-offset: 4px;
    border-radius: 10px;
}

.news-item-link {
    display: flex;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.news-item-link:hover,
.news-item-link:focus-visible {
    color: inherit;
}

.news-item-link:focus-visible {
    outline: 3px solid rgba(155, 27, 34, 0.28);
    outline-offset: 4px;
}

.news-sdg-badges {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-sdg-badges .news-tag-badge {
    position: static;
}

.news-sdg-badge {
    display: inline-flex;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    color: var(--news-sdg-color);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid color-mix(in srgb, var(--news-sdg-color), transparent 35%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.sdg-posts-panel .news-sdg-badge {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}

@media (max-width: 991.98px) {
    .timeline-outer {
        margin-top: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .timeline-steps {
        min-width: max(100%, calc(var(--timeline-count) * 72px));
    }

    .timeline-step {
        flex-basis: 72px;
    }

    .timeline-dot {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .timeline-steps::before {
        top: 12px;
    }

    .timeline-year {
        font-size: 0.92rem;
    }
}
