/* ClickTraces – Expanding Panels (ct-expanding-panels)
 * Single-class rules are defaults that Elementor controls override.
 * ".ct-ep .x" rules are structural and protect against theme styles. */

.ct-ep {
	--ep-gap: 16px;
	--ep-collapsed-w: 78px;
	--ep-open-min: 640px;
	--ep-height: 440px;
	--ep-dur: 550ms;
	--ep-content-gap: 32px;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: var(--ep-gap);
	width: 100%;
	box-sizing: border-box;
}

.ct-ep * {
	box-sizing: border-box;
}

/* ---------- Panel ---------- */

.ct-ep .ct-ep__panel {
	position: relative;
	display: block;
	flex: 0 0 var(--ep-collapsed-w);
	min-width: 0;
	height: var(--ep-height);
	margin: 0;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	background-color: #141414;
	border-radius: 16px;
	outline: none;
	transition: flex-basis var(--ep-dur) cubic-bezier(0.22, 1, 0.36, 1),
		flex-grow var(--ep-dur) cubic-bezier(0.22, 1, 0.36, 1),
		background-color 0.4s ease;
}

.ct-ep .ct-ep__panel.is-active {
	flex-grow: 1;
	flex-basis: 0;
	cursor: default;
}

.ct-ep .ct-ep__panel:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 0 0 4px rgba(0, 0, 0, 0.35);
}

/* ---------- Collapsed bar (spine) ---------- */

.ct-ep .ct-ep__spine {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	padding: 22px 10px;
	opacity: 1;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.ct-ep .ct-ep__panel.is-active .ct-ep__spine {
	opacity: 0;
}

.ct-ep .ct-ep__spine-badge {
	flex: 0 0 auto;
	font-size: 14px;
	font-style: italic;
	color: #9aa0a6;
	white-space: nowrap;
}

.ct-ep .ct-ep__spine-title {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	margin: 12px 0 0;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	line-height: 1.1;
}

/* Collapsed title orientation */
.ct-ep--orient-up .ct-ep__spine-title {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	align-items: flex-start;
}

.ct-ep--orient-down .ct-ep__spine-title {
	writing-mode: vertical-rl;
}

.ct-ep--orient-horizontal .ct-ep__spine-title {
	writing-mode: horizontal-tb;
	align-items: flex-end;
}

/* ---------- Open content ---------- */

.ct-ep .ct-ep__content {
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: var(--ep-content-gap);
	width: 100%;
	min-width: var(--ep-open-min);
	height: 100%;
	padding: 32px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0s linear var(--ep-dur);
}

.ct-ep .ct-ep__panel.is-active .ct-ep__content {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.45s ease calc(var(--ep-dur) * 0.45), visibility 0s;
}

.ct-ep .ct-ep__text {
	flex: 1 1 auto;
	min-width: 0;
	align-self: center;
	overflow: auto;
	max-height: 100%;
}

.ct-ep .ct-ep__media {
	flex: 0 0 52%;
	max-width: 52%;
	align-self: stretch;
	min-width: 0;
}

.ct-ep .ct-ep__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

/* Image side */
.ct-ep--img-left .ct-ep__media {
	order: -1;
}

/* ---------- Text pieces ---------- */

.ct-ep .ct-ep__badge {
	display: block;
	margin: 0 0 10px;
	font-size: 14px;
	font-style: italic;
	color: #9aa0a6;
	line-height: 1;
}

.ct-ep .ct-ep__title {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

.ct-ep .ct-ep__desc {
	margin: 0 0 16px;
	color: #c9ccd1;
	font-size: 15px;
	line-height: 1.7;
}

.ct-ep .ct-ep__desc p {
	margin: 0 0 12px;
}

.ct-ep .ct-ep__desc p:last-child {
	margin-bottom: 0;
}

.ct-ep .ct-ep__desc a {
	color: #fff;
	text-decoration: underline;
}

/* ---------- Tags ---------- */

.ct-ep .ct-ep__tags-wrap {
	margin-top: 6px;
}

.ct-ep .ct-ep__tags-title {
	display: block;
	margin: 0 0 10px;
	font-weight: 600;
	color: #fff;
	font-size: 14px;
}

.ct-ep .ct-ep__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ct-ep .ct-ep__tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	font-size: 13px;
	color: #e7e9ec;
	background-color: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 6px;
	white-space: nowrap;
}

/* ---------- Button ---------- */

.ct-ep .ct-ep__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 18px;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	color: #141414;
	text-decoration: none;
	background-color: #fff;
	border: 1px solid transparent;
	border-radius: 8px;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ct-ep .ct-ep__btn:hover,
.ct-ep .ct-ep__btn:focus {
	background-color: #e7e9ec;
}

/* =====================================================================
 * Stacked (vertical accordion) mode – added by JS as .is-stacked
 * ================================================================== */

.ct-ep.is-stacked {
	flex-direction: column;
	height: auto;
	align-items: stretch;
}

.ct-ep.is-stacked .ct-ep__panel {
	flex: 1 1 auto !important;
	width: 100%;
	height: auto;
	min-height: 0;
	cursor: pointer;
}

.ct-ep.is-stacked .ct-ep__spine {
	position: relative;
	inset: auto;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
	padding: 16px 20px;
	opacity: 1 !important;
	pointer-events: none;
}

.ct-ep.is-stacked .ct-ep__spine-title {
	writing-mode: horizontal-tb;
	transform: none;
	margin: 0;
	align-items: center;
	justify-content: flex-start;
	flex: 1 1 auto;
}

.ct-ep.is-stacked .ct-ep__spine-badge {
	order: -1;
}

/* Collapsible body in stacked mode */
.ct-ep.is-stacked .ct-ep__content {
	position: relative;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	height: auto;
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	opacity: 1;
	visibility: visible;
	overflow: hidden;
	transition: max-height var(--ep-dur) ease, padding var(--ep-dur) ease;
}

.ct-ep.is-stacked .ct-ep__panel.is-active .ct-ep__content {
	max-height: 1600px;
}

.ct-ep.is-stacked .ct-ep__media {
	flex: 0 0 auto;
	max-width: 100%;
	width: 100%;
	order: 0;
	margin-top: 18px;
}

.ct-ep.is-stacked .ct-ep__img {
	height: auto;
}

/* The spine already shows badge + title, so hide the duplicates in the body. */
.ct-ep.is-stacked .ct-ep__content .ct-ep__badge,
.ct-ep.is-stacked .ct-ep__content .ct-ep__title {
	display: none;
}

/* Fallback stacked styling when JS has not run yet (no-js / very small screens) */
@media (max-width: 480px) {
	.ct-ep:not(.is-stacked) {
		flex-direction: column;
	}
	.ct-ep:not(.is-stacked) .ct-ep__panel {
		flex: 1 1 auto;
		height: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-ep .ct-ep__panel,
	.ct-ep .ct-ep__content,
	.ct-ep .ct-ep__spine {
		transition-duration: 0.01ms !important;
	}
}
