/* =========================================================
   TIMELINE
========================================================= */

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-9);
    padding-block: var(--space-9);
	padding-inline: var(--space-5);
}


/* =========================================================
   TIMELINE CENTER LINE
========================================================= */

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: var(--color-accent);
    border-radius: var(--radius-pill);
}


/* =========================================================
   UPDATE CARD
========================================================= */

.update-card {
    position: relative;

    width: 45%;
    padding: var(--space-4) var(--space-5);

    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        background-color var(--transition);
}


/* =========================================================
   CARD HOVER
========================================================= */

.update-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
}


/* =========================================================
   TIMELINE DOT
========================================================= */

.update-card::before {
    content: "";

    position: absolute;
    top: var(--space-4);

    width: 14px;
    height: 14px;

    background: var(--color-accent);
    border: 3px solid var(--color-surface);
    border-radius: var(--radius-round);

    box-shadow: 0 0 0 3px var(--color-accent);
}


/* =========================================================
   LEFT CARD
========================================================= */

.update-card.left {
    align-self: flex-start;
}

.update-card.left::before {
    right: -36px;
}


/* =========================================================
   RIGHT CARD
========================================================= */

.update-card.right {
    align-self: flex-end;
}

.update-card.right::before {
    left: -36px;
}


/* =========================================================
   DATE
========================================================= */

.update-date {
    margin-bottom: var(--space-2);

    color: var(--color-warning);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}


/* =========================================================
   TITLE
========================================================= */

.update-title {
    margin-bottom: var(--space-2);

    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
}


/* =========================================================
   DETAILS
========================================================= */

.update-details {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}


/* =========================================================
   TABLET / SMALL DESKTOP
   <= 1100px
========================================================= */

@media (max-width: 1100px) {

    .timeline {
        gap: var(--space-7);
        padding-block: var(--space-8);
    }

    .update-card {
        width: 48%;
        padding: var(--space-4);
    }

    .update-card::before {
        width: 12px;
        height: 12px;
        top: var(--space-4);
    }

    .update-card.left::before {
        right: -30px;
    }

    .update-card.right::before {
        left: -30px;
    }

    .update-title {
        font-size: var(--font-size-sm);
    }

    .update-details {
        font-size: var(--font-size-sm);
        line-height: var(--line-height-normal);
    }
}


/* =========================================================
   TABLET
   <= 900px
========================================================= */

@media (max-width: 900px) {

    .timeline {
        gap: var(--space-6);
    }

    .update-card {
        width: 48%;
    }

    .update-card:hover {
        transform: translateY(-4px);
    }
}


/* =========================================================
   MOBILE
   <= 600px
========================================================= */

@media (max-width: 600px) {

    .timeline {
        gap: var(--space-5);
        padding-block: var(--space-5);
        padding-inline: 0;
    }

    /* خط سمت چپ */

    .timeline::before {
        left: 14px;
        transform: none;
        width: 2px;
    }


    /* کارت‌ها یک‌ستونه */

    .update-card {
        width: calc(100% - 36px);
        margin: 0;
        margin-inline-start: 36px;

        padding: var(--space-4);
        border-radius: var(--radius-md);

        align-self: stretch;
    }

    .update-card.left,
    .update-card.right {
        align-self: stretch;
    }


    /* نقطه روی خط */

    .update-card::before {
        left: -30px !important;
        right: auto !important;

        top: var(--space-4);

        width: 12px;
        height: 12px;

        border: 3px solid var(--color-surface);
        box-shadow: 0 0 0 2px var(--color-accent);
    }


    /* متن */

    .update-date {
        font-size: var(--font-size-xs);
    }

    .update-title {
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-bold);
    }

    .update-details {
        font-size: var(--font-size-sm);
        line-height: var(--line-height-normal);
    }
}


/* =========================================================
   SMALL MOBILE
   <= 480px
========================================================= */

@media (max-width: 480px) {

    .timeline {
        gap: var(--space-4);
        padding-block: var(--space-4);
    }

    .timeline::before {
        left: 12px;
    }

    .update-card {
        width: calc(100% - 32px);
        margin-inline-start: 32px;

        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
    }

    .update-card::before {
        left: -27px !important;
        top: var(--space-4);

        width: 10px;
        height: 10px;
    }

    .update-date {
        margin-bottom: var(--space-1);
        font-size: var(--font-size-xs);
    }

    .update-title {
        margin-bottom: var(--space-2);
        font-size: var(--font-size-sm);
    }

    .update-details {
        font-size: var(--font-size-xs);
        line-height: var(--line-height-normal);
    }

    .update-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
}


/* =========================================================
   EXTRA SMALL
   <= 360px
========================================================= */

@media (max-width: 360px) {

    .timeline {
        gap: var(--space-4);
        padding-block: var(--space-3);
    }

    .timeline::before {
        left: 10px;
        width: 2px;
    }

    .update-card {
        width: calc(100% - 28px);
        margin-inline-start: 28px;

        padding: var(--space-3);
        border-radius: var(--radius-sm);
    }

    .update-card::before {
        left: -22px !important;
        top: var(--space-3);

        width: 8px;
        height: 8px;

        border-width: 3px;
        box-shadow: 0 0 0 2px var(--color-accent);
    }

    .update-date {
        margin-bottom: var(--space-1);
        font-size: 11px;
    }

    .update-title {
        margin-bottom: var(--space-1);
        font-size: var(--font-size-xs);
        line-height: var(--line-height-tight);
    }

    .update-details {
        font-size: 11px;
        line-height: var(--line-height-normal);
    }
}