/* --------------------------------------------------
   تایم‌لاین نورانی
   -------------------------------------------------- */

/* ═══ تنظیمات ═══ */
.trw-tl {
	--tl-node: 14px;   /* اندازه‌ی نقطه‌ی هر مرحله؛ خط از روی همین اندازه وسط نقطه‌ها می‌نشیند */
	--tl-gap: 16px;   /* فاصله‌ی کارت‌ها */
	--tl-space: 30px;   /* فاصله‌ی خط تا کارت‌ها */
	--tl-inset: 26px;   /* فاصله‌ی نقطه از لبه‌ی کارت (هم‌تراز با متن کارت) */
	--tl-p: 1;   /* پیشرفت خط؛ اسکریپت با اسکرول از ۰ تا ۱ می‌برد */
	--tl-rail: rgba(255, 255, 255, .12);   /* رنگ خط زمینه */
	color: var(--trw-text);
}

.trw-tl-list {
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--tl-n), minmax(0, 1fr));
	gap: var(--tl-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* خط زمینه و خط نورانی؛ بالای خط = نصف نقطه منهای نصف ضخامت خط */
.trw-tl-list::before,
.trw-tl-list::after {
	content: "";
	position: absolute;
	/* از وسط نقطه‌ی اول تا وسط نقطه‌ی آخر؛ ستون آخر = (پهنا - فاصله‌ها) / تعداد */
	inset-inline-start: calc(var(--tl-inset) + var(--tl-node) / 2);
	inset-inline-end: calc((100% - (var(--tl-n) - 1) * var(--tl-gap)) / var(--tl-n) - var(--tl-inset) - var(--tl-node) / 2);
	inset-block-start: calc(var(--tl-node) / 2 - .5px);
	block-size: 1px;
	background: var(--tl-rail);
	pointer-events: none;
}

.trw-tl-list::after {
	background: var(--trw-grad);
	box-shadow: 0 0 14px rgba(216, 59, 255, .7);
	transform-origin: right;
	transform: scaleX(var(--tl-p));
}

.trw-tl-step {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: var(--tl-space);
	min-inline-size: 0;
}

/* نقطه‌ی هر مرحله روی خط */
.trw-tl-node {
	display: block;
	flex: none;
	inline-size: var(--tl-node);
	block-size: var(--tl-node);
	margin-inline-start: var(--tl-inset);
	border: 2px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	background: var(--trw-section1);
	transition: background-color .5s ease, border-color .5s ease, box-shadow .5s ease, transform .5s var(--trw-ease);
}

.trw-tl:not(.is-live) .trw-tl-node,
.trw-tl-step.is-on .trw-tl-node {
	border-color: var(--trw-white);
	background: var(--trw-secondary);
	box-shadow: 0 0 0 6px var(--trw-glow-soft), 0 0 22px var(--trw-glow);
}

/* کارت شیشه‌ای */
.trw-tl-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 26px 22px;
	border: 1px solid var(--trw-line);
	border-radius: 24px;
	background: var(--trw-glass);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .07);
	transition: border-color .5s ease, box-shadow .5s ease, transform .5s var(--trw-ease);
}

.trw-tl-step.is-on .trw-tl-card {
	border-color: rgba(193, 138, 255, .28);
}

.trw-tl-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 40px 90px -40px rgba(146, 61, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* شماره و برچسب لاتین */
.trw-tl-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.trw-tl-meta b {
	font-family: var(--trw-head-font);
	font-size: 1.625rem;
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(to bottom, var(--trw-white) 10%, var(--trw-light-primary) 60%, rgba(146, 61, 255, .3));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.trw-tl-meta span {
	direction: ltr;
	font-family: var(--trw-body-font);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: lowercase;
	color: var(--trw-lighter-primary);
}

.trw-tl-title {
	margin: 0;
	font-family: var(--trw-head-font);
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.5;
	color: var(--trw-white);
}

.trw-tl-text {
	margin: 0;
	font-family: var(--trw-body-font);
	font-size: .9375rem;
	line-height: 1.95;
	color: var(--trw-light-text);
}

/* ─── عمودی (چیدمان عمودی، یا تبلت و موبایل): خط کنار کارت‌ها ─── */
.trw-tl--column .trw-tl-list {
	grid-template-columns: minmax(0, 1fr);
	padding-inline-start: calc(var(--tl-node) + 26px);
}

.trw-tl--column .trw-tl-list::before,
.trw-tl--column .trw-tl-list::after {
	inset-inline: auto;
	inset-inline-start: calc(var(--tl-node) / 2 - .5px);
	inset-block: 28px 28px;
	inline-size: 1px;
	block-size: auto;
}

.trw-tl--column .trw-tl-list::after {
	background: linear-gradient(180deg, var(--trw-primary), var(--trw-secondary));
	transform-origin: top;
	transform: scaleY(var(--tl-p));
}

.trw-tl--column .trw-tl-node {
	position: absolute;
	inset-block-start: 28px;
	inset-inline-start: calc(-1 * (var(--tl-node) + 26px));
	margin: 0;
}

@media (max-width: 1024px) {
	.trw-tl--row .trw-tl-list {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding-inline-start: calc(var(--tl-node) + 26px);
	}

	.trw-tl--row .trw-tl-list::before,
	.trw-tl--row .trw-tl-list::after {
		inset-inline: auto;
		inset-inline-start: calc(var(--tl-node) / 2 - .5px);
		inset-block: 28px 28px;
		inline-size: 1px;
		block-size: auto;
	}

	.trw-tl--row .trw-tl-list::after {
		background: linear-gradient(180deg, var(--trw-primary), var(--trw-secondary));
		transform-origin: top;
		transform: scaleY(var(--tl-p));
	}

	.trw-tl--row .trw-tl-node {
		position: absolute;
		inset-block-start: 28px;
		inset-inline-start: calc(-1 * (var(--tl-node) + 26px));
		margin: 0;
	}
}

@media (max-width: 767px) {
	.trw-tl-card {
		padding: 20px 18px;
		border-radius: 20px;
	}

	.trw-tl-title {
		font-size: 1.125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.trw-tl-node,
	.trw-tl-card {
		transition: none;
	}
}
