/* ============================================================
   PD Feature Split — container geometry + tile base styling.

   Tiles here are <div>s, not <li>, so the base tile visuals
   (background sizing, border, gradient ::after, vignette ::before)
   are NOT inherited from .pdep-accordion-list li in
   pdep-accordion-shared.css. This mirrors that file's own proven
   solution to the same problem — .pdep-mosaic__tile — renamed for
   this widget's 50/50 split geometry instead of a diagonal mosaic.
   ============================================================ */

.pdep-accordion-area.pdep-feature-split-area,
.pdep-accordion-area.pdep-feature-split-area div {
	height: auto;
	min-height: 0;
}

.pdep-feature-split {
	display: flex;
	gap: var(--pdep-fs-gap, 16px);
	width: 100%;
}

.pdep-accordion-area.pdep-feature-split-area .pdep-feature-split {
	height: var(--pdep-fs-height, 500px);
}

/* Big-image side toggle, set via prefix_class on the widget wrapper */
.pdep-fs-side-right .pdep-feature-split {
	flex-direction: row-reverse;
}

.pdep-feature-split__big {
	flex: 0 0 50%;
	max-width: 50%;
	min-width: 0;
}

.pdep-feature-split__col {
	flex: 0 0 50%;
	max-width: 50%;
	display: flex;
	flex-direction: column;
	gap: var(--pdep-fs-gap, 16px);
	min-width: 0;
}

/* Derived-height split — top/bottom flex-grow ratio always sums to a full
   column, same technique as .pdep-mosaic__tile--tall/--short. Bottom is
   calc()'d from the single ratio var so a responsive control only ever
   has to write one value per breakpoint. */
.pdep-feature-split__top    { flex: var(--pdep-fs-top-ratio, 50) 1 0; }
.pdep-feature-split__bottom { flex: calc(100 - var(--pdep-fs-top-ratio, 50)) 1 0; }

.pdep-feature-split__tile {
	position: relative;
	overflow: hidden;
	min-height: 0; /* required for the flex-grow ratio split to work */
	display: flex;
	flex-direction: column;
	justify-content: var(--pdep-content-justify, flex-end);
	align-items: var(--pdep-content-align, flex-start);
	padding: 1.6em;
	border: var(--pdep-border-width) solid var(--pdep-dark);
	border-radius: var(--pdep-border-radius);
	background-size: cover;
	background-position: var(--pdep-focal-d, center center);
	background-repeat: no-repeat;
}

/* Gradient overlay (::before) — CSS fallback only; Elementor's Group_Control_Background
   overrides this with higher specificity, defaulting to the same transparent-to-black
   falloff this used to render via a hardcoded ::after layer. Tiles are always in the
   expanded visual state (no hover toggle), so there is only ever one state to style. */
.pdep-feature-split__tile::before {
	position: absolute;
	left: 0;
	bottom: 0;
	content: "";
	height: 100%;
	width: 100%;
	background: none;
	z-index: -1;
	visibility: visible;
	opacity: 1;
}

/* Vertical label — hidden (tiles always in expanded state), matching
   .pdep-mosaic__tile h3's established convention */
.pdep-feature-split__tile h3 {
	position: absolute;
	left: 50%;
	margin: 0 !important;
	padding: 0;
	transform: translateX(-50%) rotate(90deg);
	top: 50px;
	opacity: 0;
	pointer-events: none;
	font-weight: 700;
	font-size: 22px;
	color: var(--pdep-vertical-label-color);
}

/* Ghost number — hidden (tiles always expanded) */
.pdep-feature-split__tile > span {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	font-weight: 900;
	font-size: 80px;
	bottom: -200px;
	-webkit-text-stroke: 1px var(--pdep-white);
	color: transparent;
	opacity: 0;
	pointer-events: none;
}

/* Responsive — stack to a single column at tablet width */
@media (max-width: 991px) {
	.pdep-feature-split,
	.pdep-fs-side-right .pdep-feature-split {
		flex-direction: column;
		height: auto;
	}

	.pdep-feature-split__big,
	.pdep-feature-split__col {
		flex: none;
		max-width: 100%;
		width: 100%;
	}

	.pdep-feature-split__big,
	.pdep-feature-split__top,
	.pdep-feature-split__bottom {
		min-height: 260px;
	}
}


/* =============================================================
   Per-item focal point
   -------------------------------------------------------------
   Tiles crop their image to the tile box, so a subject that is not
   centred gets cut. render() emits --pdep-focal-d/t/m inline on the
   element from the per-item Image Focal Point control; these rules
   feed them to background-position.

   The nested var() fallbacks ARE the responsive cascade: mobile falls
   back to tablet, tablet falls back to desktop, desktop falls back to
   center center. That is why the control can live inside a repeater,
   where Elementor refuses add_responsive_control() and would otherwise
   give no way to vary framing per breakpoint. Unset breakpoints emit
   no custom property at all, so they inherit rather than override.

   Breakpoints match Elementor tiers: tablet <=1024, mobile <=767.
   ============================================================= */

@media (max-width: 1024px) {
	.pdep-feature-split__tile {
		background-position: var(--pdep-focal-t, var(--pdep-focal-d, center center));
	}
}

@media (max-width: 767px) {
	.pdep-feature-split__tile {
		background-position: var(--pdep-focal-m, var(--pdep-focal-t, var(--pdep-focal-d, center center)));
	}
}
