/* Apex Tab Carousel – front end. Colors come from CSS variables set per carousel. */
.atc {
	--atc-text: #111111;
	--atc-hl: #7B6FB0;
	--atc-active: #1E1B5C;
	--atc-dot: #1E1B5C;
	--atc-track: #EBEBEF;
	--atc-speed: 450ms;
	--atc-gap: 64px;
	--atc-text-width: 620px;

	/* Image and text hug their content and sit centered together as a pair. */
	display: flex;
	justify-content: center;
	align-items: center;
	column-gap: var(--atc-gap);
	row-gap: 32px;
	width: 100%;
	box-sizing: border-box;
}
.atc *, .atc *::before, .atc *::after { box-sizing: border-box; }

.atc--img-right { flex-direction: row-reverse; }

/* ---------- Image column (images stacked, crossfade) ---------- */
.atc__media {
	display: grid;
	justify-items: center;
	align-items: center;
	width: fit-content;
}
.atc__content { max-width: var(--atc-text-width); }
.atc__image {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity var(--atc-speed) ease, transform var(--atc-speed) ease, visibility var(--atc-speed);
}
.atc__image.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.atc .atc__image img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 640px;
	margin: 0;
	object-fit: contain;
}

/* ---------- Text column ---------- */
.atc__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(16px, 2vw, 24px);
}
/* Panels stack in one cell so the height never jumps between tabs. */
.atc__panels { display: grid; width: 100%; }
.atc__panel,
.atc__panel[hidden] {
	grid-area: 1 / 1;
	display: block;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity var(--atc-speed) ease, transform var(--atc-speed) ease, visibility var(--atc-speed);
}
.atc__panel.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.atc .atc__text {
	margin: 0;
	padding: 0;
	color: var(--atc-text);
	font-size: clamp(24px, 2.8vw, 40px);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: none;
}
.atc .atc__hl { color: var(--atc-hl); }

/* ---------- Tab switcher ---------- */
.atc__tabs {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border-radius: 999px;
	background: var(--atc-track);
}
.atc .atc__tab {
	/* Reset theme / builder button styles. */
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
	background: transparent;
	font: inherit;
	line-height: 0;
	text-transform: none;
	min-width: 0;
	min-height: 0;

	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 24px;
	border-radius: 999px;
	cursor: pointer;
	transition: width var(--atc-speed) ease, background-color var(--atc-speed) ease;
}
.atc .atc__tab:hover { background: rgba(0, 0, 0, 0.06); }
.atc .atc__tab:focus { outline: none; }
.atc .atc__tab:focus-visible { outline: 2px solid var(--atc-active); outline-offset: 2px; }
.atc .atc__tab.is-active {
	width: 44px;
	background: var(--atc-active);
	cursor: default;
}

.atc__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--atc-dot);
	transition: opacity calc(var(--atc-speed) / 2) ease, transform var(--atc-speed) ease;
}
.atc__tab.is-active .atc__dot { opacity: 0; transform: scale(0); }

.atc__icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity var(--atc-speed) ease, transform var(--atc-speed) ease;
}
.atc__tab.is-active .atc__icon { opacity: 1; transform: none; }
.atc .atc__icon img {
	display: block;
	width: 14px;
	height: 14px;
	max-width: none;
	margin: 0;
	object-fit: contain;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.atc, .atc--img-right { flex-direction: column; }
	.atc__media { max-width: 100%; }
	.atc__content { align-items: center; text-align: center; }
	.atc .atc__image img { max-height: 460px; }
}

@media (prefers-reduced-motion: reduce) {
	.atc { --atc-speed: 0ms; }
}
