/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* container query */

.timeline {
    container-type: inline-size;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* title */

.timeline__header {
    margin-bottom: 40px;
    text-align: center;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* items */

.timeline__items {
    position: relative;

    display: flex;
    gap: 0;
    flex-direction: column;
}

.timeline__item {
    position: relative;
    width: calc(50% - 80px);

    padding: 40px;
    border-radius: 20px;
}
.timeline__item:not(:first-child) {
    margin-top: -80px;
    margin-bottom: 40px;
}

.timeline__item.timeline__item--left {
    align-self: flex-start;
    background: var(--dark-blue);
    border: 6px solid var(--light-blue);
}
.timeline__item.timeline__item--right {
    align-self: flex-end;
    background: var(--dark-purple);
    border: 6px solid var(--mid-purple);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* content */

.timeline__item > *,
.timeline__item > * > * {
    color: var(--white);
}

.timeline__item__content,
.timeline__item p,
.timeline__item li {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.2;
}

.timeline__item__image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    max-height: 300px;
    object-fit: cover;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* date point */

.timeline__item__outer {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
}

.timeline__item.timeline__item--left .timeline__item__outer {
    right: -86px;
}
.timeline__item.timeline__item--right .timeline__item__outer {
    left: -86px;
}

.timeline__item__floating-date {
    margin: 0;
    color: var(--light-blue);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;

    font-size: 52px;
    font-weight: 600;
}

.timeline__item.timeline__item--left .timeline__item__floating-date {
    left: 25px;
}
.timeline__item.timeline__item--right .timeline__item__floating-date {
    right: 25px;
}

.timeline__item.timeline__item--right .timeline__item__outer::after,
.timeline__item.timeline__item--left .timeline__item__outer::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: var(--light-blue);
    border-radius: 50%;
    border: 4px solid var(--white);
    z-index: 2;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* triangle */

.timeline__item__triangle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.timeline__item__triangle svg {
    width: 30px;
    height: auto;
}

/*right side*/
.timeline__item.timeline__item--right .timeline__item__triangle {
    left: -25px;
}
.timeline__item.timeline__item--right .timeline__item__triangle svg {
    color: var(--dark-purple);
}
/*left side*/
.timeline__item.timeline__item--left .timeline__item__triangle {
    right: -25px;
}
.timeline__item.timeline__item--left .timeline__item__triangle svg {
    color: var(--dark-blue);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* line */

.timeline__items__line {
    position: absolute;
    top: 0;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% - 50px);
    width: 1px;
    border-left: 3px dashed var(--gray);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* buttons & load more */

.timeline__items__buttons {
    display: flex;
    justify-content: center;
}

@container (max-width: 992px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* items */

    .timeline__item {
        width: calc(50% - 40px);
        padding: 20px;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* date point */

    .timeline__item.timeline__item--left .timeline__item__outer {
        right: -32px;
    }
    .timeline__item.timeline__item--right .timeline__item__outer {
        left: -32px;
    }

    .timeline__item__floating-date {
        font-size: 32px;
    }
}

@container (max-width: 768px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* items */
    .timeline__items {
        gap: 20px;
    }

    .timeline__item {
        width: 75%;
    }
    .timeline__item:not(:first-child) {
        margin: 0;
    }

    .timeline__item.timeline__item--right .timeline__item__outer::after,
    .timeline__item.timeline__item--left .timeline__item__outer::before {
        display: none;
    }
    .timeline__item__date.h5 {
        display: none;
    }

    .timeline__item.timeline__item--left .timeline__item__floating-date {
        left: 0;
    }
    .timeline__item.timeline__item--right .timeline__item__floating-date {
        right: 0;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* line */

    .timeline__items__line {
        display: none;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* date point */

    .timeline__item__triangle svg {
        width: 22px;
    }
    .timeline__item.timeline__item--left .timeline__item__triangle {
        right: -18px;
    }
    .timeline__item.timeline__item--right .timeline__item__triangle {
        left: -18px;
    }

    .timeline__item__floating-date {
        font-size: 24px;
    }
}
