/*
 * Process (version 2): light section, no photo.
 * Steps in one row on a horizontal line with orange balls (the lever ball from the logo),
 * no numbers; a graphite band with call / enquiry buttons below.
 */

.mj-process {
	position: relative;
	isolation: isolate;
	padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 3.5vw, 3rem);
	background: var(--mj-cream);
	color: var(--mj-graphite);
	scroll-margin-top: var(--mj-bar-h);

	/* The sheet comes from the Parts section (no fade at the top), fades out at the bottom */
	--mj-process-fade: linear-gradient(to bottom, #000 calc(100% - 8rem), transparent 100%);
}

/*
 * Background continues the Parts / Services sheet: millimetre paper and, on wide screens,
 * measuring scales in the side margins. Keep in sync with widgets/services/style.css.
 */
.mj-process::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(22, 24, 29, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(22, 24, 29, 0.055) 1px, transparent 1px),
		linear-gradient(rgba(22, 24, 29, 0.028) 1px, transparent 1px),
		linear-gradient(90deg, rgba(22, 24, 29, 0.028) 1px, transparent 1px);
	background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
	background-position: center top;
	-webkit-mask-image: var(--mj-process-fade);
	mask-image: var(--mj-process-fade);
	pointer-events: none;
}

.mj-process::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	z-index: -1;
	display: none;
	width: calc(var(--mj-container) + 5rem);
	transform: translateX(-50%);
	background-image:
		linear-gradient(rgba(22, 24, 29, 0.32) 1px, transparent 1px),
		linear-gradient(rgba(22, 24, 29, 0.2) 1px, transparent 1px),
		linear-gradient(rgba(22, 24, 29, 0.32) 1px, transparent 1px),
		linear-gradient(rgba(22, 24, 29, 0.2) 1px, transparent 1px);
	background-size: 16px 40px, 8px 8px, 16px 40px, 8px 8px;
	background-position: left top, left top, right top, right top;
	background-repeat: repeat-y;
	-webkit-mask-image: var(--mj-process-fade);
	mask-image: var(--mj-process-fade);
	pointer-events: none;
}

@media (min-width: 1380px) {
	.mj-process::after {
		display: block;
	}
}

/* Header: title left, intro right, both ending on the same line (as in the other sections) */
.mj-process__head {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: end;
	gap: 1.75rem clamp(2rem, 5vw, 5rem);
	margin-bottom: clamp(3rem, 5vw, 4rem);
}

.mj-process__title {
	margin: 0;
	font-size: clamp(2.25rem, 3.8vw, 3.25rem);
	letter-spacing: -0.015em;
}

.mj-process__accent {
	display: inline-block;
	background: linear-gradient(var(--mj-orange), var(--mj-orange)) 0 100% / 100% 0.12em no-repeat;
}

.mj-process__intro {
	max-width: 36rem;
	margin: 0;
	padding: 0.125rem 0 0.125rem 1.25rem;
	border-left: 2px solid var(--mj-orange);
	color: rgba(22, 24, 29, 0.68);
	font-size: 1rem;
	line-height: 1.65;
}

/*
 * Steps: equal columns. Each step draws its ball and the line to the next ball;
 * the line of the last step is not drawn.
 */
.mj-process__steps {
	--mj-ball: 1.125rem;

	display: grid;
	grid-template-columns: repeat(var(--mj-steps, 4), minmax(0, 1fr));
	gap: 0 clamp(1.5rem, 3vw, 2.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.mj-process__step {
	position: relative;
	padding-top: calc(var(--mj-ball) + 1.75rem);
}

.mj-process__step::before {
	content: '';
	position: absolute;
	top: calc(var(--mj-ball) / 2 - 1px);
	left: 0;
	right: calc(-1 * clamp(1.5rem, 3vw, 2.5rem));
	height: 2px;
	background: rgba(22, 24, 29, 0.16);
}

.mj-process__step:last-child::before {
	right: 0;
	background: linear-gradient(90deg, rgba(22, 24, 29, 0.16), rgba(22, 24, 29, 0));
}

.mj-process__step::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: var(--mj-ball);
	height: var(--mj-ball);
	border-radius: 50%;
	background: var(--mj-orange);
	box-shadow: 0 0 0 6px var(--mj-cream);
}

.mj-process__step-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.375rem, 2vw, 1.75rem);
	letter-spacing: -0.01em;
}

.mj-process__step-text {
	margin: 0;
	color: rgba(22, 24, 29, 0.72);
	font-size: 0.9375rem;
	line-height: 1.65;
}

/* Path piece of the gear-gate line (only used on wide screens, see below) */
.mj-process__path {
	display: none;
}

/*
 * Wide screens: the line runs like the lever through the H-gate of the logo.
 * Steps 1 and 3 sit high, steps 2 and 4 lower by --mj-drop; between two balls the line runs
 * along the ball row, turns down / up in the middle of the gap (rounded corners, as the
 * channels of the logo mark) and runs on to the next ball. It only passes empty space.
 *
 * Each transition is drawn by two boxes with borders, split at half the drop:
 * - the outgoing half: step ::before, from the ball to the middle of the gap;
 * - the incoming half: .mj-process__path of the next step, from the middle of the gap to its ball.
 */
@media (min-width: 1181px) {
	.mj-process__steps {
		--mj-gap: clamp(1.5rem, 3vw, 2.5rem);
		--mj-drop: 3.5rem;
		--mj-line: rgba(22, 24, 29, 0.22);
		--mj-turn: 0.875rem;

		gap: 0 var(--mj-gap);
	}

	/* Lower steps: ball and text move down by the drop */
	.mj-process__step:nth-child(2n) {
		padding-top: calc(var(--mj-drop) + var(--mj-ball) + 1.75rem);
	}

	.mj-process__step:nth-child(2n)::after {
		top: var(--mj-drop);
	}

	/* Outgoing half: high step goes down (top + right border, top-right corner) */
	.mj-process__step::before,
	.mj-process__step:last-child::before {
		top: calc(var(--mj-ball) / 2 - 1px);
		left: calc(var(--mj-ball) / 2);
		right: calc(-1 * var(--mj-gap) / 2 - 1px);
		width: auto;
		height: calc(var(--mj-drop) / 2 + 1px);
		border-top: 2px solid var(--mj-line);
		border-right: 2px solid var(--mj-line);
		border-top-right-radius: var(--mj-turn);
		background: none;
	}

	/* Outgoing half: low step goes up (bottom + right border, bottom-right corner) */
	.mj-process__step:nth-child(2n)::before {
		top: calc(var(--mj-ball) / 2 + var(--mj-drop) / 2);
		border-top: 0;
		border-bottom: 2px solid var(--mj-line);
		border-top-right-radius: 0;
		border-bottom-right-radius: var(--mj-turn);
	}

	.mj-process__step:last-child::before {
		display: none;
	}

	/* Incoming half */
	.mj-process__path {
		position: absolute;
		left: calc(-1 * var(--mj-gap) / 2 - 1px);
		width: calc(var(--mj-gap) / 2 + 1px + var(--mj-ball) / 2);
		height: calc(var(--mj-drop) / 2 + 1px);
		border-left: 2px solid var(--mj-line);
	}

	/* ...into a low step: comes down, turns right at the bottom (bottom-left corner) */
	.mj-process__step:nth-child(2n) .mj-process__path {
		display: block;
		top: calc(var(--mj-ball) / 2 + var(--mj-drop) / 2);
		border-bottom: 2px solid var(--mj-line);
		border-bottom-left-radius: var(--mj-turn);
	}

	/* ...into a high step (not the first): comes up, turns right at the top (top-left corner) */
	.mj-process__step:nth-child(2n + 3) .mj-process__path {
		display: block;
		top: calc(var(--mj-ball) / 2 - 1px);
		border-top: 2px solid var(--mj-line);
		border-top-left-radius: var(--mj-turn);
	}
}

/* Photo strip: one 4 : 3 frame under each step, same columns and gap as the steps */
.mj-process__photos {
	display: grid;
	grid-template-columns: repeat(var(--mj-steps, 4), minmax(0, 1fr));
	gap: 1.5rem clamp(1.5rem, 3vw, 2.5rem);
	margin: clamp(3rem, 5vw, 4rem) 0 0;
	padding: 0;
	list-style: none;
}

.mj-process__photo {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--mj-graphite);
}

.mj-process__photo picture {
	position: absolute;
	inset: 0;
}

.mj-process .mj-process__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--mj-focus, 50% 50%);
}

/* Step without a photo on the site: an empty place keeps the other photos under their steps */
.mj-process__photo.is-blank {
	background: none;
}

/* Placeholder for a step without a photo (shown only in the Elementor editor) */
.mj-process__photo.is-empty {
	border: 1px dashed rgba(22, 24, 29, 0.28);
	background: rgba(22, 24, 29, 0.04);
}

.mj-process__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	padding: 1rem;
	color: rgba(22, 24, 29, 0.6);
	font-size: 0.875rem;
	text-align: center;
}

.mj-process__placeholder-label {
	color: rgba(22, 24, 29, 0.45);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* Band: question left, buttons right */
.mj-process__band {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem 2.5rem;
	margin-top: clamp(3rem, 5vw, 4rem);
	padding: clamp(1.75rem, 3vw, 2.25rem) clamp(1.75rem, 3.5vw, 3rem);
	border-radius: var(--mj-radius);
	background: var(--mj-graphite);
	color: var(--mj-cream);

	--mj-btn-hover-bg: var(--mj-cream);
	--mj-btn-hover-fg: var(--mj-graphite);
}

.mj-process__band-title {
	margin: 0 0 0.375rem;
	font-family: var(--mj-font-display);
	font-size: 1.375rem;
	font-weight: 800;
	line-height: var(--mj-lh-display);
}

.mj-process__band-text {
	margin: 0;
	color: rgba(242, 240, 235, 0.68);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.mj-process__band-actions {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	gap: 0.75rem;
}

@media (max-width: 1080px) {
	.mj-process__band {
		flex-direction: column;
		align-items: flex-start;
	}
}

/*
 * Up to 1180 px: two rows of two steps (four columns are too narrow there:
 * the texts wrapped into 3 and 4 lines at 1024 px). The header stacks only at 960 px.
 */
@media (max-width: 960px) {
	.mj-process__head {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 1180px) {
	.mj-process__steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 2.5rem;
	}

	.mj-process__step:nth-child(2n)::before {
		right: 0;
		background: linear-gradient(90deg, rgba(22, 24, 29, 0.16), rgba(22, 24, 29, 0));
	}

	.mj-process__photos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Phone: one column, vertical line on the left */
@media (max-width: 600px) {
	.mj-process__steps {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 0;
	}

	.mj-process__step {
		padding: 0 0 2rem 2.75rem;
	}

	.mj-process__step::before,
	.mj-process__step:nth-child(2n)::before {
		top: calc(var(--mj-ball) / 2);
		bottom: calc(-1 * var(--mj-ball) / 2);
		left: calc(var(--mj-ball) / 2 - 1px);
		right: auto;
		width: 2px;
		height: auto;
		background: rgba(22, 24, 29, 0.16);
	}

	.mj-process__step:last-child::before {
		display: none;
	}

	.mj-process__step::after {
		top: 0.3em;
	}

	.mj-process__band-actions {
		flex-direction: column;
		align-self: stretch;
	}

	.mj-process__photos {
		grid-template-columns: minmax(0, 1fr);
		margin-top: 1rem;
	}
}
