/* ===== Expanding Cards for Elementor – by Babar ===== */
.ecx-wrap {
	--ecx-ratio: 2.5;          /* open card = ratio x closed card (Auto width mode) */
	--ecx-closed-w: 110px;     /* Fixed width mode */
	--ecx-active-w: 380px;     /* Fixed width mode */
	--ecx-h: 380px;            /* closed card height */
	--ecx-active-h: 420px;     /* open card height */
	--ecx-dur: 600ms;
	--ecx-ease: cubic-bezier(.22, 1, .36, 1);
	--ecx-col-h: 150px;
	--ecx-inner-w: 100%;
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: max(var(--ecx-h), var(--ecx-active-h));
	box-sizing: border-box;
}

.ecx-wrap *,
.ecx-wrap *::before,
.ecx-wrap *::after { box-sizing: border-box; }

/* ---- Card ---- */
.ecx-card {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	height: var(--ecx-h);
	display: flex;
	flex-direction: row;
	justify-content: flex-start;   /* which side of a closed card stays visible */
	align-items: flex-start;
	overflow: hidden;
	cursor: pointer;
	background: #3b1f0e;
	color: #f3e9dc;
	border: 0 solid transparent;
	outline: none;
	transition:
		flex-grow var(--ecx-dur) var(--ecx-ease),
		flex-basis var(--ecx-dur) var(--ecx-ease),
		height var(--ecx-dur) var(--ecx-ease),
		background-color .3s ease,
		border-color .3s ease,
		box-shadow .3s ease,
		opacity .3s ease;
}

.ecx-card.is-active {
	flex-grow: var(--ecx-ratio);
	height: var(--ecx-active-h);
}

/* Fixed width mode: exact widths for closed and open cards. */
.ecx-wrap.is-fixed .ecx-card { flex: 0 1 var(--ecx-closed-w); }
.ecx-wrap.is-fixed .ecx-card.is-active { flex-basis: var(--ecx-active-w); }

/* Closed-card content direction. */
.ecx-card.ecx-anchor-left   { justify-content: flex-start; }
.ecx-card.ecx-anchor-right  { justify-content: flex-end; }
.ecx-card.ecx-anchor-center { justify-content: center; }

.ecx-card:focus-visible { box-shadow: 0 0 0 2px #e0a63a; }

/* Inner has a fixed width = open width, so content never re-wraps while animating. */
.ecx-inner {
	flex: 0 0 auto;
	width: var(--ecx-inner-w);
	padding: 24px;
	transition: opacity .16s ease;
}

.ecx-card.is-swapping .ecx-inner { opacity: 0; }

/* ---- Header (image + meta) ---- */
.ecx-header {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
	margin-bottom: 20px;
}

.ecx-image {
	flex: 0 0 auto;
	width: 90px;
	height: 90px;
	overflow: hidden;
	border-radius: 50%;
}

.ecx-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	max-width: none;
}

.ecx-meta { min-width: 0; }

.ecx-name {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.ecx-designation {
	margin: 2px 0 0;
	font-size: 14px;
	line-height: 1.3;
	color: rgba(243, 233, 220, .7);
}

/* ---- Rating ---- */
.ecx-rating {
	--ecx-star: #e0a63a;
	--ecx-star-empty: rgba(255, 255, 255, .28);
	display: inline-flex;
	gap: 3px;
	line-height: 1;
	margin-bottom: 8px;
}

.ecx-star {
	font-size: 16px;
	line-height: 1;
	color: var(--ecx-star-empty);
}

.ecx-star.is-full { color: var(--ecx-star); }

.ecx-star.is-half {
	background: linear-gradient(90deg, var(--ecx-star) 50%, var(--ecx-star-empty) 50%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ---- Text ---- */
.ecx-text {
	font-size: 15px;
	line-height: 1.7;
	color: rgba(243, 233, 220, .9);
}

.ecx-text p { margin: 0 0 1em; }
.ecx-text p:last-child { margin-bottom: 0; }

/* ===== Vertical (stacked / accordion) mode – toggled by JS when flex-direction is column ===== */
.ecx-wrap.is-vertical {
	min-height: 0;
	align-items: stretch;
}

.ecx-wrap.is-vertical .ecx-card,
.ecx-wrap.is-vertical.is-fixed .ecx-card {
	flex: none;
	width: auto;
	height: var(--ecx-col-h);
	justify-content: flex-start;
}

.ecx-wrap.is-vertical .ecx-card.is-active { flex-grow: 0; }

.ecx-wrap.is-vertical .ecx-inner { width: 100%; flex-shrink: 1; }

@media (prefers-reduced-motion: reduce) {
	.ecx-card, .ecx-inner { transition: none; }
}
