/* =============================================================================
   Testimonial Section – Frontend Styles
   ============================================================================= */

/* Custom properties (defaults; overridden by Elementor selectors) */
.tsb-section {
	--tsb-columns: 3;
	--tsb-gap: 30px;
}

/* =============================================================================
   Layout: Grid
   ============================================================================= */

.tsb-layout-grid {
	display: grid;
	grid-template-columns: repeat( var(--tsb-columns), 1fr );
	gap: var(--tsb-gap);
	align-items: start;
}

/* =============================================================================
   Layout: Cards  (same grid, but items get elevation by default via Elementor
   box-shadow control — the layout itself is identical to Grid)
   ============================================================================= */

.tsb-layout-cards {
	display: grid;
	grid-template-columns: repeat( var(--tsb-columns), 1fr );
	gap: var(--tsb-gap);
	align-items: start;
}

/* Default card appearance when no Elementor styles are set */
.tsb-layout-cards .tsb-item {
	box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
	border-radius: 4px;
}

/* =============================================================================
   Layout: Masonry  (2-col grid; every 3rd item spans full width)
   ============================================================================= */

.tsb-layout-masonry {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: var(--tsb-gap);
	align-items: start;
}

/* Every 3rd card spans both columns and becomes a side-by-side row */
.tsb-layout-masonry .tsb-item:nth-child(3n) {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	padding: 0;
}

/* Alternate: 3rd, 9th, 15th … → image LEFT  (default row order)  */
/* 6th, 12th, 18th …           → image RIGHT (row-reverse)         */
.tsb-layout-masonry .tsb-item:nth-child(6n) {
	flex-direction: row-reverse;
}

/* Image fills the left/right half edge-to-edge */
.tsb-layout-masonry .tsb-item:nth-child(3n) .tsb-item-image {
	width: 50%;
	flex-shrink: 0;
	height: auto !important; /* override Elementor slider value */
	min-height: 320px;
	margin-bottom: 0;
}

.tsb-layout-masonry .tsb-item:nth-child(3n) .tsb-item-image img.tsb-thumb {
	height: 100%;
}

/* Body gets its own internal padding since the item has none */
.tsb-layout-masonry .tsb-item:nth-child(3n) .tsb-item-body {
	flex: 1;
	padding: 40px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* =============================================================================
   Item base
   ============================================================================= */

.tsb-item {
	padding: 32px;
	background-color: #fff;
	overflow: hidden;
}

/* =============================================================================
   Image
   ============================================================================= */

.tsb-item-image {
	width: 100%;
	height: 220px;
	overflow: hidden;
	margin-bottom: 24px;
}

.tsb-item-image img.tsb-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* =============================================================================
   Body
   ============================================================================= */

.tsb-item-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* =============================================================================
   Stars
   ============================================================================= */

.tsb-stars {
	display: flex;
	gap: 2px;
	font-size: 18px;
}

.tsb-star {
	color: #ddd;
	line-height: 1;
}

.tsb-star--on {
	color: #f5a623;
}

/* =============================================================================
   Title
   ============================================================================= */

.tsb-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}

/* =============================================================================
   Quote
   ============================================================================= */

.tsb-quote {
	margin: 0;
	padding: 0;
	border: none;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: #1a1a1a;
	font-style: normal;
}

.tsb-quote p {
	margin: 0 0 1em;
}

.tsb-quote p:last-child {
	margin-bottom: 0;
}

/* Opening quotation mark */
.tsb-has-marks .tsb-quote::before {
	content: '\201C';
	display: block;
	font-size: 4rem;
	line-height: 0.6;
	color: #ccc;
	margin-bottom: 16px;
	font-family: Georgia, serif;
}

/* =============================================================================
   Author
   ============================================================================= */

.tsb-author {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tsb-author-name {
	display: block;
	font-weight: 700;
	font-size: 0.9375rem;
	color: #1a1a1a;
}

.tsb-author-role {
	display: block;
	font-size: 0.8125rem;
	color: #888;
}

/* =============================================================================
   No posts notice
   ============================================================================= */

.tsb-no-posts {
	padding: 16px;
	background: #fff8e1;
	border-left: 4px solid #f5a623;
	font-size: 0.875rem;
}

/* =============================================================================
   Responsive
   ============================================================================= */

/* Tablet  ≤ 1024 px  →  2 columns for grid/cards */
@media ( max-width: 1024px ) {
	.tsb-layout-grid,
	.tsb-layout-cards {
		grid-template-columns: repeat( min( var(--tsb-columns), 2 ), 1fr );
	}
}

/* Mobile  ≤ 767 px  →  1 column, always */
@media ( max-width: 767px ) {
	.tsb-layout-grid,
	.tsb-layout-cards {
		grid-template-columns: 1fr;
	}

	/* Masonry: single column, revert featured items to stacked */
	.tsb-layout-masonry {
		grid-template-columns: 1fr;
	}

	.tsb-layout-masonry .tsb-item:nth-child(3n),
	.tsb-layout-masonry .tsb-item:nth-child(6n) {
		flex-direction: column;
		padding: 0;
	}

	.tsb-layout-masonry .tsb-item:nth-child(3n) .tsb-item-image {
		width: 100%;
		min-height: 220px;
	}

	.tsb-layout-masonry .tsb-item:nth-child(3n) .tsb-item-body {
		padding: 24px;
	}

	.tsb-item {
		padding: 24px;
	}

	.tsb-item-image {
		height: 180px;
	}
}
