/**
 * Testimonial Grid Block Styles
 *
 * @package made-to-thrive-2026-base
 * @since 1.0.0
 */

/* Screen reader text for accessibility */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

/* Preview Image - ensure it displays in editor */
.wp-block-cwp-testimonial-grid figure,
[data-type="cwp/testimonial-grid"] figure {
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	display: block !important;
	line-height: 0 !important;
	background: transparent !important;
}

.wp-block-cwp-testimonial-grid figure img,
[data-type="cwp/testimonial-grid"] figure img {
	width: 100% !important;
	height: auto !important;
	display: block !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}

.testimonial-grid,
.wp-block-cwp-testimonial-grid {
	padding: 126px 0 126px;
}

.testimonial-grid .testimonial-grid-inner,
.wp-block-cwp-testimonial-grid .testimonial-grid-inner {
	max-width: 1028px;
	margin: 0 auto;
	padding: 0;
	--testimonial-grid-card-bg: var(--wp--preset--color--cream);
}

.testimonial-grid .testimonial-grid-header,
.wp-block-cwp-testimonial-grid .testimonial-grid-header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	margin: 0 0 59px;
	text-align: center;
}

.testimonial-grid .testimonial-grid-header-star,
.wp-block-cwp-testimonial-grid .testimonial-grid-header-star {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}

.testimonial-grid .testimonial-grid-title,
.wp-block-cwp-testimonial-grid .testimonial-grid-title {
	margin: 0;
	font-size: 19px;
	font-weight: 500;
	line-height: 27px;
	font-family: 'Inter';
}

.testimonial-grid .testimonial-grid-grid,
.wp-block-cwp-testimonial-grid .testimonial-grid-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
}

/* Mobile Slider - Hidden on desktop */
.testimonial-grid-swiper-wrapper {
	display: none;
}

@media (max-width: 980px) {
	.testimonial-grid .testimonial-grid-grid,
	.wp-block-cwp-testimonial-grid .testimonial-grid-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	/* Hide grid on mobile */
	.testimonial-grid .testimonial-grid-grid,
	.wp-block-cwp-testimonial-grid .testimonial-grid-grid {
		display: none;
	}

	/* Show slider on mobile */
	.testimonial-grid-swiper-wrapper {
		display: block;
		width: 100%;
		position: relative;
	}

	.testimonial-grid-swiper {
		width: 100%;
		position: relative;
		overflow: hidden;
		padding-bottom: 50px!important;
	}

	.testimonial-grid-slide {
		height: auto;
		display: flex;
		align-items: stretch;
	}

	/* Media items in mobile slider */
	.testimonial-grid-slide .testimonial-grid-tile--media {
		width: 100%;
		height: 100%;
		min-height: 400px;
		border-radius: 22px;
		overflow: hidden;
		display: block;
	}

	.testimonial-grid-slide .testimonial-grid-media {
		position: relative;
		width: 100%;
		height: 100%;
		min-height: 450px;
		background: rgba(0, 0, 0, 0.03);
		display: block;
		border-radius: 25px;
		overflow: hidden;
	}

	.testimonial-grid-slide .testimonial-grid-image,
	.testimonial-grid-slide .testimonial-grid-video {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.testimonial-grid-mobile-slide {
		display: flex;
		width: 100%;
		min-height: 450px;
		background: var(--testimonial-grid-card-bg, var(--wp--preset--color--cream));
		border-radius: 22px;
		overflow: hidden;
	}

	.testimonial-grid-mobile-image {
		flex: 0 0 40%;
		min-width: 120px;
		max-width: 40%;
		position: relative;
		overflow: hidden;
		background: rgba(0, 0, 0, 0.03);
	}

	.testimonial-grid-mobile-image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.testimonial-grid-mobile-content {
		flex: 1;
		padding: 20px;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		overflow-y: auto;
	}

	/* When no image, content takes full width */
	.testimonial-grid-mobile-slide:not(:has(.testimonial-grid-mobile-image)) .testimonial-grid-mobile-content {
		width: 100%;
	}

	.testimonial-grid-mobile-content .testimonial-grid-name {
		margin: 0 0 4px;
		font-size: 16px;
		font-weight: 500;
		line-height: 1.4;
	}

	.testimonial-grid-mobile-content .testimonial-grid-subtitle {
		margin: 0 0 8px;
		font-size: 12px;
		line-height: 1.4;
		opacity: 0.7;
	}

	.testimonial-grid-mobile-content .testimonial-grid-rating {
		margin: 0 0 12px;
		display: flex;
		gap: 2px;
	}

	.testimonial-grid-mobile-content .testimonial-grid-rating-star {
		width: 12px;
		height: 12px;
	}

	.testimonial-grid-mobile-content .testimonial-grid-review {
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.testimonial-grid-mobile-content .testimonial-grid-review-text {
		font-size: 13px;
		line-height: 1.5;
		flex: 1;
	}

	.testimonial-grid-mobile-content .testimonial-grid-read-more {
		margin-top: 8px;
		align-self: flex-start;
		font-size: 12px;
		padding: 4px 8px;
		background: transparent;
		border: none;
		color: currentColor;
		text-decoration: underline;
		cursor: pointer;
	}

	/* Pagination */
	.testimonial-grid-pagination {
		bottom: 0 !important;
		position: absolute;
	}

	.testimonial-grid-pagination .swiper-pagination-bullet {
		width: 4px;
		height: 4px;
		background-color: #013D36;
		opacity: 1;
		transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
		cursor: pointer;
	}

	.testimonial-grid-pagination .swiper-pagination-bullet-active {
		opacity: 1;
		background-color: #013D36;
		width: 7px;
		height: 7px;
		margin-bottom: -1px !important;
	}

	.testimonial-grid-pagination .swiper-pagination-bullet:hover,
	.testimonial-grid-pagination .swiper-pagination-bullet:focus {
		opacity: 0.8;
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}
}

@media (max-width: 640px) {
	.testimonial-grid .testimonial-grid-grid,
	.wp-block-cwp-testimonial-grid .testimonial-grid-grid {
		display: none;
	}
}

.testimonial-grid .testimonial-grid-tile,
.wp-block-cwp-testimonial-grid .testimonial-grid-tile {
	border-radius: 22px;
	overflow: hidden;
	min-height: 0;
	min-height: 479px;
}

/* Media tile */
.testimonial-grid .testimonial-grid-media,
.wp-block-cwp-testimonial-grid .testimonial-grid-media {
	position: relative;
	width: 100%;
	background: rgba(0, 0, 0, 0.03);
	height: 100%;
}

.testimonial-grid .testimonial-grid-image,
.testimonial-grid .testimonial-grid-video,
.wp-block-cwp-testimonial-grid .testimonial-grid-image,
.wp-block-cwp-testimonial-grid .testimonial-grid-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.testimonial-grid .testimonial-grid-video-toggle,
.wp-block-cwp-testimonial-grid .testimonial-grid-video-toggle {
	position: absolute;
	left: 0.85rem;
	right: 0.85rem;
	bottom: 0.85rem;
	z-index: 2;
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 0.85rem;
	font-size: 0.9rem;
	line-height: 1.1;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	backdrop-filter: blur(6px);
}

.testimonial-grid .testimonial-grid-video-toggle:focus-visible,
.wp-block-cwp-testimonial-grid .testimonial-grid-video-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.testimonial-grid .testimonial-grid-tile--media.is-unmuted .testimonial-grid-video-toggle,
.wp-block-cwp-testimonial-grid .testimonial-grid-tile--media.is-unmuted .testimonial-grid-video-toggle {
	background: rgba(0, 0, 0, 0.7);
}

/* Testimonial tile */
.testimonial-grid .testimonial-grid-tile--testimonial,
.wp-block-cwp-testimonial-grid .testimonial-grid-tile--testimonial {
	background: var(--testimonial-grid-card-bg);
	padding: 41px 43px;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.testimonial-grid .testimonial-grid-name,
.wp-block-cwp-testimonial-grid .testimonial-grid-name {
	margin: 0;
	font-weight: 400x;
	font-size: 17px;
	line-height: 27px;
	color: #013D36;
	font-family: 'Inter';
}

.testimonial-grid .testimonial-grid-subtitle,
.wp-block-cwp-testimonial-grid .testimonial-grid-subtitle {
	margin: 0;
	font-size: 15px;
	opacity: 0.41;
	color: #013D36;
	line-height: 27px;
}

.testimonial-grid .testimonial-grid-rating,
.wp-block-cwp-testimonial-grid .testimonial-grid-rating {
	display: inline-flex;
	gap: 9px;
	margin: 10px 0 17px;
}

.testimonial-grid .testimonial-grid-rating-star,
.wp-block-cwp-testimonial-grid .testimonial-grid-rating-star {
	width: 17px;
	height: 16px;
	display: block;
}

.testimonial-grid .testimonial-grid-review,
.wp-block-cwp-testimonial-grid .testimonial-grid-review {
	margin-top: 0.25rem;
	position: relative;
}

.testimonial-grid .testimonial-grid-review-text,
.wp-block-cwp-testimonial-grid .testimonial-grid-review-text {
	font-size: 0.95rem;
	line-height: 1.55;
}

.testimonial-grid .testimonial-grid-review-text > :first-child,
.wp-block-cwp-testimonial-grid .testimonial-grid-review-text > :first-child {
	margin-top: 0;
}

.testimonial-grid .testimonial-grid-review-text > :last-child,
.wp-block-cwp-testimonial-grid .testimonial-grid-review-text > :last-child {
	margin-bottom: 0;
	font-size: 17px;
	line-height: 24px;
}

/* Clamp review text to 12 lines by default */
.testimonial-grid .testimonial-grid-review-text:not(.is-expanded),
.wp-block-cwp-testimonial-grid .testimonial-grid-review-text:not(.is-expanded) {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
/* 	-webkit-line-clamp: 12; */
}

.testimonial-grid .testimonial-grid-read-more,
.wp-block-cwp-testimonial-grid .testimonial-grid-read-more {
	margin-top: 0.6rem;
	padding: 0;
	border: 0;
	background: #f8f4f0;
	color: #00563D;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
	width: fit-content;
	position: absolute;
	bottom: -11px;
	left: 0;
	opacity: 1;
	font-size: 15px;
	width: 100%;
	text-align: left;
	padding: 9px 0 0;
}

.testimonial-grid .testimonial-grid-read-more:focus-visible,
.wp-block-cwp-testimonial-grid .testimonial-grid-read-more:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}


@media (max-width:500px) {
	.testimonial-grid, .wp-block-cwp-testimonial-grid {
	    padding: 86px 0 56px 0px;
	}
	.testimonial-grid-swiper-wrapper {
		padding-left:30px;
	}
}