/**
 * Noble Workshops — Step Slider
 *
 * Layout model:
 *  - .nw-steps sits in the page container like any widget, and the arrow row
 *    stays inside it.
 *  - .nw-steps__viewport is the scroller. The script stretches it to the full
 *    viewport width and pads it by the container's own left/right offsets, so
 *    the first card lines up with the container edge while cards scrolled past
 *    carry on into the margin and leave at the edge of the screen.
 *  - Scrolling is native with snap points, so touch and trackpad swipes land
 *    on a card; the arrows step one card at a time.
 *
 * Values below come from Figma: Noble Workshops Redesign → "The Heart's
 * Journey" (node 2292:6096). 419×409 images, 20px corners, 31px gaps, text
 * below each image, 50px outlined arrow buttons 49px below the cards.
 */

.nw-steps {
	--nw-font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--nw-font-heading: "Marcellus", Georgia, "Times New Roman", serif;

	--nw-card-w: 419px;
	--nw-card-gap: 31px;
	--nw-image-h: 409px;
	--nw-image-radius: 20px;
	--nw-text-space: 19px;
	--nw-footer-space: 49px;

	--nw-arrow-size: 50px;
	--nw-arrow-icon: 20px;
	--nw-arrow-gap: 20px;
	--nw-arrow-color: #ffffff;
	--nw-arrow-color-hover: #2f403d;

	--nw-duration: 200ms;

	/* Room for the image shadow, which the scroller would otherwise clip. */
	--nw-shadow-room: 44px;

	position: relative;
}

/* Same 419:409 shape, small enough that the next card peeks in on phones. */
@media (max-width: 767px) {
	.nw-steps {
		--nw-card-w: 300px;
		--nw-image-h: 293px;
	}
}

.nw-steps *,
.nw-steps *::before,
.nw-steps *::after {
	box-sizing: border-box;
}

/* --- Cards --------------------------------------------------------------- */

.nw-steps__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-block: var(--nw-shadow-room);
	margin-block: calc(var(--nw-shadow-room) * -1);
}

.nw-steps__viewport::-webkit-scrollbar {
	display: none;
}

.nw-steps__viewport {
	cursor: grab;
}

.nw-steps.is-dragging .nw-steps__viewport {
	cursor: grabbing;
	user-select: none;
}

.nw-steps__track {
	display: flex;
	gap: var(--nw-card-gap);
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nw-steps__slide {
	flex: 0 0 var(--nw-card-w);
	width: var(--nw-card-w);
	margin: 0;
	scroll-snap-align: start;
}

.nw-steps__media {
	height: var(--nw-image-h);
	overflow: hidden;
	border-radius: var(--nw-image-radius);
	/* The 0 0 44px rgba(0,0,0,.09) shadow comes from the Elementor control, so
	   it can be switched off there. */
}

/* Doubled class so it outranks Elementor's `.elementor img { height: auto }`,
   which would otherwise leave the photo short of its frame. */
.nw-steps .nw-steps__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	-webkit-user-drag: none;
	user-select: none;
}

.nw-steps__body {
	padding-top: var(--nw-text-space);
}

.nw-steps__label,
.nw-steps__title,
.nw-steps__subtitle,
.nw-steps__text {
	margin: 0;
	padding: 0;
}

.nw-steps__label {
	color: #c97e61;
	font-family: var(--nw-font-body);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.nw-steps__title {
	margin-top: 8px;
	color: #ffffff;
	font-family: var(--nw-font-heading);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2;
}

.nw-steps__subtitle {
	margin-top: 10px;
	color: #ffffff;
	font-family: var(--nw-font-body);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.5;
}

.nw-steps__text {
	margin-top: 3px;
	color: #ffffff;
	font-family: var(--nw-font-body);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
}

/* --- Arrows -------------------------------------------------------------- */

.nw-steps__footer {
	display: flex;
	justify-content: flex-end;
	margin-top: var(--nw-footer-space);
}

/*
 * Arrows move under the card's left edge on phones. At the right edge of the
 * row is where the next card peeks in, so right-aligned arrows read as
 * belonging to that half-visible card rather than to the one in view. The
 * footer is a sibling of the viewport and the viewport has no horizontal
 * padding, so flex-start lines them up with the card edge exactly.
 *
 * This has to come AFTER the rule above, not in the variables block at the top
 * of the file: same specificity, so load order is what decides it.
 */
@media (max-width: 767px) {
	.nw-steps__footer {
		justify-content: flex-start;
	}
}

.nw-steps__arrows {
	display: flex;
	align-items: center;
	gap: var(--nw-arrow-gap);
}

/*
 * Every state is spelled out, at a specificity above the theme's
 * `button:hover, button:focus { background: #c36 }` reset, so no theme colour
 * leaks through on hover, after a click, or on a disabled arrow.
 */
.nw-steps .nw-steps__arrow,
.nw-steps .nw-steps__arrow:hover,
.nw-steps .nw-steps__arrow:focus,
.nw-steps .nw-steps__arrow:active,
.nw-steps .nw-steps__arrow:disabled {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--nw-arrow-size);
	height: var(--nw-arrow-size);
	margin: 0;
	padding: 0;
	border: 1px solid var(--nw-arrow-color);
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: var(--nw-arrow-color);
	font-size: var(--nw-arrow-icon);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	outline: none;
	transition: background-color var(--nw-duration) ease, color var(--nw-duration) ease, opacity var(--nw-duration) ease;
}

.nw-steps .nw-steps__arrow svg {
	width: var(--nw-arrow-icon);
	height: var(--nw-arrow-icon);
	fill: currentColor;
}

@media (hover: hover) {
	.nw-steps .nw-steps__arrow:hover:not(:disabled) {
		background: var(--nw-arrow-color);
		color: var(--nw-arrow-color-hover);
	}
}

.nw-steps .nw-steps__arrow:focus-visible {
	outline: 2px solid var(--nw-arrow-color);
	outline-offset: 3px;
}

.nw-steps .nw-steps__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}
