/**
 * YHT Case Studies
 *
 * Visual reference: approved Figma Make desktop and mobile exports.
 */

.yht-case-studies {
	--yht-case-blue: #0a4174;
	--yht-case-gold: #c9a843;
	--yht-case-copy: #4a5565;
	--yht-case-muted: #99a1af;
	--yht-case-border: #d1d5dc;
	--yht-case-surface: #f5f7fa;
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
	font-family: "Inter", Arial, sans-serif;
}

.yht-case-card {
	display: grid;
	grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
	overflow: hidden;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 4px 32px rgba(10, 65, 116, 0.09);
}

.yht-case-card__media {
	position: relative;
	align-self: stretch;
	min-height: 300px;
	overflow: hidden;
	background: var(--yht-case-blue);
}

.yht-case-card__media .yht-case-card__image {
	position: absolute !important;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover !important;
}

.yht-case-card__badge {
	position: absolute;
	top: 20px;
	left: 20px;
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--yht-case-gold);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 15px;
	text-transform: uppercase;
}

.yht-case-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 20px;
}

.yht-case-card__header {
	display: flex;
	flex-direction: column;
	margin-bottom: 24px;
}

.yht-case-studies p.yht-case-card__number,
.yht-case-studies h2.yht-case-card__title,
.yht-case-studies p.yht-case-card__panel-heading,
.yht-case-studies .yht-case-card__panel-content p {
	margin: 0;
}

.yht-case-studies p.yht-case-card__number {
	margin-bottom: 12px;
	color: rgba(201, 168, 67, 0.3);
	font-family: "Playfair Display", Georgia, serif;
	font-size: 40px;
	font-weight: 700;
	line-height: 40px;
}

.yht-case-card__title {
	color: var(--yht-case-blue);
	font-family: "Playfair Display", Georgia, serif;
	font-size: 20px;
	font-weight: 700;
	line-height: 20px;
}

.yht-case-card__overview,
.yht-case-card__details-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
	gap: 24px;
	align-items: stretch;
}

.yht-case-card__panel {
	min-width: 0;
	min-height: 132px;
	padding: 20px 20px 20px 24px;
	border-left: 4px solid var(--yht-case-border);
	border-radius: 10px;
	background: var(--yht-case-surface);
}

.yht-case-card__panel--before {
	border-left-color: var(--yht-case-blue);
}

.yht-case-card__panel--result {
	border-left-color: var(--yht-case-gold);
	background: rgba(10, 65, 116, 0.04);
}

.yht-case-card__panel-heading {
	margin-bottom: 8px;
	color: var(--yht-case-muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.18em;
	line-height: 15px;
	text-transform: uppercase;
}

.yht-case-card__panel--before .yht-case-card__panel-heading {
	color: var(--yht-case-blue);
}

.yht-case-card__panel--result .yht-case-card__panel-heading {
	color: var(--yht-case-gold);
}

.yht-case-card__panel-content {
	color: var(--yht-case-copy);
	font-size: 14.4px;
	font-weight: 400;
	line-height: normal;
	padding-top: 10px;
}

.yht-case-card__panel-content > :first-child {
	margin-top: 0;
}

.yht-case-card__panel-content > :last-child {
	margin-bottom: 0;
}

.yht-case-card__panel--result .yht-case-card__panel-content {
	color: var(--yht-case-copy);
	font-weight: 500;
}

.yht-case-card__connector {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	color: var(--yht-case-gold);
}

.yht-case-card__connector svg {
	display: block;
	width: 20px;
	height: 20px;
}

.yht-case-card button.yht-case-card__toggle {
	align-self: flex-end;
	justify-self: end;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 40px;
	margin: 16px -12px -16px 0;
	padding: 0;
	border: 0 !important;
	border-radius: 8px;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--yht-case-border) !important;
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.yht-case-card button.yht-case-card__toggle:hover {
	color: var(--yht-case-blue);
	background: rgba(10, 65, 116, 0.04);
}

.yht-case-card button.yht-case-card__toggle[aria-expanded="true"],
.yht-case-card button.yht-case-card__toggle[aria-expanded="true"]:hover {
	background: transparent !important;
	color: var(--yht-case-border) !important;
}

.yht-case-card__toggle:focus-visible {
	outline: 2px solid var(--yht-case-gold);
	outline-offset: 3px;
}

.yht-case-card__toggle-icon {
	position: relative;
	width: 14px;
	height: 14px;
	border-top: 3px solid currentColor;
	border-left: 3px solid currentColor;
	transform: rotate(225deg);
	transition: transform 220ms ease;
}

.yht-case-card__toggle[aria-expanded="true"] .yht-case-card__toggle-icon {
	transform: rotate(45deg);
}

.yht-case-card__details[hidden] {
	display: none;
}

/* Expanded desktop state: Before → Process, then Solution → Result. */
.yht-case-card.is-expanded {
	grid-template-rows: 1fr;
}

.yht-case-card.is-expanded .yht-case-card__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
	grid-template-areas:
		"header header header"
		"before overview-arrow process"
		"solution details-arrow result"
		"toggle toggle toggle";
	gap: 16px 24px;
	align-content: center;
}

.yht-case-card.is-expanded .yht-case-card__header,
.yht-case-card.is-expanded .yht-case-card__overview,
.yht-case-card.is-expanded .yht-case-card__details,
.yht-case-card.is-expanded .yht-case-card__details-layout {
	display: contents;
}

.yht-case-card.is-expanded .yht-case-card__header {
	display: block;
	grid-area: header;
	margin-bottom: 8px;
}

.yht-case-card.is-expanded .yht-case-card__overview .yht-case-card__panel--before {
	grid-area: before;
}

.yht-case-card.is-expanded .yht-case-card__overview .yht-case-card__connector {
	grid-area: overview-arrow;
}

.yht-case-card.is-expanded .yht-case-card__overview .yht-case-card__panel--result {
	grid-area: result;
}

.yht-case-card.is-expanded .yht-case-card__details .yht-case-card__panel--solution {
	grid-area: solution;
}

.yht-case-card.is-expanded .yht-case-card__details .yht-case-card__connector {
	grid-area: details-arrow;
}

.yht-case-card.is-expanded .yht-case-card__details .yht-case-card__panel--process {
	grid-area: process;
}

.yht-case-card.is-expanded .yht-case-card__toggle {
	grid-area: toggle;
	margin-top: 0;
}

@media (max-width: 921px) {
	.yht-case-card {
		grid-template-columns: minmax(240px, 30%) minmax(0, 1fr);
	}

	.yht-case-card__body {
		padding: 32px;
	}

	.yht-case-card__overview,
	.yht-case-card__details-layout {
		gap: 16px;
	}
}

@media (max-width: 767px) {
	.yht-case-studies {
		gap: 28px;
	}

	.yht-case-card {
		display: block;
		border-radius: 14px;
	}

	.yht-case-card__media {
		min-height: 144px;
		max-height: 144px;
	}

	.yht-case-card__body {
		display: flex;
		padding: 52px 40px 40px;
	}

	.yht-case-card__header {
		margin-bottom: 40px;
	}

	.yht-case-card__number {
		font-size: 48px;
		line-height: 48px;
	}

	.yht-case-card__title {
		font-size: 24px;
		line-height: 32px;
	}

	.yht-case-card__overview,
	.yht-case-card__details-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.yht-case-card__panel {
		min-height: 0;
		padding: 28px 28px 26px 32px;
	}

	.yht-case-card__panel-heading {
		margin-bottom: 16px;
	}

	.yht-case-card__panel-content {
		font-size: 14px;
		line-height: normal;
	}

	.yht-case-card__connector {
		justify-content: center;
		height: 36px;
	}

	.yht-case-card__connector svg {
		transform: rotate(90deg);
	}

	.yht-case-card__toggle {
		width: 64px;
		height: 64px;
		margin: 8px -14px -16px 0;
		border: 1px dashed var(--yht-case-border);
	}

	.yht-case-card.is-expanded .yht-case-card__body {
		display: grid;
		grid-template-columns: 1fr;
		grid-template-areas:
			"header"
			"before"
			"overview-arrow"
			"process"
			"solution"
			"details-arrow"
			"result"
			"toggle";
		gap: 24px;
		padding: 52px 40px 40px;
	}

	.yht-case-card.is-expanded .yht-case-card__header {
		margin-bottom: 16px;
	}

	.yht-case-card.is-expanded .yht-case-card__toggle {
		margin-top: -8px;
	}
}

@media (max-width: 479px) {
	.yht-case-card__body,
	.yht-case-card.is-expanded .yht-case-card__body {
		padding-right: 24px;
		padding-left: 24px;
	}

	.yht-case-card__panel {
		padding: 24px 20px 22px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yht-case-card__toggle,
	.yht-case-card__toggle-icon {
		transition: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.yht-case-card.is-yht-case-animate {
		opacity: 0;
		transform: translateY(100px);
	}

	.yht-case-card.is-yht-case-animate.is-yht-case-visible {
		/* Changed from 1s to 2.5s for a much longer float */
		animation: yht-case-slide-in-up 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) var(--yht-case-animation-delay, 0ms) both;
	}

	@keyframes yht-case-slide-in-up {
		from {
			opacity: 0;
			transform: translateY(100px);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

.elementor-heading-title {
    line-height: normal;
}
