/**
 * Split Cards block — front + editor shared styles.
 * Image left, purple panel right, hard-offset lavender shadow.
 *
 * @package WOREC_WP
 */

.wp-block-worec-split-cards {
	max-width: none !important;
	width: 100%;
}

.worec-split-cards {
	--wsc-primary: #560688;
	--wsc-accent: #d928aa;
	--wsc-lavender: #c98eef;
	--wsc-text: #333333;
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 2rem 0;
}

.worec-split-cards *,
.worec-split-cards *::before,
.worec-split-cards *::after {
	box-sizing: border-box;
}

.worec-split-cards__heading {
	margin: 0 0 1.75rem;
	font-size: clamp(1.5rem, 2.5vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--wsc-primary);
}

.worec-split-cards__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin: 0;
	padding: 0;
}

@media (min-width: 1024px) {
	.worec-split-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2rem;
	}
}

/* Odd count: last card spans both columns */
.worec-split-cards__card--span-full {
	grid-column: 1 / -1;
}

.worec-split-cards__card {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid rgba(51, 51, 51, 0.12);
	border-radius: 4px;
	box-shadow: 6px 6px 0 var(--wsc-lavender);
	min-height: 11.5rem;
	height: 100%;
	text-decoration: none !important;
	color: inherit;
	transform: translate3d(0, 0, 0);
	transition:
		transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		box-shadow 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.worec-split-cards__card--linked {
	cursor: pointer;
}

.worec-split-cards__card--linked:hover,
.worec-split-cards__card--linked:focus-visible {
	transform: translate3d(0, -6px, 0);
	box-shadow: 10px 10px 0 var(--wsc-lavender);
	text-decoration: none !important;
}

.worec-split-cards__card--linked:focus-visible {
	outline: 3px solid var(--wsc-accent);
	outline-offset: 3px;
}

.worec-split-cards__media {
	flex: 0 0 48%;
	max-width: 48%;
	min-width: 0;
	align-self: stretch;
	background: #f4eef9;
	overflow: hidden;
}

.worec-split-cards__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
	border: 0;
	transform: scale(1);
	transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.worec-split-cards__card--linked:hover .worec-split-cards__img,
.worec-split-cards__card--linked:focus-visible .worec-split-cards__img {
	transform: scale(1.04);
}

.worec-split-cards__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: clamp(1.35rem, 2.5vw, 2.5rem);
	background: var(--wsc-card-panel, var(--wsc-primary));
	color: var(--wsc-card-text, #ffffff);
}

.worec-split-cards__body > *:first-child {
	margin-top: 0;
}

.worec-split-cards__body > *:last-child {
	margin-bottom: 0;
}

.worec-split-cards__title {
	margin: 0 0 0.85rem !important;
	padding: 0;
	font-size: clamp(1.15rem, 1.8vw, 1.5rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--wsc-card-title, #ffffff);
}

.worec-split-cards__description {
	margin: 0 !important;
	padding: 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.55;
	color: var(--wsc-card-muted, rgba(255, 255, 255, 0.92));
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	overflow: hidden;
}

/* Panel color presets */
.worec-split-cards__body--primary {
	--wsc-card-panel: #560688;
	--wsc-card-text: #ffffff;
	--wsc-card-title: #ffffff;
	--wsc-card-muted: rgba(255, 255, 255, 0.92);
}

.worec-split-cards__body--accent {
	--wsc-card-panel: #d928aa;
	--wsc-card-text: #ffffff;
	--wsc-card-title: #ffffff;
	--wsc-card-muted: rgba(255, 255, 255, 0.94);
}

.worec-split-cards__body--dark {
	--wsc-card-panel: #333333;
	--wsc-card-text: #ffffff;
	--wsc-card-title: #ffffff;
	--wsc-card-muted: rgba(255, 255, 255, 0.9);
}

.worec-split-cards__body--light {
	--wsc-card-panel: #ffffff;
	--wsc-card-text: #333333;
	--wsc-card-title: #560688;
	--wsc-card-muted: #666666;
	border-left: 1px solid rgba(51, 51, 51, 0.08);
}

/* Override page editorial link/heading styles inside split cards */
.page-entry-content .worec-split-cards__card--linked,
.page-entry-content .worec-split-cards__card--linked:hover,
.page-entry-content .worec-split-cards__card--linked:focus-visible,
.single-entry-content .worec-split-cards__card--linked,
.single-entry-content .worec-split-cards__card--linked:hover,
.single-entry-content .worec-split-cards__card--linked:focus-visible {
	color: inherit;
	text-decoration: none !important;
}

.page-entry-content .worec-split-cards__title,
.page-entry-content .worec-split-cards__description,
.single-entry-content .worec-split-cards__title,
.single-entry-content .worec-split-cards__description {
	margin-top: 0;
}

.page-entry-content .worec-split-cards__body--primary .worec-split-cards__title,
.page-entry-content .worec-split-cards__body--accent .worec-split-cards__title,
.page-entry-content .worec-split-cards__body--dark .worec-split-cards__title,
.single-entry-content .worec-split-cards__body--primary .worec-split-cards__title,
.single-entry-content .worec-split-cards__body--accent .worec-split-cards__title,
.single-entry-content .worec-split-cards__body--dark .worec-split-cards__title {
	color: #ffffff !important;
}

.page-entry-content .worec-split-cards__body--light .worec-split-cards__title,
.single-entry-content .worec-split-cards__body--light .worec-split-cards__title {
	color: #560688 !important;
}

.page-entry-content .worec-split-cards__body--primary .worec-split-cards__description,
.page-entry-content .worec-split-cards__body--accent .worec-split-cards__description,
.page-entry-content .worec-split-cards__body--dark .worec-split-cards__description,
.single-entry-content .worec-split-cards__body--primary .worec-split-cards__description,
.single-entry-content .worec-split-cards__body--accent .worec-split-cards__description,
.single-entry-content .worec-split-cards__body--dark .worec-split-cards__description {
	color: rgba(255, 255, 255, 0.92) !important;
}

.page-entry-content .worec-split-cards__body--light .worec-split-cards__description,
.single-entry-content .worec-split-cards__body--light .worec-split-cards__description {
	color: #666666 !important;
}

.worec-split-cards__card:not(:has(.worec-split-cards__media)) .worec-split-cards__body {
	width: 100%;
}

/* Full-span card: slightly wider image ratio on large screens */
@media (min-width: 1024px) {
	.worec-split-cards__card--span-full .worec-split-cards__media {
		flex: 0 0 42%;
		max-width: 42%;
	}

	.worec-split-cards__card--span-full .worec-split-cards__body {
		padding: clamp(1.75rem, 3vw, 3rem);
	}

	.worec-split-cards__card--span-full .worec-split-cards__title {
		font-size: clamp(1.25rem, 2vw, 1.75rem);
	}
}

@media (max-width: 781px) {
	.worec-split-cards__card {
		flex-direction: column;
		min-height: 0;
	}

	.worec-split-cards__media {
		flex: none;
		max-width: none;
		width: 100%;
		aspect-ratio: 16 / 10;
	}

	.worec-split-cards__body {
		padding: 1.35rem 1.5rem 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.worec-split-cards__card,
	.worec-split-cards__img {
		transition: none;
	}

	.worec-split-cards__card--linked:hover,
	.worec-split-cards__card--linked:focus-visible,
	.worec-split-cards__card--linked:hover .worec-split-cards__img,
	.worec-split-cards__card--linked:focus-visible .worec-split-cards__img {
		transform: none;
	}
}
