/**
 * Nexza Services List widget.
 */

.nx-svcs-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 48px;
}

.nx-svcs-head h2 {
	margin-top: 16px;
}

.nx-svc-list {
	display: grid;
	column-gap: clamp(32px, 7vw, 112px);
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--nx-line-2);
}

.nx-svc-list--2 {
	grid-template-columns: 1fr 1fr;
}

.nx-svc-list > li {
	min-width: 0;
	border-bottom: 1px solid var(--nx-line-2);
}

.nx-svc-row {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: 56px 1fr 56px;
	gap: 28px;
	align-items: start;
	padding: 48px 0;
	color: inherit;
}

/* Hover background grows up from the bottom (transform only). */
.nx-svc-row::before {
	content: "";
	position: absolute;
	inset: 0 -18px;
	z-index: -1;
	border-radius: 14px;
	background: var(--nx-card-2);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform .55s var(--nx-ease);
}

.nx-svc-row:hover::before,
.nx-svc-row:focus-visible::before {
	transform: scaleY(1);
	transform-origin: top;
}

.nx-svc-n {
	padding-top: 6px;
	font-weight: 600;
	color: var(--nx-copper);
	font-variant-numeric: tabular-nums;
}

.nx-svc-body {
	display: block;
	min-width: 0;
}

.nx-svc-title {
	display: block;
	margin-bottom: 16px;
	font-size: clamp(22px, 2.2vw, 34px);
	font-weight: 700;
	letter-spacing: -.01em;
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--nx-sand);
	overflow-wrap: break-word;
	transition: transform .55s var(--nx-ease), color .3s;
}

.nx-svc-row:hover .nx-svc-title,
.nx-svc-row:focus-visible .nx-svc-title {
	color: var(--nx-ember);
	transform: translateX(10px);
}

.nx-svc-text {
	display: block;
	max-width: 52ch;
	color: var(--nx-muted-dark);
}

.nx-svc-row:hover .nx-arc,
.nx-svc-row:focus-visible .nx-arc {
	background: var(--nx-copper);
	border-color: var(--nx-copper);
	color: var(--nx-ink);
	transform: rotate(-45deg);
}

/* Floating preview card (created by services.js, desktop mouse only). */
.nx-svc-hov {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 45;
	width: 300px;
	height: 210px;
	margin: -105px 0 0 -150px;
	overflow: hidden;
	border-radius: 22px;
	background: var(--nx-placeholder);
	box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
	pointer-events: none;
	opacity: 0;
	scale: .5;
	transition: opacity .35s, scale .5s var(--nx-ease);
}

.nx-svc-hov.is-on {
	opacity: 1;
	scale: 1;
}

.nx-svc-hov img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nx-svc-hov span {
	position: absolute;
	left: 16px;
	bottom: 14px;
	right: 16px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--nx-sand);
}

@media (max-width: 860px) {
	.nx-svcs-head {
		margin-bottom: 32px;
	}

	.nx-svc-list--2 {
		grid-template-columns: 1fr;
	}

	/* Number on its own line above the title, so title and text get the full width. */
	.nx-svc-row {
		grid-template-columns: 1fr 48px;
		gap: 12px 20px;
		padding: 36px 0;
	}

	.nx-svc-n {
		grid-column: 1 / -1;
		padding-top: 0;
		font-size: 14px;
	}

	.nx-svc-body {
		grid-column: 1;
	}

	.nx-svc-row .nx-arc {
		grid-column: 2;
		grid-row: 2;
	}

	.nx-svc-row .nx-arc {
		width: 48px;
		height: 48px;
	}

	.nx-svc-row::before {
		inset: 0 -10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nx-svc-row::before,
	.nx-svc-title,
	.nx-svc-hov {
		transition: none;
	}
}
