/**
 * codebycp Testimonial Image Grid styles.
 *
 * Defaults are driven by CSS custom properties so the shortcode can set them
 * inline. The Elementor widget overrides layout/border/etc. with higher
 * specificity CSS generated from its controls, so both stay in sync.
 */

.cbcp-tg-grid {
	display: grid;
	grid-template-columns: repeat(var(--cbcp-tg-cols, 3), 1fr);
	gap: var(--cbcp-tg-gap, 16px);
}

/* Shortcode responsive breakpoints (widget uses Elementor's own breakpoints). */
@media (max-width: 1024px) {
	.cbcp-tg-grid {
		grid-template-columns: repeat(var(--cbcp-tg-cols-tablet, 2), 1fr);
	}
}

@media (max-width: 767px) {
	.cbcp-tg-grid {
		grid-template-columns: repeat(var(--cbcp-tg-cols-mobile, 1), 1fr);
	}
}

.cbcp-tg-item {
	position: relative;
	overflow: hidden;
	margin: 0;
	background: #f2f2f2;
	border-radius: var(--cbcp-tg-radius, 0);
	border-width: var(--cbcp-tg-border-width, 0);
	border-style: solid;
	border-color: var(--cbcp-tg-border-color, transparent);
}

.cbcp-tg--has-aspect .cbcp-tg-item {
	aspect-ratio: var(--cbcp-tg-aspect, 1 / 1);
}

.cbcp-tg-link {
	display: block;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.cbcp-tg-img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform 0.5s ease, filter 0.5s ease;
	will-change: transform;
}

.cbcp-tg--has-aspect .cbcp-tg-img {
	height: 100%;
}

/* ---------------------------------------------------------------------------
 * Hover effects
 * ------------------------------------------------------------------------ */
.cbcp-tg--hover-zoom .cbcp-tg-item:hover .cbcp-tg-img {
	transform: scale(1.08);
}

.cbcp-tg--hover-zoom-out .cbcp-tg-img {
	transform: scale(1.12);
}
.cbcp-tg--hover-zoom-out .cbcp-tg-item:hover .cbcp-tg-img {
	transform: scale(1);
}

.cbcp-tg--hover-grayscale .cbcp-tg-img {
	filter: grayscale(100%);
}
.cbcp-tg--hover-grayscale .cbcp-tg-item:hover .cbcp-tg-img {
	filter: grayscale(0);
}

.cbcp-tg--hover-blur .cbcp-tg-img {
	filter: blur(3px);
}
.cbcp-tg--hover-blur .cbcp-tg-item:hover .cbcp-tg-img {
	filter: blur(0);
}

.cbcp-tg--hover-lift .cbcp-tg-item {
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.cbcp-tg--hover-lift .cbcp-tg-item:hover {
	transform: translateY(-6px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* Overlay + title */
.cbcp-tg-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}
.cbcp-tg--hover-overlay .cbcp-tg-item:hover .cbcp-tg-overlay {
	opacity: 1;
}
.cbcp-tg-overlay-text {
	color: #fff;
	font-weight: 600;
	text-align: center;
	line-height: 1.3;
}

/* Editor placeholder */
.cbcp-tg-empty {
	padding: 24px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
	color: #646970;
	text-align: center;
	font-size: 14px;
}

/* ---------------------------------------------------------------------------
 * Lightbox
 * ------------------------------------------------------------------------ */
.cbcp-tg-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}
.cbcp-tg-lb.is-open {
	opacity: 1;
	visibility: visible;
}
.cbcp-tg-lb img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	border-radius: 4px;
}
.cbcp-tg-lb__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s ease;
}
.cbcp-tg-lb__btn:hover {
	background: rgba(255, 255, 255, 0.3);
}
.cbcp-tg-lb__prev {
	left: 20px;
}
.cbcp-tg-lb__next {
	right: 20px;
}
.cbcp-tg-lb__close {
	top: 20px;
	right: 20px;
	transform: none;
	width: 42px;
	height: 42px;
	font-size: 24px;
}
.cbcp-tg-lb__cap {
	position: absolute;
	bottom: 24px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font-size: 14px;
	padding: 0 16px;
}

@media (max-width: 767px) {
	.cbcp-tg-lb__prev {
		left: 8px;
	}
	.cbcp-tg-lb__next {
		right: 8px;
	}
}
