/* Cases — before/after slider. */

/*
 * The track has to bleed past the container, so this section owns no side
 * padding: the head and the track each supply their own gutter. Without this
 * the section padding and the head padding stack and the headline sits 100px
 * in instead of 50px.
 */
.cases { padding-inline: 0; }

.cases__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 40px;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin: 0 auto 40px;
	padding: 0 var(--gutter-mobile);
}

.cases__head .section__title { max-width: 631px; }

.cases__arrows {
	display: flex;
	gap: 12px;
	flex-shrink: 0;
}

.cases__track {
	display: flex;
	gap: 30px;
	padding: 0 var(--gutter-mobile);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	/*
	 * Without this the mandatory snap pulls the first card flush to the
	 * scrollport edge, swallowing the left gutter and pushing the slides out
	 * of alignment with the section headline.
	 */
	scroll-padding-inline: var(--gutter-mobile);
	scrollbar-width: none;
}

.cases__track::-webkit-scrollbar { display: none; }

.case-card {
	display: flex;
	flex-direction: column;
	gap: 30px;
	width: 100%;
	max-width: 655px;
	flex: 0 0 min(100%, 655px);
	padding: 17px 17px 30px;
	scroll-snap-align: start;
	border-radius: var(--radius-lg);
	background: #eaedf3;
}

/* Before / after pair */

.case-card__compare {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3px;
	height: 206px;
	border-radius: 14px;
	overflow: hidden;
}

.case-card__compare img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.case-card__tag {
	position: absolute;
	top: 14px;
	padding: 8px 14px;
	border-radius: var(--radius-pill);
	color: var(--color-white);
	font-size: var(--body-small-size);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -0.7px;
	text-transform: uppercase;
}

.case-card__tag--before {
	left: 14px;
	background: var(--color-primary);
}

.case-card__tag--after {
	right: 14px;
	background: var(--color-accent);
}

/* Problem / solution */

.case-card__pair {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 0 13px;
}

.case-card__label {
	margin-bottom: 7px;
	color: var(--color-neutral-2);
	font-size: var(--body-small-size);
	line-height: 1.4;
	letter-spacing: -0.14px;
}

.case-card__value {
	color: var(--color-primary);
	font-size: var(--body-secondary-size);
	line-height: var(--body-lh);
	letter-spacing: var(--body-secondary-ls);
}

/* Result panel */

.case-card__result {
	margin: 0 13px;
	padding: 21px 25px;
	border-radius: 14px;
	background: var(--color-neutral-7);
}

.case-card__result .case-card__label { color: var(--color-accent); }
.case-card__result .case-card__value { font-weight: 500; }

@media (min-width: 640px) {
	.case-card__pair { flex-direction: row; gap: 33px; }
	.case-card__pair > div:first-child { flex: 0 0 266px; }
}

@media (min-width: 1024px) {
	.cases__head {
		margin-bottom: 60px;
		padding-inline: var(--gutter);
	}
	.cases__track {
		max-width: calc(var(--container) + var(--gutter) * 2);
		margin-inline: auto;
		padding-inline: var(--gutter);
		scroll-padding-inline: var(--gutter);
	}
}

/* Phones: arrows under the track, as in the reviews slider. */
@media (max-width: 767px) {
	.cases { display: flex; flex-direction: column; }
	.cases__head { display: contents; }
	.cases__head .section__title {
		order: 1;
		margin-bottom: 40px;
		padding-inline: var(--gutter-mobile);
	}
	.cases__track { order: 2; }
	.cases__arrows {
		order: 3;
		justify-content: center;
		margin-top: 30px;
	}
}
