/* ==========================================================================
   TextCRM Testimonials Widget
   Mirrors demo-html/home page.html → "Loved by businesses like yours /
   Real Results. Real Impact." section (data-purpose="testimonials").
   ========================================================================== */

.textcrm-testimonials {
	position: relative;
	width: 100%;
	padding-top: 96px;                /* py-24 */
	padding-bottom: 96px;
	background-color: #0b1326;        /* matches reference page bg */
	font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: #f3f4f6;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;

	/* Tunables driven by the Style tab. */
	--tm-card-bg: rgba(255, 255, 255, 0.03);
	--tm-card-border: rgba(255, 255, 255, 0.05);
	--tm-card-radius: 16px;
	--tm-card-padding: 40px;
	--tm-card-blur: 10px;

	--tm-star-color: #00f5a0;
	--tm-star-size: 20px;
	--tm-star-gap: 4px;

	--tm-quote-color: #d1d5db;        /* text-gray-300 */
	--tm-avatar-size: 48px;
	--tm-avatar-ring: rgba(0, 245, 160, 0.2);
	--tm-avatar-ring-width: 2px;

	/* Carousel tunables — also drive grid slides-per-view via --tm-per-view. */
	--tm-per-view: 3;
	--tm-track-gap: 32px;
	--tm-nav-size: 44px;
	--tm-nav-bg: rgba(255, 255, 255, 0.06);
	--tm-nav-border: rgba(255, 255, 255, 0.1);
	--tm-nav-color: #ffffff;
	--tm-nav-bg-hover: rgba(0, 245, 160, 0.1);
	--tm-nav-border-hover: rgba(0, 245, 160, 0.3);
	--tm-dot-color: rgba(255, 255, 255, 0.2);
	--tm-dot-active: #00f5a0;
}

.textcrm-testimonials *,
.textcrm-testimonials *::before,
.textcrm-testimonials *::after {
	box-sizing: border-box;
}

.textcrm-testimonials__container {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

/* --------------------------------------------------------------------------
   Header (eyebrow + heading)
   -------------------------------------------------------------------------- */
.textcrm-testimonials__header {
	text-align: center;
	margin-bottom: 64px;              /* mb-16 */
}

.textcrm-testimonials__eyebrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 16px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #00f5a0;
}

.textcrm-testimonials__eyebrow-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: currentColor;
}

.textcrm-testimonials__eyebrow-icon svg,
.textcrm-testimonials__eyebrow-icon i {
	width: 100%;
	height: 100%;
	font-size: 16px;
	line-height: 1;
}

.textcrm-testimonials__title {
	margin: 0;
	font-size: 36px;
	line-height: 1.1;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.01em;
}

.textcrm-testimonials__title-accent {
	color: #00f5a0;
}

/* --------------------------------------------------------------------------
   Grid — md:grid-cols-3 gap-8
   -------------------------------------------------------------------------- */
.textcrm-testimonials__grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 32px;
}

/* --------------------------------------------------------------------------
   Testimonial card
   -------------------------------------------------------------------------- */
.textcrm-testimonials__card {
	display: flex;
	flex-direction: column;
	padding: var(--tm-card-padding, 40px);    /* p-10 */
	background: var(--tm-card-bg, rgba(255, 255, 255, 0.03));
	border: 1px solid var(--tm-card-border, rgba(255, 255, 255, 0.05));
	border-radius: var(--tm-card-radius, 16px); /* rounded-2xl */
	backdrop-filter: blur(var(--tm-card-blur, 10px));
	-webkit-backdrop-filter: blur(var(--tm-card-blur, 10px));
}

/* Stars row */
.textcrm-testimonials__stars {
	display: inline-flex;
	align-items: center;
	gap: var(--tm-star-gap, 4px);     /* gap-1 */
	margin-bottom: 24px;              /* mb-6 */
	color: var(--tm-star-color, #00f5a0);
}

.textcrm-testimonials__star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tm-star-size, 20px); /* w-5 h-5 */
	height: var(--tm-star-size, 20px);
}

.textcrm-testimonials__star svg {
	display: block;
	width: 100%;
	height: 100%;
	color: currentColor;
}

.textcrm-testimonials__star--empty {
	opacity: 0.2;
}

/* Quote */
.textcrm-testimonials__quote {
	margin: 0 0 40px;                 /* mb-10 */
	font-size: 18px;                  /* text-lg */
	font-style: italic;
	line-height: 1.625;               /* leading-relaxed */
	color: var(--tm-quote-color, #d1d5db);
	flex: 1 0 auto;                   /* keep author pinned to bottom */
}

/* Author row */
.textcrm-testimonials__author {
	display: flex;
	align-items: center;
	gap: 16px;                        /* gap-4 */
}

/* Wrapper carries the rounded shape + ring. Using a <span> here means theme
   rules that reset border-radius / box-shadow on <img> can't reach it, so the
   uploaded avatar always renders circular with the brand ring. */
.textcrm-testimonials__avatar {
	display: inline-block;
	width: var(--tm-avatar-size, 48px);
	height: var(--tm-avatar-size, 48px);
	border-radius: 9999px;
	overflow: hidden;
	flex-shrink: 0;
	box-shadow: 0 0 0 var(--tm-avatar-ring-width, 2px) var(--tm-avatar-ring, rgba(0, 245, 160, 0.2));
	line-height: 0;                   /* kill baseline gap below the inline <img> */
}

.textcrm-testimonials__avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Initials fallback (when no avatar image is provided) */
.textcrm-testimonials__avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tm-avatar-size, 48px);
	height: var(--tm-avatar-size, 48px);
	border-radius: 9999px;
	background: rgba(0, 245, 160, 0.1);
	color: #00f5a0;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	flex-shrink: 0;
	box-shadow: 0 0 0 var(--tm-avatar-ring-width, 2px) var(--tm-avatar-ring, rgba(0, 245, 160, 0.2));
}

.textcrm-testimonials__author-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.textcrm-testimonials__author-name {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
}

.textcrm-testimonials__author-role {
	font-size: 12px;                  /* text-xs */
	color: #d1d5db;                   /* match quote colour for legibility on the dark card */
	line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Carousel mode
   -------------------------------------------------------------------------- */
.textcrm-testimonials__carousel {
	position: relative;
}

.textcrm-testimonials__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - var(--tm-track-gap, 32px) * (var(--tm-per-view, 3) - 1)) / var(--tm-per-view, 3));
	gap: var(--tm-track-gap, 32px);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 4px 12px;            /* room for shadows + a hairline gutter */
	margin: -4px -4px -12px;
}

.textcrm-testimonials__track::-webkit-scrollbar {
	display: none;
}

.textcrm-testimonials__track > .textcrm-testimonials__card {
	scroll-snap-align: start;
	min-width: 0;                     /* allow flex/grid item to shrink */
}

/* Nav arrows */
.textcrm-testimonials__nav {
	position: absolute;
	top: calc(50% - 30px);            /* offset for the dot pagination beneath */
	transform: translateY(-50%);
	width: var(--tm-nav-size, 44px);
	height: var(--tm-nav-size, 44px);
	border-radius: 9999px;
	background: var(--tm-nav-bg, rgba(255, 255, 255, 0.06));
	border: 1px solid var(--tm-nav-border, rgba(255, 255, 255, 0.1));
	color: var(--tm-nav-color, #ffffff);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: background-color 200ms ease, border-color 200ms ease, opacity 200ms ease, transform 200ms ease;
	z-index: 2;
}

.textcrm-testimonials__nav:hover,
.textcrm-testimonials__nav:focus-visible {
	background: var(--tm-nav-bg-hover, rgba(0, 245, 160, 0.1));
	border-color: var(--tm-nav-border-hover, rgba(0, 245, 160, 0.3));
	outline: none;
}

.textcrm-testimonials__nav--prev { left: -22px; }
.textcrm-testimonials__nav--next { right: -22px; }

.textcrm-testimonials__nav[disabled] {
	opacity: 0.35;
	cursor: default;
}

.textcrm-testimonials__nav svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* Dots */
.textcrm-testimonials__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 28px;
	width: 100%;
}

.textcrm-testimonials__dot {
	width: 8px;
	height: 8px;
	border-radius: 9999px;
	background: var(--tm-dot-color, rgba(255, 255, 255, 0.2));
	border: 0;
	padding: 0;
	cursor: pointer;
	transition: background-color 200ms ease, width 200ms ease, transform 200ms ease;
}

.textcrm-testimonials__dot:hover {
	background: rgba(255, 255, 255, 0.4);
}

.textcrm-testimonials__dot[aria-current="true"] {
	background: var(--tm-dot-active, #00f5a0);
	width: 24px;
}

/* On smaller viewports, move the arrows just inside the card edges. */
@media (max-width: 640px) {
	.textcrm-testimonials__nav--prev { left: 6px; }
	.textcrm-testimonials__nav--next { right: 6px; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* sm — 2 cards per row */
@media (min-width: 640px) and (max-width: 767.98px) {
	.textcrm-testimonials__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* md+ — 3 cards per row + larger heading */
@media (min-width: 768px) {
	.textcrm-testimonials__title {
		font-size: 48px;
	}
	.textcrm-testimonials__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Phones — tighten padding */
@media (max-width: 480px) {
	.textcrm-testimonials {
		padding-top: 64px;
		padding-bottom: 64px;
		--tm-card-padding: 28px;
		--tm-track-gap: 16px;
	}
	.textcrm-testimonials__container {
		padding-left: 16px;
		padding-right: 16px;
	}
	.textcrm-testimonials__title {
		font-size: 30px;
	}
	.textcrm-testimonials__header {
		margin-bottom: 48px;
	}
	.textcrm-testimonials__grid {
		gap: 20px;
	}
	.textcrm-testimonials__quote {
		font-size: 16px;
		margin-bottom: 28px;
	}
}
