/*
 * Vehicles ("Za koja vozila"): a short white strip. Centered heading, then four vehicles that
 * stand on one road (a measuring ruler like the one in the footer), each with its name below.
 */

.mj-vehicles {
	padding: clamp(3rem, 6vw, 4.5rem) 0;
	/*
	 * Not plain white: cream flows in from the Services section above, the middle opens up into a
	 * soft white light behind the vehicles, and a slightly darker cream "floor" lies below the road.
	 * The photos are blended with multiply, so their white simply takes on this background.
	 */
	background:
		radial-gradient(ellipse 55% 48% at 50% 64%, #fff 0%, rgba(255, 255, 255, 0) 100%),
		linear-gradient(180deg, var(--mj-cream) 0%, #f8f7f3 40%, #f8f7f3 70%, #ebe8e0 100%);
	color: var(--mj-graphite);
	scroll-margin-top: var(--mj-bar-h);
}

/* Centered heading */
.mj-vehicles__head {
	max-width: 60rem; /* wide enough for the heading in one line; the intro keeps its own narrower width */
	margin: 0 auto clamp(2rem, 4vw, 3rem);
	text-align: center;
}

.mj-vehicles__head .mj-eyebrow {
	justify-content: center;
}

.mj-vehicles__head .mj-eyebrow::after {
	content: '';
	flex: none;
	width: 2rem;
	height: 2px;
	background: var(--mj-orange);
}

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

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

.mj-vehicles__intro {
	max-width: 44rem;
	margin: 0 auto;
	color: rgba(22, 24, 29, 0.68);
	font-size: 1rem;
	line-height: 1.65;
}

/* Row of vehicles on one road */
.mj-vehicles__row {
	/* Height of the vehicle area when no vehicle has a photo (names only) */
	--mj-art-h: clamp(4.5rem, 7.6vw, 6.5rem);
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--mj-vehicles, 4), minmax(0, 1fr));
	gap: 0 clamp(0.5rem, 2vw, 1.5rem);
}

/* The road: base line, short ticks every 8 px, long ticks every 40 px, fading at both ends */
.mj-vehicles__row::before {
	content: '';
	position: absolute;
	right: 0;
	left: 0;
	top: calc(var(--mj-art-h) * 0.963 - 7px);
	height: 14px;
	background:
		linear-gradient(rgba(22, 24, 29, 0.28), rgba(22, 24, 29, 0.28)) 0 7px / 100% 1px no-repeat,
		repeating-linear-gradient(90deg, rgba(22, 24, 29, 0.28) 0 1px, transparent 1px 40px) 0 8px / 100% 6px no-repeat,
		repeating-linear-gradient(90deg, rgba(22, 24, 29, 0.16) 0 1px, transparent 1px 8px) 0 8px / 100% 3px no-repeat;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	pointer-events: none;
}

.mj-vehicle {
	margin: 0;
	text-align: center;
}

.mj-vehicle__art {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	height: var(--mj-art-h);
}

/* Elementor editor only: a vehicle without a photo */
.mj-vehicle__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border: 1px dashed rgba(22, 24, 29, 0.3);
	color: rgba(22, 24, 29, 0.55);
	font-size: 0.8125rem;
}

/*
 * Photo mode: cut-outs on white, all at the same three-quarter angle. The white is blended away,
 * the vehicles stand on the road line, the taller ones simply rise higher.
 */
.mj-vehicles__row--photos {
	/* Height of the tallest vehicle (tractor unit); the others follow with --mj-scale */
	--mj-art-h: clamp(5rem, 9.6vw, 8.5rem);
}

.mj-vehicles__row--photos::before {
	top: calc(var(--mj-art-h) - 9px);
}

.mj-vehicles .mj-vehicle__photo { /* stronger than Elementor's ".elementor img { height: auto }" */
	display: block;
	width: auto;
	max-width: 100%;
	height: calc(var(--mj-art-h) * var(--mj-scale, 1));
	object-fit: contain;
	object-position: center bottom;
}

/*
 * The white of the photos is blended away on the whole figure, not on the image: the reveal
 * animation fades the figure with opacity, which would isolate an image-level blend and flash
 * white rectangles on the cream background while the vehicles appear.
 */
.mj-vehicles__row--photos .mj-vehicle {
	mix-blend-mode: multiply;
}

.mj-vehicle__label {
	margin-top: 1.5rem;
	font-family: var(--mj-font-display);
	font-size: clamp(1rem, 1.5vw, 1.25rem);
	font-weight: 800;
	line-height: var(--mj-lh-display);
}

/* Two by two on tablets and phones: every vehicle has its own piece of road */
@media (max-width: 700px) {
	.mj-vehicles__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2rem 1rem;
	}

	.mj-vehicles__row::before {
		display: none;
	}

	.mj-vehicle__art {
		position: relative;
	}

	.mj-vehicle__art::after {
		content: '';
		position: absolute;
		right: 0;
		bottom: calc(var(--mj-art-h) * 0.037 - 0.5px);
		left: 0;
		height: 1px;
		background: rgba(22, 24, 29, 0.28);
	}

	.mj-vehicle__label {
		margin-top: 0.875rem;
	}
}
