/* CBC Image Text Blocks — base styles
 * Colors, typography, spacing, columns and per-block overrides are all
 * driven by the Elementor controls. This file only provides structure.
 */

.cbc-itb-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr); /* fallback; overridden by Columns control */
	gap: 20px;
	width: 100%;
}

/* Equal height on desktop only. Each row track is forced to 1fr so every
   block matches the tallest block in the layout. */
@media (min-width: 1025px) {
	.cbc-itb-grid.cbc-itb-equal {
		grid-auto-rows: 1fr;
	}
}

.cbc-itb-item {
	position: relative;
	overflow: hidden;
	display: flex;
	background-color: #222;
}

.cbc-itb-link {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: inherit;
	text-decoration: none;
	color: inherit;
}

/* Background image layer */
.cbc-itb-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	z-index: 1;
}

/* Color overlay — sits ABOVE the image but BELOW the text,
   so it tints the image only. Color/hover-color set via controls. */
.cbc-itb-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background-color: rgba(0, 0, 0, 0.35);
	transition-property: background-color;
	transition-timing-function: ease;
	transition-duration: 0.3s;
	pointer-events: none;
}

/* Text content — above the overlay */
.cbc-itb-content {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	width: 100%;
	height: 100%;
	padding: 24px;
	box-sizing: border-box;
}

.cbc-itb-title {
	margin: 0;
	color: #fff;
	line-height: 1.2;
}

.cbc-itb-desc {
	margin: 0;
	color: #fff;
}

.cbc-itb-desc > :last-child {
	margin-bottom: 0;
}

/* Keyboard accessibility for linked blocks */
.cbc-itb-link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -3px;
}
