/* S07 steps strip. */

/* stylelint-disable no-descending-specificity -- section rules are grouped by section, not by specificity */

/* S07 steps: vertical rail on small screens, a horizontal row from lg. */
.wp-block-list.is-style-nbt-steps {
	--nbt-step-line: var(--c-line);
	--nbt-step-ink: var(--c-brand);
	--nbt-step-node: var(--c-paper);
	--nbt-step-on: var(--c-paper);

	margin: var(--space-10) 0 0;
	padding: 0;
	counter-reset: nbt-step;
	list-style: none;
}

.nbt-on-night .wp-block-list.is-style-nbt-steps {
	--nbt-step-line: var(--c-night-path);
	--nbt-step-ink: var(--c-cyan);
	--nbt-step-node: var(--c-night-900);
	--nbt-step-on: var(--c-ink);
}

.is-style-nbt-steps > li {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 32px;
	align-items: center;
	column-gap: var(--space-4);
	min-height: 64px;
	padding-bottom: var(--space-8);
	background: linear-gradient(var(--nbt-step-line), var(--nbt-step-line)) 23px 24px / 2px 100% no-repeat;
	color: var(--c-ink);
	font-size: var(--text-lg);
	font-weight: 600;
	line-height: 1.3;
	counter-increment: nbt-step;
}

.nbt-on-night .is-style-nbt-steps > li {
	color: var(--c-on-night);
}

.is-style-nbt-steps > li:last-child {
	padding-bottom: 0;
	background: none;
}

.is-style-nbt-steps > li::before {
	content: counter(nbt-step, decimal-leading-zero);
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	border: 1.5px solid var(--nbt-step-ink);
	border-radius: var(--radius-sm);
	background: var(--nbt-step-node);
	color: var(--nbt-step-ink);
	font: 600 1rem / 1 var(--font-mono);
}

.is-style-nbt-steps > li:last-child::before {
	background: var(--nbt-step-ink);
	color: var(--nbt-step-on);
}

.is-style-nbt-steps > li[class*="nbt-i-"]::after {
	content: "";
	width: 32px;
	height: 32px;
	background: var(--nbt-step-ink);
	mask: var(--nbt-icon) center / contain no-repeat;
}

@media (max-width: 29.99rem) {

	.is-style-nbt-steps > li[class*="nbt-i-"]::after {
		display: none;
	}
}

@media (min-width: 64rem) {

	.wp-block-list.is-style-nbt-steps {
		position: relative;
		display: grid;
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		container-type: inline-size;
	}

	/* The connector runs from each node to the next one, so the number of steps does not matter. */
	.is-style-nbt-steps > li {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-3);
		min-height: 0;
		padding: 0 var(--space-4) 0 0;
		background: linear-gradient(var(--nbt-step-line), var(--nbt-step-line)) 24px 23px / calc(100% - 24px) 2px no-repeat;
	}

	.is-style-nbt-steps > li::before {
		order: -2;
	}

	.is-style-nbt-steps > li[class*="nbt-i-"]::after {
		order: -1;
		display: block;
	}
}


/* Motion: a pulse runs along the connector of the dark strip. */
@media screen and (prefers-reduced-motion: no-preference) and (min-width: 64rem) {

	.nbt-on-night .wp-block-list.is-style-nbt-steps::after {
		content: "";
		position: absolute;
		top: 23px;
		left: 24px;
		width: 24px;
		height: 2px;
		background: var(--c-cyan);
		animation: nbt-pulse var(--dur-pulse) linear infinite;
	}
}

@keyframes nbt-pulse {

	to {
		transform: translateX(calc(100cqw - 72px));
	}
}
