/*
 * "Can't verify" problem section: a split headline over a draggable
 * before / after aerial-imagery comparison.
 *
 * Measured off the 1440px desktop frame (Layout / 1). The comparison box keeps
 * the design's 1280x514 ratio; the divider position is driven by --split so the
 * static render matches the artwork and JS only enhances it.
 */

.property-database {
	position: relative;
	overflow: hidden;
	padding-block: var(--section-y);
	background: var(--color-bg-default);
}

/* Soft orange-to-violet glow behind the lower half, rebuilt from the design's
   20%-opacity gradient blob as a blurred gradient so it costs no image bytes. */
.property-database::before {
	content: "";
	position: absolute;
	z-index: 0;
	left: 19%;
	top: 64%;
	width: 62%;
	height: 44%;
	border-radius: var(--radius-full);
	background: linear-gradient(
		90deg,
		rgb(254 111 29 / 22%) 0%,
		rgb(96 91 206 / 16%) 55%,
		rgb(71 28 168 / 20%) 100%
	);
	filter: blur(90px);
	pointer-events: none;
}

.property-database__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-80);
}

/* --- Intro ---------------------------------------------------------------- */

.property-database__intro {
	display: flex;
	align-items: flex-end;
	gap: var(--space-80);
}

.property-database__title,
.property-database__lead {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	color: var(--color-text-primary);
}

.property-database__title em {
	color: var(--color-primary);
}

.property-database__lead {
	letter-spacing: -0.02em;
}

.property-database__lead strong {
	font-weight: 600;
}

/* --- Before / after comparison -------------------------------------------- */

.before-after {
	position: relative;
	width: 100%;
	margin: 0;
	aspect-ratio: 1280 / 514;
	border-radius: var(--radius-lg);
	overflow: hidden;
	isolation: isolate;
	touch-action: pan-y;
}

.before-after__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	user-select: none;
}

/* The "after" layer sits on top and is revealed from the divider rightward. */
.before-after__reveal {
	position: absolute;
	inset: 0;
	clip-path: inset(0 0 0 var(--split));
	pointer-events: none;
}

.before-after__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--split);
	width: 2px;
	transform: translateX(-1px);
	background: var(--color-bg-warm);
	box-shadow: 0 0 0 1px rgb(0 0 0 / 8%);
	pointer-events: none;
}

.before-after__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 22px;
	height: 50px;
	border-radius: var(--radius-sm);
	background: var(--color-bg-warm);
	color: var(--color-text-primary);
	box-shadow: var(--shadow-card);
}

.before-after__grip {
	width: 6px;
	height: 24px;
}

/* Full-box invisible range: its thumb is the grab target for the divider. */
.before-after__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	opacity: 0;
	cursor: ew-resize;
	z-index: 3;
	-webkit-appearance: none;
	appearance: none;
}

.before-after__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 44px;
	height: 100%;
	cursor: ew-resize;
}

.before-after__range::-moz-range-thumb {
	width: 44px;
	height: 100%;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: ew-resize;
}

.before-after__range::-moz-range-track {
	background: transparent;
}

.before-after__range:focus-visible {
	outline: 3px solid var(--color-primary);
	outline-offset: -3px;
}

/* --- Mobile --------------------------------------------------------------- */

@media (max-width: 900px) {
	.property-database__intro {
		flex-direction: column;
		align-items: stretch;
		gap: var(--space-24);
	}
}

@media (max-width: 767px) {
	.property-database__inner {
		gap: var(--space-32);
	}

	/* A near-panoramic ratio is too short on phones; give the imagery presence. */
	.before-after {
		aspect-ratio: 3 / 2;
	}
}
