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

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

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

.timeline__items {
	position: relative;
	max-width: 760px;

	margin: 0 auto;

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

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

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

.timeline__item.timeline__item--left {
	align-self: flex-start;
	background: var(--blue-dk);
}
.timeline__item.timeline__item--right {
	align-self: flex-end;
	background: var(--purple-dk);
}

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

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

.timeline__item__content,
.timeline__item p,
.timeline__item li {
	font-weight: 500;
}

.timeline__item__image img {
	width: 100%;
	height: auto;
	border-radius: var(--box-border-radius-sm);
}

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

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

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

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

.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(--blue-lt);
	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(--purple-dk);
}
/*left side*/
.timeline__item.timeline__item--left .timeline__item__triangle {
	right: -25px;
}
.timeline__item.timeline__item--left .timeline__item__triangle svg {
	color: var(--blue-dk);
}

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

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

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

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

.timeline__items__buttons .icon svg {
	color: var(--white);
}

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

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

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

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

@container (max-width: 560px) {
	/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
	/* 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;
	}
}
