/**
 * VM How It Works Block - Styles
 *
 * @package VM_Base_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   Block wrapper
   ========================================================================== */

.vm-cb-main.vm-how-it-works-block {
	max-width: unset !important;
	width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	background: var(--wp--preset--color--ink, #1a1410);
	color: var(--wp--preset--color--secondary, #f7efdc);
}

/* Let header + steps handle their own scroll animations. */
.vm-cb-main.vm-how-it-works-block.vm-animate {
	opacity: 1;
	transform: none;
	animation: none;
}

/* ==========================================================================
   Section header
   ========================================================================== */

.vm-how-it-works-header {
	text-align: center;
	max-width: 42rem;
	margin: 0 auto 3.5rem;
}

.vm-how-it-works-title {
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--zilla-slab, Georgia, serif);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 700;
	line-height: 1.15;
	color: #fff;
}

.vm-how-it-works-subtitle {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.7;
	color: var(--wp--preset--color--gold, #b98b3d);
}

/* ==========================================================================
   Steps — horizontal timeline
   ========================================================================== */

.vm-how-it-works-steps {
	list-style: none;
	counter-reset: vm-how-step;
	position: relative;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

.vm-how-it-works-steps::before {
	content: "";
	position: absolute;
	top: 2.75rem;
	left: calc(16.666% + 1.5rem);
	right: calc(16.666% + 1.5rem);
	height: 1px;
	background: rgba(185, 139, 61, 0.55);
	z-index: 0;
	pointer-events: none;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

/* Timeline observer target — container stays visible; steps animate in sequence. */
.vm-how-it-works-steps.vm-animate {
	opacity: 1;
	transform: none;
	animation: none;
}

.vm-how-it-works-steps.is-visible::before {
	transform: scaleX(1);
}

@keyframes vm-how-step-roll-in {
	from {
		opacity: 0;
		transform: translateX(-2rem);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.vm-how-it-works-steps:not(.is-visible) .vm-how-it-works-step {
	opacity: 0;
	transform: translateX(-2rem);
}

.vm-how-it-works-steps.is-visible .vm-how-it-works-step {
	animation: vm-how-step-roll-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(1) { animation-delay: 0.2s; }
.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(2) { animation-delay: 0.55s; }
.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(3) { animation-delay: 0.9s; }
.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(4) { animation-delay: 1.25s; }
.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(5) { animation-delay: 1.6s; }
.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(6) { animation-delay: 1.95s; }

/* ==========================================================================
   Individual step
   ========================================================================== */

.vm-how-it-works-step {
	counter-increment: vm-how-step;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.85rem;
	padding: 0 0.5rem;
}

/* ==========================================================================
   Icon + step number badge
   ========================================================================== */

.vm-step-icon-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 5.5rem;
	height: 5.5rem;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--gold, #b98b3d);
	background: var(--wp--preset--color--ink, #1a1410);
	color: var(--wp--preset--color--gold, #b98b3d);
	flex-shrink: 0;
	margin-bottom: 0.35rem;
}

.vm-step-icon-wrap::after {
	content: counter(vm-how-step);
	position: absolute;
	top: -0.1rem;
	right: -0.15rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.45rem;
	height: 1.45rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primary, #c75a2c);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 800;
	line-height: 1;
}

.vm-step-icon {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 2rem;
	height: 2rem;
	font-size: 2rem;
	line-height: 1;
	color: var(--wp--preset--color--gold, #b98b3d);
}

.vm-step-icon::before {
	width: 2rem;
	height: 2rem;
	font-size: 2rem;
	line-height: 1;
}

/* ==========================================================================
   Step text
   ========================================================================== */

.vm-step-eyebrow {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--wp--preset--color--gold, #b98b3d);
}

.vm-step-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--dm-serif-display);
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.vm-step-content {
	margin: 0;
	max-width: 18rem;
	font-size: 0.92rem;
	font-weight: 400;
	line-height: 1.65;
	color: rgba(185, 139, 61, 0.92);
}

/* ==========================================================================
   Editor placeholder
   ========================================================================== */

.vm-how-it-works-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	background: rgba(255, 255, 255, 0.06);
	border: 2px dashed rgba(185, 139, 61, 0.35);
	border-radius: var(--vm-radius-lg, 8px);
	color: rgba(247, 239, 220, 0.85);
	font-size: var(--wp--preset--font-size--medium);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.vm-how-it-works-steps {
		grid-template-columns: 1fr;
		gap: 2.5rem;
		max-width: 24rem;
	}

	.vm-how-it-works-steps::before {
		display: none;
	}

	.vm-how-it-works-step {
		padding: 0;
	}

	.vm-step-content {
		max-width: none;
	}

	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(1) { animation-delay: 0.1s; }
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(2) { animation-delay: 0.35s; }
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(3) { animation-delay: 0.6s; }
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(4) { animation-delay: 0.85s; }
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(5) { animation-delay: 1.1s; }
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step:nth-child(6) { animation-delay: 1.35s; }
}

@media (prefers-reduced-motion: reduce) {
	.vm-how-it-works-steps::before {
		transform: scaleX(1);
		transition: none;
	}

	.vm-how-it-works-steps:not(.is-visible) .vm-how-it-works-step,
	.vm-how-it-works-steps.is-visible .vm-how-it-works-step {
		opacity: 1;
		transform: none;
		animation: none;
	}
}
