/* ============================================================
   History Path — «Наш путь развития»
   ============================================================ */

.history-path {
    background: #fff;
    padding: 64px 120px;
}

.history-path__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Title ── */
.history-path__title {
    font-family: var(--font-neo);
    font-size: 36px;
    line-height: 42px;
    letter-spacing: -1px;
    font-weight: 400;
    text-align: center;
    color: var(--color-black);
}

/* ── Timeline container ── */
.history-path__timeline {
    position: relative;
    width: 100%;
}

/* ── SVG path (desktop) ── */
.history-path__svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Car icon ── */
.history-path__car {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
    will-change: left, top, transform;
}

.history-path__car img {
    display: block;
    width: 24px;
    height: 53px;
}

/* ── Row ── */
.history-path__row {
    display: flex;
    align-items: center;
    gap: 80px;
    height: 300px;
    position: relative;
    z-index: 1;
}

/* ── Point column ── */
.history-path__point-col {
    flex-shrink: 0;
}

.history-path__point-wrap {
    position: relative;
    width: 41px;
    height: 41px;
}

/* Flag above first point */
.history-path__flag {
    position: absolute;
    left: 17.5px;
    top: -34.5px;
    width: 35px;
    height: 52px;
    opacity: 0;
    z-index: 4;
    transition: opacity 0.4s ease;
}

.history-path__flag.is-visible {
    opacity: 1;
}

/* Circle point */
.history-path__point {
    width: 41px;
    height: 41px;
    background: #fff;
    border: 2px solid var(--color-primary);
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.history-path__point > div {
    width: 13px;
    height: 13px;
    background: var(--color-primary);
    border-radius: 100px;
}

/* ── Content (text) ── */
.history-path__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
    height: 100%;
    min-width: 0;
}

.history-path__content--r {
    text-align: right;
}

.history-path__content--l {
    text-align: left;
}

.history-path__event-title {
    font-family: var(--font-neo);
    font-size: 48px;
    line-height: 58px;
    letter-spacing: -1.8px;
    font-weight: 400;
    color: var(--color-black);
    margin: 0;
}

.history-path__event-desc {
    font-family: var(--font-inter);
    font-size: 19px;
    line-height: 30px;
    font-weight: 400;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Year ── */
.history-path__year {
    flex: 1;
    font-family: var(--font-neo);
    font-size: 96px;
    line-height: 1;
    letter-spacing: 1.625px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-black);
    transition: color 0.4s ease;
    min-width: 0;
}

.history-path__year.is-active {
    color: var(--color-primary);
}

.history-path__year--green {
    color: var(--color-primary);
}

.history-path__year--black {
    color: var(--color-black);
}

/* Year on right side (odd rows — year is last child) */
.history-path__row--odd .history-path__year {
    text-align: left;
}

/* Year on left side (even rows — year is first child) */
.history-path__row--even .history-path__year {
    text-align: right;
}

/* ── Tablet ── */
@media (max-width: 1170px) {
    .history-path {
        padding: 64px 48px;
    }

    .history-path__event-title {
        font-size: 36px;
        line-height: 44px;
        letter-spacing: -1px;
    }

    .history-path__year {
        font-size: 72px;
    }

    .history-path__row {
        gap: 40px;
    }
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .history-path {
        padding: 32px 24px;
    }

    /* Hide path SVG and car on mobile */
    .history-path__svg,
    .history-path__car {
        display: none;
    }

    /* Show all flags on mobile (no JS animation) */
    .history-path__flag {
        opacity: 1;
    }

    .history-path__timeline {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .history-path__row {
        flex-direction: column;
        height: auto;
        gap: 8px;
        padding-top: 32px;
        padding-bottom: 32px;
        text-align: center;
    }

    /* Reorder children: point → year → content (same for odd and even) */
    .history-path__point-col {
        order: 1;
    }

    .history-path__year {
        order: 2;
        font-size: 44px;
        line-height: 48px;
        letter-spacing: -2px;
        color: var(--color-primary) !important;
        text-align: center !important;
    }

    .history-path__content {
        order: 3;
        text-align: center;
        gap: 8px;
    }

    .history-path__event-title {
        font-size: 24px;
        line-height: 32px;
        letter-spacing: 0;
        font-weight: 500;
    }

    .history-path__event-desc {
        font-size: 14px;
        line-height: 22px;
    }
}
