/* How It Works module */
.how-it-works {
	--Dark-Blue---20: #afc2d3;
	--Dark-Blue---30: #afc2d3;

	position: relative;
	display: block;
	margin: 0 auto;
}
.how-it-works > .row {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	flex-wrap: wrap;
}

/* ---- Left column ---- */
.how-it-works .how-it-works-left {
	padding: 0 50px 0 24px;

	@media (max-width: 767px) {
		& {
			padding-inline: 24px 50px;
		}
	}
	
	@media (max-width: 767px) {
		& {
			padding-inline: 20px;
		}
	}
}
.how-it-works .hiw-eyebrow {
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--dark-blue);
	border-top: 1px solid var(--Dark-Blue---20);
	padding-top: 14px;
	margin-bottom: 40px;
}
.how-it-works .hiw-headline {
	color: var(--dark-blue);
	margin-bottom: 20px;
}
.how-it-works .hiw-headline > *:last-child {
	margin-bottom: 0;
}

/* ---- Items / accordion ---- */
.how-it-works .hiw-items {
	list-style: none;
	margin: 0;
	padding: 0;
}
.how-it-works .hiw-item {
	position: relative;
	padding: 0;
	border-top: 2px solid var(--Dark-Blue---20);

	&:last-child {
		border-bottom: 2px solid var(--Dark-Blue---20);
	}
}
.how-it-works .hiw-item:first-child {
	border-top: 0;
}
.how-it-works .hiw-item-title {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	padding: 22px 0;
	margin: 0;
	cursor: pointer;
	color: var(--Dark-Blue---30);
	transition: color 600ms var(--ease-out-expo), padding-bottom 300ms var(--ease-out-expo);
	-webkit-appearance: none;
	appearance: none;
	will-change: color, padding-bottom;

	& h3, & .h4-h5 {
		--header-letter-spacing: -0.015em;
		--header-line-height: 1.2;

		line-height: var(--header-line-height);
		letter-spacing: var(--header-letter-spacing);
		text-wrap: pretty;
	}

	&:hover, &:focus {
		color: var(--dark-blue);
	}
}
.how-it-works .hiw-item.active .hiw-item-title {
	color: var(--dark-blue);
	/* padding-bottom: 8px; */
}

/* Progress bar under the active title */
.how-it-works .hiw-progress {
	position: relative;
	display: none;
	height: 2px;
	width: 100%;
	background: var(--Dark-Blue---20);
	background: rgba(255, 255, 255, 0.7);
	overflow: hidden;
	top: 2px;
	z-index: 10;
}
.how-it-works .hiw-item.active .hiw-progress {
	display: block;
}
.how-it-works .hiw-progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	background: var(--dark-blue);
}

/* Collapsible content */
.how-it-works .hiw-item-content {
	height: 0;
	opacity: 0;
	overflow: hidden;
	transform: translateY(0);
	transition: height 600ms var(--ease-out-expo), opacity 1000ms var(--ease-out-expo), transform 600ms var(--ease-out-expo);
	will-change: height, opacity, transform;
}
.how-it-works .hiw-item.active .hiw-item-content {
	height: auto;
	opacity: 1;
	transform: translateY(-14px);
}
.how-it-works .hiw-item-content-inner {
	padding: 0 0 24px;

	@media (max-width: 767px) {
		& {
			padding-block: 10px 30px;
		}
	}
}
.how-it-works .hiw-item-text {
	color: var(--dark-blue);
	max-width: 550px;

	@media (max-width: 767px) {
		& {
			padding-bottom: 30px;
		}
	}
}
.how-it-works .hiw-item-text > *:last-child {
	margin-bottom: 0;
}

/* Inline image only matters on mobile */
.how-it-works .hiw-item-mobile-image {
	display: none;
	pointer-events: none;
}

/* Extra content below the list */
.how-it-works .hiw-extra {
	margin-top: 100px;

	@media (max-width: 767px) {
		& {
			margin-top: 40px;
		}
	}
}

/* ---- Right column / crossfade ---- */
.how-it-works .how-it-works-right {
	padding-inline: 24px;

	@media (max-width: 767px) {
		& {
			padding-inline: 20px;
		}
	}
}
.how-it-works .hiw-images {
	position: relative;
	display: block;
	overflow: visible;
	width: 100%;
	height: 100%;
}
.how-it-works .hiw-image {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 600ms var(--ease-out-cubic);
}
.how-it-works .hiw-image.active {
	position: relative;
	z-index: 10;
	opacity: 1;
	pointer-events: auto;
}
.how-it-works .hiw-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	max-height: calc(100vh - (var(--main-menu-bar-height, 70px) * 2));
	position: sticky;
	top: calc(var(--main-menu-bar-height, 70px) + 30px);
	min-height: 500px;
	pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
	.how-it-works > .row {
		flex-direction: column;
	}
	.how-it-works .how-it-works-right {
		display: none;
	}
	.how-it-works .hiw-item-mobile-image {
		display: block;
		width: 100%;
		height: auto;
		margin-bottom: 0;
		object-fit: cover;
		object-position: center top;
		max-height: 450px;
	}
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.how-it-works .hiw-item-content,
	.how-it-works .hiw-image,
	.how-it-works .hiw-item-title {
		transition: none;
	}
	.how-it-works .hiw-progress {
		display: none !important;
	}
}
