/*
 * Client Testimonials band: light lavender container, dark review cards
 * (inc/widgets/class-saiftec-testimonials-band.php, data in inc/testimonials-band.php).
 *
 * Scoped to .tsl; every element is named by class at (0,2,0)+, which beats the Elementor Kit's
 * `.elementor-kit-N h2/h3/a/button/p` (0,1,1) and `.elementor img` (0,1,1). Buttons restate every
 * state they use because the Kit styles bare buttons, including :hover and :focus.
 *
 * STABLE HEIGHT. A card is a fixed height at each breakpoint, made of fixed slots: the label row,
 * the quote window (an exact number of lines of the quote's own line-height), the "Read full review"
 * slot and the reviewer row. Short reviews keep the space; longer ones are clamped to the window
 * (and the script then offers the full review). So every review is the same height and switching
 * never moves the controls or the page below.
 *
 * The approved mockup was drawn about 780px wide; sizes keep its proportions at the real 1200px
 * content width.
 */

.tsl {
	--tsl-navy: #170d3d;
	--tsl-card: #241b3c;
	--tsl-canvas: #edefff;
	--tsl-cyan: #0aa3d6;
	--tsl-teal: #07708f;   /* #0AA3D6 darkened for small text on lavender (WCAG AA) */
	--tsl-purple: #3a0ca3;
	--tsl-muted: #5a5a72;
	--tsl-head: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
	--tsl-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
	/* card geometry (desktop) */
	--tsl-card-h: 372px;
	--tsl-card-pad: 30px;
	--tsl-quote-size: 24px;
	--tsl-quote-lh: 1.4;
	--tsl-lines: 4;
	color: var(--tsl-navy);
	font-family: var(--tsl-body);
	font-size: 16px;
	line-height: 1.6;
}
.elementor-widget-saiftec-testimonials { width: 100%; }
.tsl *,
.tsl *::before,
.tsl *::after { box-sizing: border-box; }
.tsl [hidden] { display: none !important; }
.tsl p { margin: 0; }
.tsl .tsl-icon { width: 1em; height: 1em; flex: none; display: block; }

/* ---------- Container ---------- */
.tsl .tsl-shell {
	max-width: 1180px; /* the homepage's content width, like the sections around it */
	margin: 0 auto;
	padding: 52px 48px 40px;
	background: var(--tsl-canvas);
	border: 1px solid #e4e5f3;
	border-radius: 20px;
	overflow: clip;
}

/* ---------- Header ---------- */
.tsl .tsl-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 212px;
	gap: 36px;
	align-items: center;
	margin-bottom: 36px;
}
.tsl .tsl-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 20px;
	font-family: var(--tsl-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--tsl-teal);
}
.tsl .tsl-eyebrow::before { content: ""; flex: none; width: 22px; height: 2px; background: var(--tsl-cyan); }
.tsl .tsl-title {
	margin: 0;
	padding: 0;
	font-family: var(--tsl-head);
	font-size: 54px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.016em;
	color: var(--tsl-navy);
	text-transform: none;
}
.tsl .tsl-title span { display: block; color: #0b84ac; }
.tsl .tsl-intro {
	max-width: 640px;
	margin-top: 20px;
	font-size: 16px;
	line-height: 1.8;
	color: var(--tsl-muted);
}

/* Google badge */
.tsl .tsl-badge,
.tsl .tsl-badge:visited {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
	padding: 16px 14px 13px;
	background: #fff;
	border: 1px solid #e1e2ee;
	border-radius: 10px;
	color: var(--tsl-purple);
	text-decoration: none;
	transition: transform .2s;
}
.tsl .tsl-badge-img { display: block; width: 100%; max-width: 176px; height: auto; object-fit: contain; }
.tsl .tsl-badge-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--tsl-head);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	color: var(--tsl-purple);
}
.tsl .tsl-badge-cta .tsl-icon { font-size: 14px; }
.tsl a.tsl-badge:hover,
.tsl a.tsl-badge:focus { color: var(--tsl-purple); text-decoration: none; }
.tsl a.tsl-badge:hover .tsl-badge-cta { text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.tsl a.tsl-badge:hover { transform: translateY(-2px); }
}

/* ---------- Cards ---------- */
.tsl .tsl-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tsl .tsl-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: var(--tsl-card-h);
	padding: var(--tsl-card-pad);
	color: #fff;
	background: var(--tsl-card);
	border: 1px solid #302648;
	border-radius: 14px;
}
.tsl .tsl-card.is-lead { background: var(--tsl-navy); border-color: var(--tsl-navy); }
.tsl .tsl-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 26px; flex: none; }
.tsl .tsl-card-label {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-family: var(--tsl-body);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .14em;
	line-height: 1.4;
	text-transform: uppercase;
	color: #bfc6dd;
}
.tsl .tsl-card-mark { flex: none; font-size: 25px; color: #6ed3ef; }
.tsl .tsl-quote-window {
	flex: none;
	height: calc(var(--tsl-quote-size) * var(--tsl-quote-lh) * var(--tsl-lines));
	margin: 20px 0 0;
	padding: 0;
	border: 0;
	background: none;
	quotes: none;
}
.tsl .tsl-quote-window::before,
.tsl .tsl-quote-window::after { content: none; }
.tsl .tsl-quote {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--tsl-lines);
	line-clamp: var(--tsl-lines);
	overflow: hidden;
	margin: 0;
	font-family: var(--tsl-head);
	font-size: var(--tsl-quote-size);
	font-weight: 400;
	font-style: normal;
	line-height: var(--tsl-quote-lh);
	letter-spacing: -.008em;
	color: #fff;
	overflow-wrap: break-word;
}
.tsl .tsl-more-slot { flex: none; height: 40px; display: flex; align-items: flex-start; margin-top: 8px; }
.tsl .tsl-more,
.tsl .tsl-more:hover,
.tsl .tsl-more:focus {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 4px 0;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	box-shadow: none;
	cursor: pointer;
	font-family: var(--tsl-head);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
	color: #7bdcf5;
	text-decoration: underline;
	text-decoration-color: rgb(123 220 245 / 50%);
	text-underline-offset: 5px;
}
.tsl .tsl-more:hover { text-decoration-color: #7bdcf5; }
.tsl .tsl-more .tsl-icon { font-size: 15px; }
.tsl:not(.tsl--js) .tsl-more { visibility: hidden; } /* needs the script; the slot keeps its space */
.tsl .tsl-author {
	display: flex;
	align-items: center;
	gap: 13px;
	margin-top: auto;
	padding-top: 18px;
	min-height: 78px;
	border-top: 1px solid rgb(255 255 255 / 15%);
}
.tsl .tsl-avatar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	overflow: hidden;
	border-radius: 8px;
	background: rgb(255 255 255 / 6.3%);
	color: #e8deff;
	font-family: var(--tsl-body);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .04em;
}
.tsl .tsl-avatar .tsl-avatar-img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 8px; }
.tsl .tsl-who { min-width: 0; }
.tsl .tsl-name {
	margin: 0;
	padding: 0;
	font-family: var(--tsl-head);
	font-size: 19px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	color: #fff;
	text-transform: none;
}
.tsl .tsl-business {
	margin-top: 4px;
	font-family: var(--tsl-body);
	font-size: 13px;
	line-height: 1.5;
	color: #c6bdd5;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
.tsl .tsl-swap { animation: tsl-swap .2s ease-out; }
@keyframes tsl-swap { from { opacity: .55; transform: translateX(4px); } to { opacity: 1; transform: none; } }

/* ---------- Navigation ---------- */
.tsl .tsl-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 66px; padding-top: 18px; }
.tsl:not(.tsl--js) .tsl-nav { visibility: hidden; } /* reserved, so nothing moves when the script starts */
.tsl .tsl-dots { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.tsl .tsl-dot,
.tsl .tsl-dot:hover,
.tsl .tsl-dot:focus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	box-shadow: none;
	cursor: pointer;
}
.tsl .tsl-dot::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: #b4b0c5; transition: width .18s, background-color .18s; }
.tsl .tsl-dot:hover::before { background: #8d87a3; }
.tsl .tsl-dot[aria-pressed="true"]::before { width: 24px; background: var(--tsl-purple); }
.tsl .tsl-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.tsl .tsl-counter {
	min-width: 56px;
	margin-right: 10px;
	text-align: center;
	font-family: var(--tsl-head);
	font-size: 13px;
	letter-spacing: .1em;
	color: #625c76;
	font-variant-numeric: tabular-nums;
}
.tsl .tsl-arrow,
.tsl .tsl-arrow:focus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid #d9d5e6;
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	color: var(--tsl-purple);
	cursor: pointer;
	transition: background-color .18s, color .18s, border-color .18s;
}
.tsl .tsl-arrow:hover { background: var(--tsl-navy); border-color: var(--tsl-navy); color: #fff; }
.tsl .tsl-arrow .tsl-icon { font-size: 18px; }

/* ---------- Client logos ---------- */
.tsl .tsl-clients { margin-top: 18px; padding-top: 24px; border-top: 1px solid #dadbe9; }
.tsl .tsl-clients-label {
	margin: 0 0 16px;
	font-family: var(--tsl-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--tsl-muted);
}
.tsl .tsl-logos-frame { overflow: hidden; background: #fff; border: 1px solid #e1e2ed; border-radius: 12px; }
/* Dividers: every cell draws its left and top line; the list is pulled 1px up and left inside the
   clipped frame, so only the lines BETWEEN cells show, whatever the last row holds. */
.tsl .tsl-logos {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(var(--tsl-logos, 3), minmax(0, 1fr));
	margin: -1px 0 0 -1px;
	padding: 0;
}
.tsl .tsl-logo-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 112px;
	margin: 0;
	padding: 16px 22px;
	border-left: 1px solid #ebe9ef;
	border-top: 1px solid #ebe9ef;
}
.tsl .tsl-logos {
	--tsl-logo-w: 176px;  /* the largest a logo may be drawn, either way */
	--tsl-logo-h: 72px;
}
.tsl .tsl-logos .tsl-logo {
	display: block;
	width: auto;
	height: auto;
	max-width: min(100%, var(--tsl-logo-w));
	max-height: var(--tsl-logo-h);
	object-fit: contain;
	border-radius: 0;
	filter: none;
	opacity: 1;
}
/* A logo with built-in empty margin is drawn zoomed to its artwork box (inc/testimonials-band.php,
   saiftec_tsl_logo_box): the frame takes the artwork's aspect ratio and fits the same max box, and
   the full image is scaled and offset inside it. Nothing of the logo itself is cut. */
.tsl .tsl-logos .tsl-logo-frame {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--ar);
	width: min(100%, var(--tsl-logo-w), calc(var(--tsl-logo-h) * var(--ar)));
}
.tsl .tsl-logos .tsl-logo-frame .tsl-logo {
	position: absolute;
	left: calc(-100% * var(--bx) / var(--bw));
	top: calc(-100% * var(--by) / var(--bh));
	width: calc(100% / var(--bw));
	height: calc(100% / var(--bh));
	max-width: none;
	max-height: none;
}

/* Moving strip (assets/testimonials-band.js adds .tsl--marquee; without the script, or with reduced
   motion, the logos stay the still grid above). One row of fixed-width cells; the script appends
   aria-hidden copies and sets --tsl-set-w (one set's width) and --tsl-dur, and the row slides left by
   exactly one set before repeating, so the loop has no seam. */
.tsl.tsl--marquee .tsl-logos {
	--tsl-cell: 210px;
	display: flex;
	width: max-content;
	margin: 0;
	animation: tsl-marquee var(--tsl-dur, 30s) linear infinite;
	will-change: transform;
}
.tsl.tsl--marquee .tsl-logo-cell {
	flex: 0 0 var(--tsl-cell);
	width: var(--tsl-cell);
	border-top: 0;
	border-left: 0;
	border-right: 1px solid #ebe9ef;
}
@keyframes tsl-marquee {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(calc(-1 * var(--tsl-set-w, 0px)), 0, 0); }
}
.tsl.tsl--stopped .tsl-logos,
.tsl.tsl--held .tsl-logos,
.tsl .tsl-logos-frame:hover .tsl-logos { animation-play-state: paused; }

/* Pause / Play for all automatic movement */
.tsl .tsl-play .tsl-play-play { display: none; }
.tsl.tsl--stopped .tsl-play .tsl-play-pause { display: none; }
.tsl.tsl--stopped .tsl-play .tsl-play-play { display: block; }
.tsl .tsl-play .tsl-icon { font-size: 16px; }

/* ---------- Full review dialog ---------- */
html.tsl-locked { overflow: hidden; padding-right: var(--tsl-scrollbar, 0); }
.tsl .tsl-reader {
	width: calc(100% - 32px);
	max-width: 640px;
	max-height: calc(100dvh - 48px);
	padding: 0;
	margin: auto;
	border: 1px solid #ded8ea;
	border-radius: 14px;
	background: #fff;
	color: var(--tsl-navy);
	box-shadow: 0 24px 80px rgb(6 2 17 / 40%);
	overflow: hidden;
}
.tsl .tsl-reader[open] { display: flex; flex-direction: column; }
.tsl .tsl-reader::backdrop { background: rgb(14 8 38 / 65%); }
.tsl .tsl-reader-header {
	flex: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 22px 26px;
	border-bottom: 1px solid #e7e4ee;
}
.tsl .tsl-reader-kicker { margin-bottom: 6px; font-family: var(--tsl-body); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--tsl-purple); }
.tsl .tsl-reader-title { margin: 0; padding: 0; font-family: var(--tsl-head); font-size: 23px; font-weight: 500; line-height: 1.3; color: var(--tsl-navy); text-transform: none; }
.tsl .tsl-close,
.tsl .tsl-close:hover,
.tsl .tsl-close:focus {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid #ded8ea;
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	color: var(--tsl-navy);
	cursor: pointer;
}
.tsl .tsl-close:hover { background: #f5f3fa; }
.tsl .tsl-close .tsl-icon { font-size: 19px; }
.tsl .tsl-reader-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 26px; }
.tsl .tsl-reader-body p { margin: 0 0 16px; font-family: var(--tsl-head); font-size: 17px; line-height: 1.8; color: var(--tsl-navy); }
.tsl .tsl-reader-body p:last-child { margin-bottom: 0; }
.tsl .tsl-reader-footer { flex: none; padding: 18px 26px; background: #f5f3fa; border-top: 1px solid #e7e4ee; }
.tsl .tsl-reader-name { font-family: var(--tsl-head); font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--tsl-navy); }
.tsl .tsl-reader-business { margin-top: 2px; font-size: 13px; line-height: 1.5; color: #6b637a; }

/* ---------- Focus ---------- */
.tsl a:focus,
.tsl button:focus { outline: none; }
.tsl a:focus-visible,
.tsl button:focus-visible,
.tsl .tsl-reader-body:focus-visible {
	outline: 3px solid var(--tsl-cyan);
	outline-offset: 3px;
	box-shadow: none;
}
.tsl .tsl-card button:focus-visible { outline-color: #7bdcf5; }

/* ---------- Tablet: two narrower cards ---------- */
@media (max-width: 1024px) {
	.tsl { --tsl-card-h: 400px; --tsl-card-pad: 26px; --tsl-quote-size: 22px; --tsl-lines: 5; }
	.tsl .tsl-shell { padding: 44px 32px 34px; }
	.tsl .tsl-header { grid-template-columns: minmax(0, 1fr) 190px; gap: 28px; }
	.tsl .tsl-title { font-size: 46px; }
	.tsl .tsl-name { font-size: 17px; }
	.tsl .tsl-logo-cell { height: 100px; padding: 14px 16px; }
	.tsl .tsl-logos { --tsl-logo-h: 64px; }
}
/* Below 900px one card per view: with real review lengths, two narrow cards would cut most quotes. */
@media (max-width: 899px) {
	.tsl { --tsl-card-h: 352px; --tsl-quote-size: 22px; --tsl-lines: 4; }
	.tsl .tsl-cards { grid-template-columns: minmax(0, 1fr); }
	.tsl:not(.tsl--js) .tsl-card:not([hidden]) ~ .tsl-card { display: none; } /* one card before the script runs */
	.tsl .tsl-logos { grid-template-columns: repeat(min(var(--tsl-logos, 3), 3), minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.tsl { --tsl-card-pad: 22px; }
	.tsl .tsl-card-mark { font-size: 22px; }
	.tsl .tsl-author { min-height: 74px; padding-top: 16px; gap: 11px; }
	.tsl .tsl-avatar { width: 42px; height: 42px; }
	.tsl .tsl-name { font-size: 16px; }
	.tsl .tsl-business { font-size: 12px; }
	.tsl .tsl-more { font-size: 14px; }
}

/* ---------- Phone: one card (the mockup's mobile layout) ---------- */
@media (max-width: 620px) {
	.tsl { --tsl-card-h: 420px; --tsl-card-pad: 22px 21px 20px; --tsl-quote-size: 22px; --tsl-quote-lh: 1.43; --tsl-lines: 6; }
	.tsl .tsl-shell { padding: 30px 18px 24px; border-radius: 16px; }
	.tsl .tsl-header { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 24px; }
	.tsl .tsl-eyebrow { font-size: 11px; letter-spacing: .12em; margin-bottom: 18px; }
	.tsl .tsl-title { font-size: 36px; line-height: 1.12; letter-spacing: -.017em; }
	.tsl .tsl-intro { margin-top: 16px; font-size: 15px; }
	.tsl .tsl-badge { justify-self: start; width: 200px; padding: 13px; }
	.tsl .tsl-nav { flex-wrap: wrap; row-gap: 4px; padding-top: 14px; min-height: 0; }
	.tsl .tsl-dot { width: 30px; height: 44px; }
	.tsl .tsl-controls { margin-left: auto; }
	.tsl .tsl-counter { margin-right: 6px; min-width: 50px; }
	.tsl .tsl-clients { margin-top: 16px; padding-top: 20px; }
	.tsl .tsl-clients-label { font-size: 11px; letter-spacing: .11em; margin-bottom: 14px; }
	.tsl .tsl-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tsl .tsl-logo-cell { height: 96px; padding: 14px; }
	.tsl .tsl-logos { --tsl-logo-h: 62px; --tsl-logo-w: 150px; }
	.tsl .tsl-reader { width: calc(100% - 22px); max-height: calc(100dvh - 32px); }
	.tsl .tsl-reader-header { padding: 18px; }
	.tsl .tsl-reader-title { font-size: 20px; }
	.tsl .tsl-reader-body { padding: 18px; }
	.tsl .tsl-reader-body p { font-size: 16px; }
	.tsl .tsl-reader-footer { padding: 16px 18px; }
}
/* More than six reviews on a phone: a row of dots would wrap or shrink below a usable target, so
   the "03 / 11" position indicator and the arrows carry the navigation there (dots stay on
   tablet and desktop). */
@media (max-width: 620px) {
	.tsl.tsl--many .tsl-dots { display: none; }
	.tsl.tsl--many .tsl-controls { margin-left: 0; width: 100%; }
	.tsl.tsl--many .tsl-counter { margin-right: auto; text-align: left; }
}
/* The reference's one-column logo list, on the narrowest phones. */
@media (max-width: 479px) {
	.tsl .tsl-logos { grid-template-columns: minmax(0, 1fr); }
	.tsl .tsl-logo-cell { height: 92px; }
	.tsl .tsl-logos { --tsl-logo-h: 64px; --tsl-logo-w: 190px; }
}
@media (max-width: 379px) {
	.tsl { --tsl-card-h: 432px; --tsl-quote-size: 19px; --tsl-lines: 7; --tsl-card-pad: 20px 18px 18px; }
	.tsl .tsl-shell { padding: 26px 14px 20px; }
	.tsl .tsl-title { font-size: 31px; }
	.tsl .tsl-dot { width: 26px; }
}

/* Moving strip cell widths per breakpoint (about 5 logos in view on desktop, 2 on phones). */
@media (max-width: 1024px) { .tsl.tsl--marquee .tsl-logos { --tsl-cell: 190px; } }
@media (max-width: 620px) { .tsl.tsl--marquee .tsl-logos { --tsl-cell: 160px; } }
@media (max-width: 379px) { .tsl.tsl--marquee .tsl-logos { --tsl-cell: 136px; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.tsl *,
	.tsl *::before,
	.tsl *::after { animation: none !important; transition: none !important; }
}
