/**
 * TO Case Study Showcase — tabbed case-study cards with stats + media.
 *
 * Scoped under .toaew-cstudy / --toaew-cstudy-*.
 */

.toaew-cstudy {
	--toaew-cstudy-accent: #ce1696;
	--toaew-cstudy-media-bg: #f2cbe6;
	--toaew-cstudy-content-bg: #0a0a0a;
	--toaew-cstudy-card-border: #ffffff;
	--toaew-cstudy-heading-color: #ffffff;
	--toaew-cstudy-desc-color: rgba(255, 255, 255, 0.55);
	--toaew-cstudy-stat-label-color: rgba(255, 255, 255, 0.55);
	padding: var(--toaew-cstudy-pad-y, 2rem) var(--toaew-cstudy-pad-x, 2rem);
	background: var(--toaew-cstudy-wrap-bg, #000000);
}

.toaew-cstudy__heading {
	margin: 0 0 var(--toaew-cstudy-heading-gap, 2.5rem);
	color: var(--toaew-cstudy-heading-color);
	font-size: var(--toaew-cstudy-heading-size, 2.5rem);
	font-weight: var(--toaew-cstudy-heading-weight, 600);
	line-height: 1.05;
	letter-spacing: -0.02em;
	text-align: center;
}

.toaew-cstudy__stage {
	position: relative;
	min-height: var(--toaew-cstudy-stage-min-h, 28rem);
}

.toaew-cstudy__panel {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.45s ease, visibility 0.45s ease;
}

.toaew-cstudy__panel.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.toaew-cstudy__card {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: 0;
	overflow: hidden;
	border: var(--toaew-cstudy-card-border-w, 2px) solid var(--toaew-cstudy-card-border);
	border-radius: var(--toaew-cstudy-card-radius, 2rem);
	background: var(--toaew-cstudy-card-border);
}

.toaew-cstudy__body {
	display: flex;
	flex-direction: column;
	gap: var(--toaew-cstudy-body-gap, 1.75rem);
	padding: var(--toaew-cstudy-body-pad, 2.5rem);
	background: var(--toaew-cstudy-content-bg, #0a0a0a);
}

.toaew-cstudy__logo {
	max-width: var(--toaew-cstudy-logo-max-w, 10rem);
}

.toaew-cstudy__logo img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.toaew-cstudy__logo--text .toaew-cstudy__logo-text {
	color: #ffffff;
	font-size: 2rem;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.toaew-cstudy__desc {
	margin: 0;
	color: var(--toaew-cstudy-desc-color);
	font-size: var(--toaew-cstudy-desc-size, 1.25rem);
	line-height: 1.2;
}

.toaew-cstudy__stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--toaew-cstudy-stats-gap, 2rem);
	margin-top: auto;
}

.toaew-cstudy__stat {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 7rem;
}

.toaew-cstudy__stat-value {
	color: var(--toaew-cstudy-accent);
	font-size: var(--toaew-cstudy-stat-value-size, 3rem);
	font-weight: 500;
	line-height: 0.9;
	letter-spacing: -0.04em;
}

.toaew-cstudy__stat-label {
	color: var(--toaew-cstudy-stat-label-color);
	font-size: var(--toaew-cstudy-stat-label-size, 1.25rem);
	font-weight: 500;
	line-height: 1.2;
}

.toaew-cstudy__cta-wrap {
	margin-top: 0.25rem;
}

.toaew-cstudy__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 5.5rem;
	padding: 0.55rem 1.35rem;
	border: 1.5px solid color-mix(in srgb, var(--toaew-cstudy-accent) 52%, transparent);
	border-radius: 2.5rem;
	background: var(--toaew-cstudy-accent) !important;
	box-shadow: inset 0 0 5px 2px rgba(255, 255, 255, 0.5);
	color: #ffffff !important;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none !important;
	transition: filter 0.2s ease, transform 0.2s ease;
}

.toaew-cstudy__cta:hover,
.toaew-cstudy__cta:focus-visible {
	filter: brightness(1.08);
	transform: translateY(-1px);
	color: #ffffff !important;
}

.toaew-cstudy__media {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--toaew-cstudy-media-min-h, 100%);
	padding: var(--toaew-cstudy-media-pad, 1.5rem);
	border-radius: 0 var(--toaew-cstudy-card-radius, 2rem) var(--toaew-cstudy-card-radius, 2rem) 0;
	background: var(--toaew-cstudy-media-bg);
}

.toaew-cstudy__media img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: var(--toaew-cstudy-media-max-h, 26rem);
	object-fit: contain;
}

.toaew-cstudy__loader-wrap {
	display: flex;
	justify-content: center;
	margin-top: var(--toaew-cstudy-tabs-mt, 1.75rem);
}

.toaew-cstudy__loader {
	display: inline-flex;
	padding: 0.35rem 0.55rem;
	border-radius: 999px;
	background: var(--toaew-cstudy-tabs-bg, rgba(0, 0, 0, 0.25));
	backdrop-filter: blur(7px);
	-webkit-backdrop-filter: blur(7px);
	--toaew-cstudy-loader-bar-w: 6.5rem;
	--toaew-cstudy-loader-hover-dot-w: 5.5rem;
	--toaew-cstudy-loader-hover-bar-w: 8rem;
}

.toaew-cstudy__loader-items {
	display: flex;
	align-items: center;
	gap: var(--toaew-cstudy-loader-gap, 0.35rem);
}

.toaew-cstudy__loader-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	cursor: pointer;
}

.toaew-cstudy__loader-item:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 3px;
	border-radius: 999px;
}

/* Default: thin dot, no visible label. */
.toaew-cstudy__item-shell {
	position: relative;
	display: block;
	width: 0.35rem;
	height: 0.35rem;
	min-width: 0;
	padding: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.35);
	overflow: hidden;
	transition:
		width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		background-color 0.3s ease;
}

/* Active slide: dot becomes a thin loading bar. */
.toaew-cstudy__loader-item.is-loading .toaew-cstudy__item-shell {
	width: var(--toaew-cstudy-loader-bar-w, 6.5rem);
	height: 0.35rem;
	background: rgba(255, 255, 255, 0.18);
}

.toaew-cstudy__item-fill {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 100%;
	border-radius: inherit;
	background: #ffffff !important;
	pointer-events: none;
	transform: scaleX(0);
	transform-origin: left center;
	visibility: hidden;
}

.toaew-cstudy__loader-item.is-loading .toaew-cstudy__item-fill {
	visibility: visible;
}

.toaew-cstudy__loader[data-autoplay-ms="0"] .toaew-cstudy__item-fill {
	animation: none !important;
	visibility: hidden;
	transform: scaleX(0);
}

/* Labels hidden until the loader is hovered. */
.toaew-cstudy__item-label {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0 0.5rem;
	opacity: 0;
	visibility: hidden;
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.8125rem;
	font-weight: 550;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease, color 0.25s ease;
}

/* Hover: thicken dots / loader and reveal centered slide names. */
.toaew-cstudy__loader:hover .toaew-cstudy__item-shell,
.toaew-cstudy__loader:focus-within .toaew-cstudy__item-shell {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: var(--toaew-cstudy-loader-hover-dot-w, 5.5rem);
	height: 1.75rem;
	padding: 0 1rem;
	background: rgba(255, 255, 255, 0.12);
}

.toaew-cstudy__loader:hover .toaew-cstudy__loader-item.is-loading .toaew-cstudy__item-shell,
.toaew-cstudy__loader:focus-within .toaew-cstudy__loader-item.is-loading .toaew-cstudy__item-shell {
	min-width: var(--toaew-cstudy-loader-hover-bar-w, 8rem);
	background: rgba(255, 255, 255, 0.18);
}

.toaew-cstudy__loader:hover .toaew-cstudy__item-label,
.toaew-cstudy__loader:focus-within .toaew-cstudy__item-label {
	position: relative;
	inset: auto;
	flex: 0 0 auto;
	width: auto;
	opacity: 1;
	visibility: visible;
}

.toaew-cstudy__loader-item.is-loading.is-active .toaew-cstudy__item-label {
	color: #111111;
}

@keyframes toaew-cstudy-load {
	from {
		transform: scaleX(0);
	}
	to {
		transform: scaleX(1);
	}
}

@media (max-width: 1024px) {
	.toaew-cstudy__card {
		grid-template-columns: 1fr;
	}

	.toaew-cstudy__media {
		border-radius: 0 0 var(--toaew-cstudy-card-radius, 2rem) var(--toaew-cstudy-card-radius, 2rem);
		min-height: var(--toaew-cstudy-media-min-h, 18rem);
	}

	.toaew-cstudy__heading {
		font-size: clamp(1.75rem, 5vw, var(--toaew-cstudy-heading-size, 2.25rem));
	}
}

@media (max-width: 767px) {
	.toaew-cstudy__stat-value {
		font-size: clamp(1.75rem, 8vw, var(--toaew-cstudy-stat-value-size, 2.25rem));
	}

	.toaew-cstudy__desc {
		font-size: clamp(1rem, 3.5vw, var(--toaew-cstudy-desc-size, 1.0625rem));
	}

	.toaew-cstudy__loader {
		max-width: 100%;
	}

	.toaew-cstudy__loader-items {
		flex-wrap: wrap;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.toaew-cstudy__panel,
	.toaew-cstudy__item-fill,
	.toaew-cstudy__item-shell,
	.toaew-cstudy__cta {
		transition: none !important;
		animation: none !important;
	}
}
