/* =============================================================
   PIARNYA — Steps Section
   Зависит от: variables.css, base.css
   ============================================================= */

/* ── СЕКЦИЯ ─────────────────────────────────────────────────── */
.steps {
	background: var(--color-surface);
}

/* ── СПИСОК ─────────────────────────────────────────────────── */
.steps__list {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0;
	position: relative;
	list-style: none;
}

/* Горизонтальная линия-коннектор через все узлы */
.steps__list::before {
	content: '';
	position: absolute;
	top: 28px; /* центр circle (56px / 2) */
	left: calc(100% / 12); /* от центра первой ячейки */
	right: calc(100% / 12); /* до центра последней */
	height: 2px;
	background: var(--gradient-brand);
	opacity: .35;
	z-index: 0;
}

/* ── ШАГ ─────────────────────────────────────────────────────── */
.steps__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--sp-5);
	padding-inline: var(--sp-3);
	position: relative;
	z-index: 1;
}

/* ── УЗЕЛ (кружок с номером) ────────────────────────────────── */
.steps__node {
	width: 56px;
	height: 56px;
	border-radius: var(--radius-full);
	background: var(--gradient-brand);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: var(--shadow-md);
	transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}

.steps__item:hover .steps__node {
	transform: scale(1.12);
	box-shadow: var(--shadow-lg);
}

.steps__num {
	font-family: var(--font-display);
	font-size: var(--text-sm);
	font-weight: 700;
	color: #fff;
	letter-spacing: .04em;
}

/* ── ТЕКСТ ──────────────────────────────────────────────────── */
.steps__body {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
}

.steps__title {
	font-size: var(--text-base);
	font-weight: 700;
	color: var(--color-text);
	line-height: var(--leading-snug);
	transition: color var(--dur-base) var(--ease);
}

.steps__item:hover .steps__title {
	color: var(--color-primary);
}

.steps__desc {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	line-height: var(--leading-normal);
}

/* ── АДАПТИВ — 3 колонки на планшете ───────────────────────── */
@media (max-width: 1024px) {
	.steps__list {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--sp-10) var(--sp-4);
	}

	/* Убираем одну длинную линию, рисуем отдельно для каждого ряда */
	.steps__list::before {
		display: none;
	}

	/* Горизонтальный коннектор внутри каждой ячейки (кроме последней в ряду) */
	.steps__item:not(:nth-child(3n))::after {
		content: '';
		position: absolute;
		top: 28px;
		left: calc(50% + 28px); /* от правого края кружка */
		right: calc(-50% + 28px);
		height: 2px;
		background: var(--gradient-brand);
		opacity: .3;
		z-index: 0;
	}
}

/* ── АДАПТИВ — вертикальный таймлайн на мобиле ──────────────── */
@media (max-width: 640px) {
	.steps__list {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.steps__item:not(:nth-child(3n))::after {
		display: none;
	}

	.steps__item {
		flex-direction: row;
		text-align: left;
		align-items: flex-start;
		gap: var(--sp-5);
		padding: var(--sp-5) 0;
		padding-inline: 0;
		border-bottom: 1px solid var(--color-border);
	}

	.steps__item:last-child {
		border-bottom: none;
	}

	/* Вертикальная линия слева */
	.steps__list::before {
		display: block;
		top: 28px;
		left: 27px; /* центр кружка (56px / 2 - 1px) */
		right: auto;
		width: 2px;
		height: calc(100% - 56px);
		background: var(--gradient-brand);
	}

	.steps__node {
		flex-shrink: 0;
	}
}
