/* CTA Pro — Frontend Base Styles */

/* ── Box model reset scoped to the block ── */
.ctapro-block,
.ctapro-block *,
.ctapro-block *::before,
.ctapro-block *::after {
	box-sizing: border-box;
}

.ctapro-block {
	display: block;
	width: 100%;
}

/* ── Inner flex container (always present) ── */
.ctapro-inner-flex {
	display: flex;
	width: 100%;
}

/* ── Text wrapper takes all remaining space ── */
.ctapro-text-wrap {
	flex: 1;
	min-width: 0;
	word-break: break-word;
}

/* ── Content image base ── */
.ctapro-content-img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ── Button — always centered, flex for reliable vertical alignment ── */
.ctapro-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	text-decoration: none;
	line-height: 1;
}

/* ================================================================
   LAYOUT: NO IMAGE  (flex column, single child)
   ================================================================ */
.ctapro-block:not([class*="ctapro-layout-"]) .ctapro-inner-flex,
.ctapro-block .ctapro-inner-flex {
	flex-direction: column;
}

/* ================================================================
   LAYOUT: IMAGE TOP  — image above text
   ================================================================ */
.ctapro-layout-top .ctapro-inner-flex {
	flex-direction: column;
}

.ctapro-layout-top .ctapro-img-wrap {
	width: 100%;
	margin-bottom: 24px;
}

/* ================================================================
   LAYOUT: IMAGE BOTTOM  — text above, image below
   (column-reverse: first DOM child = image goes visually last)
   ================================================================ */
.ctapro-layout-bottom .ctapro-inner-flex {
	flex-direction: column-reverse;
}

.ctapro-layout-bottom .ctapro-img-wrap {
	width: 100%;
	margin-top: 24px;
}

/* ================================================================
   LAYOUT: IMAGE LEFT  — image left, text right
   Image height = full height of the row (stretch).
   PHP inline CSS controls: img_width%, object-fit, text justify-content.
   ================================================================ */
.ctapro-layout-left .ctapro-inner-flex {
	flex-direction: row;
	gap: 32px;
	align-items: stretch; /* both img-wrap and text-wrap fill full height */
}

.ctapro-layout-left .ctapro-img-wrap {
	flex-shrink: 0;
	align-self: stretch;
}

.ctapro-layout-left .ctapro-content-img {
	width: 100%;
	height: 100%;  /* fills the img-wrap height */
	object-fit: cover; /* overridden by PHP inline CSS (img_object_fit) */
}

/* ================================================================
   LAYOUT: IMAGE RIGHT  — text left, image right
   (row-reverse: first DOM child = image goes visually to the right)
   ================================================================ */
.ctapro-layout-right .ctapro-inner-flex {
	flex-direction: row-reverse;
	gap: 32px;
	align-items: stretch;
}

.ctapro-layout-right .ctapro-img-wrap {
	flex-shrink: 0;
	align-self: stretch;
}

.ctapro-layout-right .ctapro-content-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ================================================================
   RESPONSIVE — tablets & phones (≤ 768px)
   Side-by-side layouts collapse to stacked (image on top).
   PHP inline CSS also emits this same override for scoped specificity.
   ================================================================ */
@media (max-width: 768px) {
	.ctapro-layout-left .ctapro-inner-flex,
	.ctapro-layout-right .ctapro-inner-flex {
		flex-direction: column !important;
		align-items: initial !important;
		gap: 20px;
	}

	.ctapro-layout-left .ctapro-img-wrap,
	.ctapro-layout-right .ctapro-img-wrap {
		width: 100% !important;
		align-self: auto !important;
	}

	.ctapro-layout-left .ctapro-content-img,
	.ctapro-layout-right .ctapro-content-img {
		height: auto !important;
		max-width: 100% !important;
	}
}

/* ================================================================
   RESPONSIVE — phones (≤ 600px)
   Reduce padding and scale font sizes
   ================================================================ */
@media (max-width: 600px) {
	.ctapro-inner {
		padding-left: 24px !important;
		padding-right: 24px !important;
		padding-top: 36px !important;
		padding-bottom: 36px !important;
	}

	.ctapro-title {
		font-size: clamp(22px, 6vw, 42px) !important;
	}

	.ctapro-desc {
		font-size: clamp(14px, 4vw, 20px) !important;
	}
}
