/**
 * PW Before / After Slider — genesis-custom-blocks/pw-before-after (v1)
 *
 * Interactive draggable comparison slider for showing image edits in
 * before/after pairs. Pure CSS layout; the drag/touch interaction lives
 * in /static/js/pw-before-after.js (loaded once per page by the PHP
 * template).
 *
 * Markup contract emitted by block.php:
 *
 *   <figure class="pw-ba-block">
 *     [optional header: eyebrow / title / subtitle]
 *     <div class="pw-ba"
 *          data-before="https://cdn.photoworkout.com/...before.jpg"
 *          data-after="https://cdn.photoworkout.com/...after.jpg"
 *          data-before-label="Before"
 *          data-after-label="After"
 *          aria-label="..."></div>
 *     [optional caption]
 *   </figure>
 *
 * The empty .pw-ba div is hydrated by JS: it inserts the two <img>s,
 * two labels, the divider line and the round grip, then wires up the
 * pointer/touch handlers. aspect-ratio is set from the before-image's
 * naturalWidth/Height after load so the box never collapses.
 */

.pw-ba-block {
	--pw-ba-bg: #0b1a2e;
	--pw-ba-line: #e1e4ea;
	--pw-ba-after-accent: #28acdf;
	--pw-ba-text: #4b5b72;
	--pw-ba-muted: #6b7a92;

	margin: 24px 0 28px;
	padding: 0;
	font-family: inherit;
	color: var(--pw-ba-text);
}

.pw-ba-block__header { margin: 0 0 12px; }
.pw-ba-block__eyebrow {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #F26B1A;
	margin-bottom: 6px;
}
.pw-ba-block__title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 4px;
	line-height: 1.25;
	color: #1E2A3A;
}
.pw-ba-block__subtitle {
	font-size: 0.95rem;
	color: var(--pw-ba-muted);
	margin: 0;
	line-height: 1.5;
}

/* The slider container — JS will hydrate it. */
.pw-ba-block .pw-ba {
	position: relative;
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	margin: 8px 0 10px;
	user-select: none;
	touch-action: pan-y;
	background: var(--pw-ba-bg);
	cursor: ew-resize;
	border: 1px solid var(--pw-ba-line);
	/* Default aspect ratio while images load; JS overrides from actual image dims. */
	aspect-ratio: 3 / 2;
}

.pw-ba-block .pw-ba img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
}

.pw-ba-block .pw-ba .pw-ba__after-wrap {
	position: absolute;
	inset: 0;
	overflow: hidden;
	width: 50%;
}

.pw-ba-block .pw-ba .pw-ba__after-wrap img {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: auto;
	max-width: none;
}

.pw-ba-block .pw-ba .pw-ba__lbl {
	position: absolute;
	top: 12px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 6px;
	background: rgba(8, 9, 12, 0.72);
	backdrop-filter: blur(3px);
	color: #fff;
	z-index: 3;
	pointer-events: none;
}
.pw-ba-block .pw-ba .pw-ba__lbl--before { left: 12px; }
.pw-ba-block .pw-ba .pw-ba__lbl--after {
	right: 12px;
	color: var(--pw-ba-after-accent);
}

.pw-ba-block .pw-ba .pw-ba__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #fff;
	left: 50%;
	z-index: 4;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

.pw-ba-block .pw-ba .pw-ba__grip {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
	color: #16181f;
	font-size: 18px;
	font-weight: 800;
	pointer-events: none;
}

/* Caption styling matches PW article caption pattern (.cap from current site). */
.pw-ba-block__caption {
	margin: 8px 2px 0;
	font-size: 0.92rem;
	color: var(--pw-ba-muted);
	line-height: 1.55;
}
.pw-ba-block__caption b,
.pw-ba-block__caption strong { color: #1E2A3A; }
.pw-ba-block__caption a { color: #F26B1A; }

/* Editor-only empty state */
.pw-ba-block--empty {
	padding: 16px;
	background: #fff8f1;
	border: 1px dashed #F26B1A;
	border-radius: 8px;
	color: #4b5b72;
}
