/**
 * Faux Split — front-end styles.
 *
 * Both panels are clipped along the same slanted edge: (split + tilt) at the
 * top, (split - tilt) at the bottom, where tilt = tan(angle) x height / 2.
 * At the 15° / 520px defaults that is a 69.7px shift — a true 15° line.
 *
 * Small screens (≤782px): the panels stack, the image column is always on
 * top, and the divider becomes a straight 90° edge.
 */

.faux-split {
	position: relative;
	min-height: var(--fs-height, 520px);
	overflow: hidden;
	border: none;
	border-radius: var(--fs-radius, 0px);
}

.faux-split__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

/* Slides crossfade; only .is-active is in flow. */
.faux-split__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 0;
	transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.faux-split__slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
	transition: opacity 0.45s ease;
}

/* ── Column 1 — image background only ─────────────────────────────── */
.faux-split__panel--image {
	background-color: #23262d;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	-webkit-clip-path: polygon(
		0 0,
		calc(var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 0,
		calc(var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 100%,
		0 100%
	);
	clip-path: polygon(
		0 0,
		calc(var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 0,
		calc(var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 100%,
		0 100%
	);
}

/* ── Column 2 — colored panel: text + buttons + arrows ────────────── */
.faux-split__panel--content {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--fs-height, 520px);
	-webkit-clip-path: polygon(
		calc(var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 0,
		100% 0,
		100% 100%,
		calc(var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 100%
	);
	clip-path: polygon(
		calc(var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 0,
		100% 0,
		100% 100%,
		calc(var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 100%
	);
}

.faux-split__inner {
	box-sizing: border-box;
	width: calc(100% - var(--fs-split, 50%) - var(--fs-tilt, 69.7px) - 7%);
	margin-left: auto;
	margin-right: 7%;
	padding: var(--fs-pad, 20px); /* Column 2 padding — 20px by default */
}

/* ── Flipped: image right, text left ──────────────────────────────── */
.faux-split--flipped .faux-split__panel--image {
	-webkit-clip-path: polygon(
		calc(100% - var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 0,
		100% 0,
		100% 100%,
		calc(100% - var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 100%
	);
	clip-path: polygon(
		calc(100% - var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 0,
		100% 0,
		100% 100%,
		calc(100% - var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 100%
	);
}

.faux-split--flipped .faux-split__panel--content {
	-webkit-clip-path: polygon(
		0 0,
		calc(100% - var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 0,
		calc(100% - var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 100%,
		0 100%
	);
	clip-path: polygon(
		0 0,
		calc(100% - var(--fs-split, 50%) - var(--fs-tilt, 69.7px)) 0,
		calc(100% - var(--fs-split, 50%) + var(--fs-tilt, 69.7px)) 100%,
		0 100%
	);
}

.faux-split--flipped .faux-split__inner {
	margin-left: 7%;
	margin-right: auto;
}

/* ── Typography ───────────────────────────────────────────────────── */
.faux-split__heading {
	margin: 0 0 0.6em;
	font-size: clamp(1.6rem, 1rem + 1.6vw, 2.4rem);
	line-height: 1.15;
}

.faux-split__text {
	font-size: 1.05rem;
	line-height: 1.65;
	opacity: 0.95;
}

.faux-split__text.has-text-bg {
	padding: 0.75em 1em;
	border-radius: var(--fs-btn-radius, 6px);
}

.faux-split__text p {
	margin: 0 0 1em;
}

.faux-split__text p:last-child {
	margin-bottom: 0;
}

.faux-split__text a {
	color: inherit;
	text-decoration: underline;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.faux-split__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 1.4em;
}

.faux-split__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75em 1.6em;
	border-radius: var(--fs-btn-radius, 6px);
	border: 2px solid transparent;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.faux-split__btn:hover {
	transform: translateY(-1px);
}

.faux-split__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.faux-split__btn--solid {
	background: var(--fs-accent, #ff7a3d);
	border-color: var(--fs-accent, #ff7a3d);
	color: #fff;
}

.faux-split__btn--solid:hover {
	filter: brightness(0.92);
	color: #fff;
}

.faux-split__btn--outline {
	border-color: currentColor;
	color: inherit;
	background: transparent;
}

.faux-split__btn--outline:hover {
	background: rgba(255, 255, 255, 0.14);
}

/* ── Navigation arrows — under the buttons ────────────────────────── */
.faux-split__nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 1.3em;
}

.faux-split__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.faux-split__arrow:hover {
	background: rgba(255, 255, 255, 0.16);
}

.faux-split__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.faux-split__count {
	font-size: 0.95rem;
	opacity: 0.85;
	min-width: 3.5ch;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* ── Mobile: stack, image always on top, straight 90° divider ─────── */
@media (max-width: 782px) {
	.faux-split {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.faux-split__slide,
	.faux-split__slide.is-active {
		display: flex;
		flex-direction: column;
		position: relative;
	}

	.faux-split__slide:not(.is-active) {
		display: none;
	}

	.faux-split__panel {
		position: relative;
		width: 100%;
	}

	.faux-split__panel--image {
		order: 1; /* image column always on top */
		min-height: clamp(220px, 48vw, 380px);
		-webkit-clip-path: none;
		clip-path: none;
	}

	.faux-split__panel--content {
		order: 2;
		min-height: 0;
		-webkit-clip-path: none;
		clip-path: none;
	}

	.faux-split__inner,
	.faux-split--flipped .faux-split__inner {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		margin: 0;
		padding: var(--fs-pad, 20px);
	}

	.faux-split__heading,
	.faux-split__text {
		width: 100%;
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.faux-split__slide {
		transition: none;
	}
}
