/* ==========================================================================
   Movement.org — Timeline Component
   ========================================================================== */

.timeline-wrap {
    --ink: #2b2b2b;
    --ink-soft: #5c5c5c;
    --paper: #fff;
    --coral: #d9553a;
    --line: #cfcfcf;
    --placeholder: #d4d4d4;
    max-width: 1440px;
    margin: 0 auto;
    padding: 100px 0;
    color: var(--ink);
    position: relative;
}

.timeline-wrap * {
    box-sizing: border-box;
}

/* Header */

.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    position: absolute;
    text-align: right;
    width: 100%;
    padding-right: 20px;
}

.timeline-head h2 {
    margin: 0;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    justify-content: flex-end;
    z-index: 99;
}

.timeline-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition:
            opacity 0.2s ease,
            transform 0.15s ease;
}

.timeline-arrow.prev {
    background: var(--paper);
    border: 1px solid #ddd;
}

.timeline-arrow.next {
    background: var(--coral);
}

.timeline-arrow.prev svg {
    stroke: var(--ink);
}

.timeline-arrow.next svg {
    stroke: #fff;
}

.timeline-arrow:active:not(:disabled) {
    transform: scale(0.94);
}

.timeline-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.timeline-stage {
    position: relative;
}

.timeline-viewport {
    position: relative;
    overflow: hidden;
}

.timeline-track {
    display: flex;
    touch-action: pan-y;
    cursor: grab;
    transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.timeline-track.dragging {
    transition: none;
    cursor: grabbing;
}

.timeline-item {
    display: flex;
    flex: 0 0 25%;
    flex-direction: column;
    padding: 0;
}

.timeline-item-top,
.timeline-item-bottom {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    text-align: center;
}

.timeline-item-top {
    justify-content: flex-end;
}

.timeline-item-bottom {
    justify-content: flex-start;
}

.timeline-item-top.has-card::after,
.timeline-item-bottom.has-card::before {
    content: "";
    width: 1px;
    height: 18px;
    background: var(--line);
}

.timeline-item-top.has-card::after {
    order: 5;
}

/* Timeline Cards */

.timeline-card {
    width: 100%;
    max-width: 350px;
}

.timeline-card .timeline-img {
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 6px;
    background: none;
}

.timeline-card .timeline-img img {
    display: block;
    width: 80%;
    height: auto;
    margin: 0 auto;
}

.timeline-card .timeline-date {
    margin-bottom: 6px;
    color: var(--coral);
    font-size: 15px;
    font-weight: 700;
}

.timeline-card h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.timeline-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.65;
}

.timeline-item-bottom .timeline-card .timeline-img {
    order: 5;
    margin-top: 16px;
    margin-bottom: 0;
}

/* Center Line */

.timeline-spine {
    position: absolute;
    z-index: 1;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--line);
    pointer-events: none;
}

.timeline-line-row {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.timeline-dot {
    position: relative;
    z-index: 3;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 0 3px var(--paper);
    transform: scale(0);
}

.timeline-dot.ignite {
    animation: timeline-ignite 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes timeline-ignite {
    0% {
        transform: scale(0);
    }

    65% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* Progress Indicator */

.timeline-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}

.timeline-pdot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.timeline-pdot.active {
    width: 16px;
    border-radius: 3px;
    background: var(--coral);
}

/* Media Queries */

@media only screen and (max-width: 980px) {
    .timeline-item {
        flex: 0 0 50%;
    }
}

@media only screen and (max-width: 640px) {
    .timeline-wrap {
        padding: 40px 20px 64px;
    }

    .timeline-head h2 {
        font-size: 26px;
    }

    .timeline-item {
        flex: 0 0 100%;
        padding: 0 8px;
    }

    .timeline-spine,
    .timeline-line-row {
        display: none;
    }

    .timeline-item-top,
    .timeline-item-bottom {
        display: block;
        height: auto !important;
    }

    .timeline-item-top.has-card::after,
    .timeline-item-bottom.has-card::before {
        display: none;
    }

    /* Mobile card layout */

    .timeline-card {
        display: flex;
        align-items: flex-start;
        max-width: none;
        gap: 16px;
        text-align: left;
        flex-direction: column;
    }

    .timeline-card .timeline-img {
        flex: 1;
        aspect-ratio: auto;
        margin: 0;
        border-radius: 8px;
        order: 0 !important;
    }

    .timeline-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .timeline-card .timeline-date {
        font-size: 13px;
        letter-spacing: 0.08em;
    }

    .timeline-card h3 {
        margin-bottom: 8px;
        letter-spacing: -0.01em;
    }

    .timeline-card p {
        font-size: 14px;
        line-height: 1.65;
    }

    .timeline-item:nth-child(even) .timeline-card {
        flex-direction: column-reverse;
    }

    .timeline-card .timeline-img img {
        width: 100%;
    }

    .timeline-head {
        position: relative;
        padding-right: 0;
        margin-bottom: 28px;
    }
}