/**
 * Case study Before / After browser showcase.
 *
 * Kept separate from the global theme bundle so it cannot alter the site
 * header or unrelated templates.
 */

body.single-boylen_case_study .case-study-comparison {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	isolation: isolate;
	background: #d9ddd9;
}

body.single-boylen_case_study .case-study-comparison__image {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

body.single-boylen_case_study .case-study-comparison__image--after {
	z-index: 1;
}

body.single-boylen_case_study .case-study-comparison__image--before {
	z-index: 2;
	clip-path: inset(0 calc(100% - var(--comparison-position)) 0 0);
}

body.single-boylen_case_study .case-study-comparison img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
	object-position: top center;
	filter: saturate(.9) contrast(1.03);
	user-select: none;
	pointer-events: none;
}

body.single-boylen_case_study .case-study-comparison__label {
	position: absolute;
	top: clamp(.7rem, 1.6vw, 1.2rem);
	z-index: 4;
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: .55rem .8rem;
	border-radius: 2px;
	background: rgba(0, 14, 7, .88);
	color: #fff;
	font-size: clamp(.68rem, .9vw, .82rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
	box-shadow: 0 5px 20px rgba(0, 0, 0, .14);
}

body.single-boylen_case_study .case-study-comparison__label--before {
	left: clamp(.7rem, 1.6vw, 1.2rem);
}

body.single-boylen_case_study .case-study-comparison__label--after {
	right: clamp(.7rem, 1.6vw, 1.2rem);
}

body.single-boylen_case_study .case-study-comparison__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--comparison-position);
	z-index: 5;
	width: 4px;
	background: #fff;
	box-shadow: 0 0 8px rgba(0, 14, 7, .24);
	transform: translateX(-50%);
	pointer-events: none;
}

body.single-boylen_case_study .case-study-comparison__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	width: clamp(44px, 5vw, 60px);
	aspect-ratio: 1;
	border: 3px solid #fff;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	place-items: center;
	background: #7cf2b0;
	color: #000e07;
	box-shadow: 0 8px 25px rgba(0, 14, 7, .25);
}

body.single-boylen_case_study .case-study-comparison__handle svg {
	width: 72%;
	height: 72%;
}

body.single-boylen_case_study .case-study-comparison__handle path {
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body.single-boylen_case_study .case-study-comparison__range {
	position: absolute;
	inset: 0;
	z-index: 6;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: ew-resize;
	opacity: 0;
}

body.single-boylen_case_study .case-study-comparison:focus-within .case-study-comparison__handle {
	outline: 0;
}

body.single-boylen_case_study .case-study-comparison--static {
	aspect-ratio: auto;
}

body.single-boylen_case_study .case-study-comparison--static img {
	width: 100%;
	height: auto;
	max-height: 570px;
	object-fit: cover;
	object-position: top;
}

@media (max-width: 780px) {
	body.single-boylen_case_study .case-study-comparison {
		aspect-ratio: 4 / 3;
	}

	body.single-boylen_case_study .case-study-comparison--static {
		aspect-ratio: auto;
	}

	body.single-boylen_case_study .case-study-comparison__label {
		min-height: 30px;
		padding: .45rem .6rem;
		font-size: .58rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.single-boylen_case_study .case-study-comparison__image--before,
	body.single-boylen_case_study .case-study-comparison__divider {
		transition: none;
	}
}
