/**
 * Cases Block Styles
 */

.ct-cases {
	padding: 80px 0 0;
	background: var(--color-white);
}

.ct-cases--no-header {
	padding: 40px 0 23px;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.ct-cases__header {
	display: flex;
	align-items: flex-end;
	margin-bottom: 32px;
}

.ct-cases__header-left {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.ct-cases__header-left .ct-ui-pill {
	margin-bottom: 16px;
	align-self: flex-start;
}

.ct-cases__title {
	max-width: 700px;
	margin: 0;
}

.ct-cases__title span {
	color: var(--color-purple-deep);
}

.ct-cases__right-text {
	flex-shrink: 0;
	max-width: 366px;
	padding-left: 12px;
	border-left: 1px solid var(--color-light-200);
	margin: 0;
	font-weight: 500;
	font-size: 16px;
	line-height: 140%;
	color: var(--color-bg-deepest);
}

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */

.ct-cases__tabs-row {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 40px;
}

.ct-cases__tabs-nav {
	display: inline-flex;
	align-items: center;
	position: relative;
	gap: 0;
	background: var(--color-light-100);
	border-radius: 40px;
	padding: 6px;
}

/* ─── Slider nav ──────────────────────────────────────────────────────────── */

.ct-cases__slider-nav-wrap {
	margin-left: auto;
	flex-shrink: 0;
}

.ct-cases__slider-meta {
	display: none;
	align-items: center;
	gap: 12px;
}

.ct-cases__slider-meta.is-active {
	display: flex;
}

.ct-cases__slider-counter {
	font-weight: 700;
	font-size: 14px;
	line-height: 100%;
	color: var(--color-neutral-400);
	white-space: nowrap;
}

.ct-cases__slider-nav {
	position: relative;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #F3F2F5;
	cursor: pointer;
}

.ct-cases__slider-nav::before {
	content: '';
	position: absolute;
	inset: 0;
	margin: auto;
	width: 16px;
	height: 16px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.ct-cases__slider-nav--prev::before {
	background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.3337 3.3335L8.3741 7.29306C7.98357 7.68358 7.98357 8.31674 8.3741 8.70727L12.3337 12.6668' stroke='%233F3880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.99967 3.3335L3.04011 7.29306C2.64959 7.68358 2.64959 8.31674 3.04011 8.70727L6.99967 12.6668' stroke='%233F3880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ct-cases__slider-nav--next::before {
	background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.66634 3.3335L7.6259 7.29306C8.01643 7.68358 8.01643 8.31674 7.6259 8.70727L3.66634 12.6668' stroke='%233F3880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.00033 3.3335L12.9599 7.29306C13.3504 7.68358 13.3504 8.31674 12.9599 8.70727L9.00033 12.6668' stroke='%233F3880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ct-cases__tab-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 20px;
	border: none;
	border-radius: 40px;
	background: transparent;
	font-weight: 500;
	font-size: 16px;
	line-height: 140%;
	color: var(--color-bg-deepest);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.ct-cases__tab-btn.is-active {
	background: var(--color-purple-deep);
	color: var(--color-white);
}

.ct-cases__tab-btn:not(.is-active):hover {
	background: #E0DFE8;
}

.ct-cases__tab-chevron {
	display: none;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

/* dropdown wrapper transparent to flex on desktop */
.ct-cases__tabs-dropdown {
	display: contents;
}

/* ─── Mobile tabs (≤ 960px) ───────────────────────────────────────────────── */

@media (max-width: 960px) {
	.ct-cases__tabs-nav {
		display: block;
		width: 100%;
		position: relative;
		background: transparent;
		border-radius: 20px;
		padding: 0;
		margin-bottom: 16px;
	}

	.ct-cases__tab-btn {
		display: none;
		width: 100%;
		font-size: 14px;
		padding: 10px 20px;
	}

	.ct-cases__tab-btn.is-active {
		display: inline-flex;
	}

	.ct-cases__tabs-nav.is-open {
		background: var(--color-white);
	}

	.ct-cases__tabs-dropdown {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--color-white);
		border-radius: 0 0 20px 20px;
		overflow: hidden;
		max-height: 0;
		transition: max-height 0.35s ease;
		z-index: 20;
	}

	.ct-cases__tabs-nav.is-open .ct-cases__tabs-dropdown {
		max-height: 600px;
		box-shadow: 0px 6px 12px 0px #17112429;
	}

	.ct-cases__tabs-dropdown .ct-cases__tab-btn {
		display: flex;
		color: var(--color-bg-deepest);
		background: transparent;
	}

	.ct-cases__tab-chevron {
		display: inline-block;
	}

	.ct-cases__tabs-dropdown .ct-cases__tab-chevron {
		display: none;
	}

	.ct-cases__tabs-nav.is-open > .ct-cases__tab-btn.is-active .ct-cases__tab-chevron {
		transform: rotate(180deg);
	}
}

/* ─── Grid ────────────────────────────────────────────────────────────────── */

.ct-cases__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.ct-cases__slider-wrap--mobile {
	display: none;
}

/* ─── Mobile (≤ 768px) ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.ct-cases {
		padding: 40px 0 0;
	}

	.ct-cases--no-header {
		padding: 40px 0;
	}

	.ct-cases__header {
		flex-direction: column;
		align-items: flex-start;
		margin-bottom: 24px;
	}

	.ct-cases__right-text {
		padding-left: 0;
		border-left: none;
		font-size: 14px;
		margin-top: 16px;
	}

	.ct-cases__tabs-row {
		margin-bottom: 16px;
	}

	.ct-cases__slider-meta.is-active {
		display: none;
	}

	.ct-cases__grid--desktop {
		display: none;
	}

	.ct-cases__slider-wrap--mobile {
		display: block;
		margin-right: calc(var(--container-px-mobile) * -1);
		margin-left: calc(var(--container-px-mobile) * -1);
		padding-right: var(--container-px-mobile);
		padding-left: var(--container-px-mobile);
	}
}

/* ─── Slider ──────────────────────────────────────────────────────────────── */

.ct-cases__slider .swiper-slide {
	height: auto;
}

.ct-cases__slider .ct-case-card {
	height: 100%;
}

/* ─── Case Card ───────────────────────────────────────────────────────────── */

.ct-case-card {
	background: var(--color-light-100);
	border-radius: 20px;
	display: flex;
	flex-direction: column;
}

.ct-case-card__comparison {
	position: relative;
	height: 400px;
	border-radius: 20px;
	overflow: hidden;
	cursor: col-resize;
	user-select: none;
	flex: 0 0 auto;
}

.ct-case-card__after-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ct-case-card__before {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 50%;
	overflow: hidden;
	z-index: 1;
}

.ct-case-card__overlay {
	position: absolute;
	inset: 0;
	background: #24232E66;
	backdrop-filter: blur(40px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ct-case-card__overlay-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 279px;
}

.ct-case-card__overlay-icon {
	display: block;
	width: 32px;
	height: 30px;
	flex-shrink: 0;
	margin-bottom: 11px;
}

.ct-case-card__overlay-title {
	margin: 0 0 8px;
	font-weight: 700;
	font-size: 18px;
	line-height: 100%;
	text-align: center;
	text-transform: uppercase;
	color: var(--color-white);
}

.ct-case-card__overlay-text {
	margin: 0 0 16px;
	font-weight: 400;
	font-size: 14px;
	line-height: 140%;
	text-align: center;
	color: var(--color-white);
}

.ct-case-card__overlay-btn {
	display: inline-block;
	padding: 12px 24px;
	border: 1.4px solid var(--color-white);
	border-radius: 10px;
	background: transparent;
	font-weight: 500;
	font-size: 14px;
	line-height: 126%;
	color: var(--color-white);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.ct-case-card__overlay-btn:hover {
	background: var(--color-white);
	color: #352F70;
}

.ct-case-card__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--color-white);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
	cursor: col-resize;
	touch-action: none;
	flex-shrink: 0;
}

.ct-case-card__handle::before {
	content: '';
	position: absolute;
	left: 50%;
	top: -2000px;
	height: 4000px;
	width: 2px;
	background: rgba(255, 255, 255, 0.7);
	transform: translateX(-50%);
	z-index: -1;
}

.ct-case-card__arrow--left {
	transform: rotate(180deg);
}

.ct-case-card__label {
	position: absolute;
	top: 10px;
	z-index: 3;
	padding: 4px 12px;
	border-radius: 20px;
	background: var(--color-white);
	font-weight: 500;
	font-size: 14px;
	line-height: 140%;
	color: #464362;
}

.ct-case-card__label--before {
	left: 10px;
}

.ct-case-card__label--after {
	right: 10px;
}

.ct-case-card__body {
	display: flex;
	flex-direction: column;
	padding: 28px;
	flex: 1 1 auto;
}

.ct-case-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
}

.ct-case-card__date {
	font-weight: 400;
	font-size: 14px;
	line-height: 120%;
	color: var(--color-neutral-500);
}

.ct-case-card__title {
	line-height: 100%;
	margin-bottom: 10px;
}

.ct-case-card__excerpt {
	font-weight: 400;
	font-size: 16px;
	line-height: 130%;
	color: var(--color-bg-deepest);
	margin: 0 0 20px;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ct-case-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.ct-case-card__tag {
	font-weight: 500;
	font-size: 16px;
	line-height: 140%;
	color: #464362;
	padding: 8px 18px;
	background: var(--color-white);
	border-radius: 30px;
}

/* ─── Case Card Mobile ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.ct-case-card {
		border-radius: 12px;
	}

	.ct-case-card__comparison {
		height: 220px;
		border-radius: 12px;
	}

	.ct-case-card__handle {
		width: 28px;
		height: 28px;
	}

	.ct-case-card__label {
		display: none;
	}

	.ct-case-card__overlay-icon {
		width: 28px;
		height: 26.25px;
		margin-bottom: 8px;
	}

	.ct-case-card__overlay-title {
		font-size: 14px;
		margin-bottom: 6px;
	}

	.ct-case-card__overlay-text {
		font-size: 10px;
		margin-bottom: 12px;
	}

	.ct-case-card__overlay-btn {
		padding: 10px 18px;
		border-radius: 8px;
		font-size: 12px;
	}

	.ct-case-card__body {
		padding: 16px;
	}

	.ct-case-card__title {
		margin-bottom: 8px;
	}

	.ct-case-card__excerpt {
		font-size: 14px;
		margin-bottom: 16px;
		-webkit-line-clamp: 3;
		line-clamp: 3;
	}

	.ct-case-card__tag {
		font-size: 14px;
		padding: 6px 12px;
	}

	.ct-case-card__date {
		font-size: 12px;
	}
}
