/**
 * Enhanced CTA Block Styles
 * Supports various layouts, color schemes, custom colors, and advanced styling options
 */

/* Base Block Styling */
.cta-block {
	position: relative;
	overflow: hidden;
	margin: 2rem 0;
}

/* Color Schemes */
.cta-dark {
	background-color: #1e293b; /* Navy background */
	color: #ffffff;
}

.cta-light {
	background-color: #ffffff;
	color: #1e293b;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cta-accent {
	background-color: var(--wp--preset--color--primary, #4338ca); /* Uses theme.json primary if available */
	color: #ffffff;
}

.cta-secondary {
	background-color: var(--wp--preset--color--secondary, #0ea5e9); /* Uses theme.json secondary if available */
	color: #ffffff;
}

/* Container and Content */
.cta-container {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
}

/* Layout Variations */
.cta-layout-text_only .cta-container {
	padding: 2rem;
}

.cta-layout-media_left .cta-container,
.cta-layout-media_right .cta-container {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
}

.cta-layout-media_left .cta-content,
.cta-layout-media_right .cta-content {
	flex: 1;
	min-width: 300px;
	padding: 2rem;
}

.cta-layout-media_left .cta-media-container {
	width: 40%;
	max-width: 400px;
	padding: 2rem 0 2rem 2rem;
}

.cta-layout-media_right .cta-media-container {
	width: 40%;
	max-width: 400px;
	padding: 2rem 2rem 2rem 0;
	order: 2;
}

.cta-layout-media_right .cta-content {
	order: 1;
}

.cta-layout-background_image {
	position: relative;
	color: #ffffff;
	min-height: 300px;
	display: flex;
	align-items: center;
}

.cta-layout-background_image .cta-bg-image {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-size: cover;
	background-position: center;
	z-index: 1;
}

.cta-layout-background_image .cta-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 1;
}

.cta-layout-background_image .cta-container {
	width: 100%;
	z-index: 2;
	padding: 3rem 2rem;
}

.cta-layout-split {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
}

.cta-layout-split .cta-container {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	width: 100%;
}

.cta-layout-split .cta-content {
	flex: 1;
	min-width: 300px;
	padding: 3rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.cta-layout-split .cta-media-container {
	flex: 1;
	min-width: 300px;
	overflow: hidden;
}

.cta-layout-split .cta-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Spacing variations */
.cta-spacing-small.cta-layout-text_only .cta-container,
.cta-spacing-small .cta-content {
	padding: 1.5rem;
}

.cta-spacing-medium.cta-layout-text_only .cta-container,
.cta-spacing-medium .cta-content {
	padding: 2.5rem;
}

.cta-spacing-large.cta-layout-text_only .cta-container,
.cta-spacing-large .cta-content {
	padding: 3.5rem;
}

/* Images */
.cta-image {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

/* Headline */
.cta-headline {
	font-size: 1.6rem;
	font-weight: 700;
	margin-bottom: 0.75rem;
	line-height: 1.2;
}

.cta-dark .cta-headline {
	color: #fff;
}

/* Support Copy */
.cta-support-copy {
	font-size: 1rem;
	line-height: 1.6;
	margin-bottom: 1.5rem;
	max-width: 50ch;
}

/* Buttons */
.cta-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 1.5rem;
}

.cta-button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.2s ease;
}

.cta-primary-button {
	background-color: #ffffff;
	color: #1e293b;
}

.cta-light .cta-primary-button {
	background-color: var(--wp--preset--color--primary, #4338ca);
	color: #ffffff;
}

.cta-secondary-button {
	background-color: transparent;
	border: 1px solid #ffffff;
	color: #ffffff;
}

.cta-light .cta-secondary-button {
	border-color: #1e293b;
	color: #1e293b;
}

.cta-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Alignment */
.cta-align-left {
	text-align: left;
}

.cta-align-center {
	text-align: center;
}

.cta-align-center .cta-support-copy {
	margin-left: auto;
	margin-right: auto;
}

.cta-align-center .cta-buttons {
	justify-content: center;
}

.cta-align-right {
	text-align: right;
}

.cta-align-right .cta-support-copy {
	margin-left: auto;
}

.cta-align-right .cta-buttons {
	justify-content: flex-end;
}

/* Wave Background */
.cta-with-wave {
	overflow: hidden;
}

.cta-with-wave::before {
	content: '';
	position: absolute;
	top: -5%;
	right: -5%;
	width: 40%;
	height: 140%;
	background: rgba(255,255,255,0.08);
	border-radius: 50%;
	transform: rotate(-15deg);
	z-index: 1;
}

.cta-with-wave::after {
	content: '';
	position: absolute;
	bottom: -10%;
	left: -10%;
	width: 25%;
	height: 140%;
	background: rgba(255,255,255,0.05);
	border-radius: 50%;
	transform: rotate(15deg);
	z-index: 1;
}

/* Box Shadow */
.cta-with-shadow {
	box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
	.cta-headline {
		font-size: 1.35rem;
	}
	
	.cta-layout-media_left .cta-container,
	.cta-layout-media_right .cta-container,
	.cta-layout-split .cta-container {
		flex-direction: column;
	}
	
	.cta-layout-media_left .cta-media-container,
	.cta-layout-media_right .cta-media-container {
		width: 100%;
		max-width: 100%;
		padding: 2rem 2rem 0;
		order: 1;
	}
	
	.cta-layout-media_left .cta-content,
	.cta-layout-media_right .cta-content {
		order: 2;
	}
	
	.cta-layout-split .cta-content,
	.cta-layout-split .cta-media-container {
		flex: none;
		width: 100%;
	}
	
	.cta-spacing-large .cta-container,
	.cta-spacing-large .cta-content {
		padding: 2.5rem;
	}
}