/* No Smoke No Fire — Before/After split widget.
   16:9 stage, draggable divider reveals the AFTER image on the right of the
   handle. Visitors can only drag the divider — nothing else is editable. */

.sg-ba {
	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%;
	overflow: hidden;
	border-radius: var(--sgba-radius, 0px);
	user-select: none;
	--sgba-pos: 50%;
}
.sg-ba__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}
.sg-ba__img--after { clip-path: inset(0 0 0 var(--sgba-pos)); }

/* divider + handle */
.sg-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--sgba-pos);
	width: var(--sgba-linew, 3px);
	transform: translateX(-50%);
	background: var(--sgba-line, #ffffff);
	z-index: 3;
	pointer-events: none;
}
.sg-ba__handle {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: absolute;
	top: 50%;
	left: var(--sgba-pos);
	transform: translate(-50%, -50%);
	width: var(--sgba-handle, 52px);
	height: var(--sgba-handle, 52px);
	min-width: 0 !important;
	padding: 0 !important;
	border: var(--sgba-linew, 3px) solid var(--sgba-handleborder, var(--sgba-line, #ffffff)) !important;
	border-radius: 50% !important;
	background: var(--sgba-handlebg, rgba(0, 0, 0, 0.45)) !important;
	background-image: none !important;
	color: var(--sgba-arrow, #ffffff) !important;
	transition: none !important; /* kit button transition:all made the handle lag the divider */
	cursor: ew-resize;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
	touch-action: none; /* handle drags horizontally; page scroll stays available elsewhere */
}
.sg-ba__handle svg { width: 30%; height: 30%; display: block; }
.sg-ba__handle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sg-ba.is-dragging,
.sg-ba.is-dragging .sg-ba__handle { cursor: ew-resize; }

/* labels — v1.17.0: top-aligned by default, and both styles size off the single
   --sgba-labelh control so pills and redacted bars scale together. The pill
   ratios (0.158 / 0.42 / 0.342) reproduce the old 6px/16px/13px look at the
   pre-1.17 bar height of 38px. */
.sg-ba__label {
	position: absolute;
	top: var(--sgba-labeltop, 16px);
	bottom: var(--sgba-labelbottom, auto);
	z-index: 3;
	padding: calc(var(--sgba-labelh, 57px) * 0.158) calc(var(--sgba-labelh, 57px) * 0.42);
	border-radius: 999px;
	background: var(--sgba-labelbg, rgba(0, 0, 0, 0.65));
	color: var(--sgba-labelcolor, #ffffff);
	font-size: calc(var(--sgba-labelh, 57px) * 0.342);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	pointer-events: none;
}
.sg-ba__label--before { left: 16px; }
.sg-ba__label--after { right: 16px; }
/* Fullscreen puts a close button top-right; keep a top-aligned After label off it. */
.sg-ba-fs .sg-ba__label--after { right: var(--sgba-labelfsright, 64px); }

/* Each label is clipped to its own side of the seam, using the SAME geometry as
   the image clip above — so a label never floats over the image that has won the
   frame. Drag toward one edge and that side's label tucks away with its picture,
   which keeps "which one am I looking at" unambiguous at the extremes. */
.sg-ba__labelclip {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}
.sg-ba__labelclip--before { clip-path: inset(0 calc(100% - var(--sgba-pos)) 0 0); }
.sg-ba__labelclip--after { clip-path: inset(0 0 0 var(--sgba-pos)); }

/* ── pair tabs (v1.10.0): switch between comparisons on one stage ── */
.sg-ba-set__tabs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.sg-ba-set__tab {
	appearance: none !important;
	-webkit-appearance: none !important;
	padding: 9px 20px;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: rgba(255, 255, 255, 0.08);
	color: #d7dce0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none !important;
	text-shadow: none !important;
	background-image: none !important;
	transition: background 0.15s ease, color 0.15s ease;
}
.sg-ba-set__tab.is-active { background: #ffffff; color: #16232e; }
.sg-ba-set__tab:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ── mobile fullscreen flow (v1.12.0) ──────────────────────────────────
   Phones get a tap prompt on the stage; tapping opens a fullscreen overlay
   that asks for landscape (pure-CSS orientation swap), then shows the
   full-bleed comparison. Desktop/tablet unchanged. */
.sg-ba__prompt { display: none; }
@media (max-width: 767px) {
	.sg-ba--mobilefs .sg-ba__prompt {
		appearance: none !important;
		-webkit-appearance: none !important;
		position: absolute;
		inset: 0;
		z-index: 6;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 10px;
		width: 100%;
		border: 0 !important;
		background: rgba(8, 10, 12, 0.55) !important;
		color: #ffffff;
		font-size: 14px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		cursor: pointer;
		box-shadow: none !important;
		text-shadow: none !important;
	}
	.sg-ba--mobilefs .sg-ba__prompt svg { width: 34px; height: 34px; }
}

.sg-ba-fs {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: #0b0d0f;
	display: none;
}
.sg-ba-fs.is-open { display: block; }
.sg-ba-fs__close {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	min-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.12) !important;
	color: #ffffff;
	cursor: pointer;
	z-index: 10;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: none !important;
	font-size: 0;
}
.sg-ba-fs__close svg { width: 16px; height: 16px; display: block; }

/* rotate prompt (portrait) vs stage (landscape) — CSS-only swap */
.sg-ba-fs__rotate {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding: 32px;
	text-align: center;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
}
.sg-ba-fs__phone {
	width: 44px;
	height: 74px;
	border: 3px solid #ffffff;
	border-radius: 10px;
	position: relative;
	animation: sgba-rotate 1.8s ease-in-out infinite alternate;
}
.sg-ba-fs__phone::after {
	content: "";
	position: absolute;
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	width: 14px;
	height: 3px;
	border-radius: 3px;
	background: #ffffff;
}
@keyframes sgba-rotate {
	0%, 30% { transform: rotate(0deg); }
	70%, 100% { transform: rotate(90deg); }
}
.sg-ba-fs__slot {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	padding: 10px;
}
@media (orientation: landscape) {
	.sg-ba-fs__rotate { display: none; }
	.sg-ba-fs__slot { display: flex; }
}
.sg-ba-fs__slot .sg-ba-set,
.sg-ba-fs__slot > .sg-ba { width: 100%; max-width: calc((100vh - 70px) * 16 / 9); }
.sg-ba-fs .sg-ba__prompt { display: none !important; }
@media (prefers-reduced-motion: reduce) {
	.sg-ba-fs__phone { animation: none; transform: rotate(90deg); }
}
body.sg-ba-lock { overflow: hidden; }

/* ── SG signature moves (v1.13.0) ─────────────────────────────────────── */

/* Glitch seam: RGB-split bands + jittering slices of the AFTER image,
   clipped to a strip around the divider. Vars randomized by JS while
   dragging / during the release + tease bursts. */
.sg-ba__seamfx {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
	opacity: 0;
	transition: opacity 0.12s ease;
}
.sg-ba.is-glitching .sg-ba__seamfx { opacity: 1; }
.sg-ba__seamfx .sgfx {
	position: absolute;
	inset: 0;
	background-image: var(--sgba-afterimg);
	background-size: cover;
	background-position: center;
	/* every fragment is its own thin band around the seam — position, height,
	   horizontal reach, offset, and visibility all randomized independently,
	   so nothing ever lines up into readable columns */
	clip-path: inset(var(--t, 30%) calc(100% - var(--sgba-pos) - var(--sp, 24px)) var(--b, 60%) calc(var(--sgba-pos) - var(--sp, 24px)));
	transform: translateX(var(--a, 0px));
	opacity: var(--o, 0);
}
.sg-ba__seamfx .sgfx--red { filter: url(#sg-glitch-red); mix-blend-mode: screen; }
.sg-ba__seamfx .sgfx--cyan { filter: url(#sg-glitch-cyan); mix-blend-mode: screen; }

/* the classic layer: full-height RGB shift bands hugging the seam (the
   original effect), flickering under the erratic fragments above */
.sg-ba__seamfx .sgfx-band {
	position: absolute;
	inset: 0;
	background-image: var(--sgba-afterimg);
	background-size: cover;
	background-position: center;
	mix-blend-mode: screen;
	clip-path: inset(0 calc(100% - var(--sgba-pos) - var(--bd-sp, 20px)) 0 calc(var(--sgba-pos) - var(--bd-sp, 20px)));
	transform: translateX(var(--bd-a, 0px));
	opacity: var(--bd-o, 0);
}
.sg-ba__seamfx .sgfx-band--red { filter: url(#sg-glitch-red); }
.sg-ba__seamfx .sgfx-band--cyan { filter: url(#sg-glitch-cyan); }

/* ── lite mode (v1.17.2): phones / coarse pointers ──
   The SVG colour-matrix filters are the expensive part — each one rasterizes a
   stage-sized layer through a filter graph, ~38 times per tick. background-blend
   tinting lands the same red/cyan separation during paint, with no filter graph
   and no extra layer. JS adds .sg-ba--lite and parks the surplus fragments. */
.sg-ba--lite .sg-ba__seamfx .sgfx--red,
.sg-ba--lite .sg-ba__seamfx .sgfx-band--red {
	filter: none;
	background-color: #ff2f2f;
	background-blend-mode: multiply;
}
.sg-ba--lite .sg-ba__seamfx .sgfx--cyan,
.sg-ba--lite .sg-ba__seamfx .sgfx-band--cyan {
	filter: none;
	background-color: #24ffff;
	background-blend-mode: multiply;
}

/* In fullscreen the whole stage is the drag surface and page scroll is already
   locked, so hand every touch straight to the slider instead of letting the
   browser arbitrate against a scroll gesture first. */
.sg-ba-fs .sg-ba { touch-action: none; }

/* Handle: SG icon variant — gold ring, icon mark, muzzle flash on first grab */
.sg-ba--handle-icon .sg-ba__handle {
	/* no ring at all — the icon floats on the divider; the button stays as
	   the (invisible) hit target */
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	gap: 0;
}
.sg-ba__handle-icon {
	/* CSS-mask render of the icon so its color can change when active
	   (icon aspect ratio 179:475 ≈ 0.377) */
	height: var(--sgba-iconh, 64px);
	width: calc(var(--sgba-iconh, 64px) * 0.377);
	display: block;
	pointer-events: none;
	background-color: #fcfbf6;
	-webkit-mask: var(--sgba-icon) no-repeat center / contain;
	mask: var(--sgba-icon) no-repeat center / contain;
	filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.65));
	transition: background-color 0.15s ease, filter 0.15s ease;
}

/* active (dragging): divider + icon go SG amber and glow */
.sg-ba__divider { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.sg-ba.is-dragging .sg-ba__divider {
	background: #f69d1c;
	box-shadow: 0 0 14px 2px rgba(246, 157, 28, 0.75);
}
.sg-ba.is-dragging .sg-ba__handle-icon {
	background-color: #f69d1c;
	filter: drop-shadow(0 0 10px rgba(246, 157, 28, 0.85));
}
.sg-ba.is-dragging .sg-ba__handle { color: #f69d1c; } /* arrows variant */
.sg-ba__handle::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
}
.sg-ba__handle.is-fired::after {
	animation: sgba-flash 0.45s ease-out 1;
}
@keyframes sgba-flash {
	0%   { opacity: 0.9; box-shadow: 0 0 0 0 rgba(252, 172, 4, 0.85), 0 0 22px 6px rgba(252, 172, 4, 0.55); }
	100% { opacity: 0; box-shadow: 0 0 0 26px rgba(252, 172, 4, 0), 0 0 34px 14px rgba(252, 172, 4, 0); }
}

/* Redacted labels: JS swaps the pill for a wobbly bar SVG (text lives in
   the SVG); the span becomes a transparent shell. */
.sg-ba__label--redacted {
	background: transparent !important;
	padding: 0 !important;
	line-height: 0;
}
.sg-ba__label--redacted svg { display: block; height: var(--sgba-labelh, 57px); width: auto; overflow: visible; }

@media (prefers-reduced-motion: reduce) {
	.sg-ba__seamfx { display: none; }
	.sg-ba__handle.is-fired::after { animation: none; }
}
