/**
 * Storefront — Testimonial Grid widget.
 *
 * Nilai ditranskrip dari `dsgn_testimonialGrid.html`. Reset pakai
 * `.stfr-tg *` (bukan daftar tag+class) — pelajaran standar di plugin
 * ini: selector class+tag lebih spesifik dari 1-class komponen, jadi
 * reset model itu selalu menang terlepas urutan di file.
 */

.stfr-tg {
	--stfr-tg-p: var( --p, #2D5A4D );
	--stfr-tg-a: var( --a, #D4B038 );
	--stfr-tg-a-d: var( --a-d, #A9872B );
	--stfr-tg-n9: var( --n9, #1A1F1D );
	--stfr-tg-n7: var( --n7, #4A5550 );
	--stfr-tg-n5: var( --n5, #8A9490 );
	--stfr-tg-n2: var( --n2, #D8DEDB );
	--stfr-tg-n1: var( --n1, #F4F6F5 );
	--stfr-tg-sage: var( --sage, #EAF0EC );
	--stfr-tg-gap: 22px;
	--stfr-tg-radius: 20px;
	--stfr-tg-pad: 26px;

	font-family: 'Inter Tight', system-ui, sans-serif;
	font-weight: 400;
	color: var( --stfr-tg-n9 );
	line-height: 1.6;
}

.stfr-tg * {
	box-sizing: border-box;
}

.stfr-tg button {
	font: inherit;
	color: inherit;
}

.stfr-tg svg {
	display: inline-block;
	vertical-align: -1px;
}

.stfr-tg__list {
	display: grid;
	grid-template-columns: repeat( var( --stfr-tg-cols, 3 ), minmax( 0, 1fr ) );
	gap: var( --stfr-tg-gap );
	align-items: stretch;
}

.stfr-tg__list.has-open {
	align-items: start;
}

.stfr-tg__list.is-masonry {
	display: flex;
	align-items: flex-start;
}

.stfr-tg__col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var( --stfr-tg-gap );
}

.stfr-tg__card {
	background: #fff;
	border: 1px solid var( --stfr-tg-n2 );
	border-radius: var( --stfr-tg-radius );
	padding: var( --stfr-tg-pad );
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-margin-top: 120px;
	transition: box-shadow .35s, border-color .35s;
}

.stfr-tg__card:hover {
	border-color: rgba( 45, 90, 77, .35 );
	box-shadow: 0 22px 46px -30px rgba( 29, 59, 50, .35 );
}

.stfr-tg__card.is-hl {
	border-color: var( --stfr-tg-p );
	box-shadow: 0 0 0 1px var( --stfr-tg-p ), 0 0 0 6px rgba( 212, 176, 56, .28 );
	animation: stfr-tg-hl 2.4s ease-out;
}

@keyframes stfr-tg-hl {
	0% {
		box-shadow: 0 0 0 1px var( --stfr-tg-p ), 0 0 0 14px rgba( 212, 176, 56, .5 );
	}

	100% {
		box-shadow: 0 0 0 1px var( --stfr-tg-p ), 0 0 0 6px rgba( 212, 176, 56, .28 );
	}
}

.stfr-tg__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 10px;
}

.stfr-tg__stars {
	color: var( --stfr-tg-a );
	letter-spacing: 1px;
	font-size: 16px;
	white-space: nowrap;
	flex: none;
}

.stfr-tg__star.is-empty {
	opacity: .28;
}

.stfr-tg__tag {
	font-size: 12px;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var( --stfr-tg-n5 );
	white-space: nowrap;
}

/* !important pada align-items: ada reset tema/Elementor lain (flexbox
   global reset) yang menimpa align-items di elemen inline-flex kalau
   tidak dikunci di sini — tanpa ini ikon pill (mahkota dkk) jadi tidak
   center vertikal. */
.stfr-tg__pill {
	--stfr-tg-pill-hue: 74, 85, 80;
	display: inline-flex;
	align-items: center !important;
	gap: 8px;
	align-self: flex-start;
	font-size: 13px;
	line-height: 1;
	font-weight: 500;
	white-space: nowrap;
	border-radius: 99px;
	padding: 6px 12px;
	background: rgba( var( --stfr-tg-pill-hue ), .14 );
	color: rgb( var( --stfr-tg-pill-hue ) );
}

.stfr-tg__pill::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.stfr-tg__pill.has-icon::before {
	display: none;
}

.stfr-tg__pill-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	flex: none;
}

.stfr-tg__pill-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Nilai RGB tiap varian — teks (opaque) dan latar (14% opacity) dari hue
   yang sama, supaya teks & background selalu satu keluarga warna. */
.stfr-tg__pill--default {
	--stfr-tg-pill-hue: 74, 85, 80;
}

.stfr-tg__pill--sage {
	--stfr-tg-pill-hue: 45, 90, 77;
}

.stfr-tg__pill--gold {
	--stfr-tg-pill-hue: 169, 135, 43;
}

.stfr-tg__pill--dark {
	--stfr-tg-pill-hue: 29, 59, 50;
}

.stfr-tg__pill--purple {
	--stfr-tg-pill-hue: 109, 74, 175;
}

.stfr-tg__quote {
	quotes: none;
	font-size: 16px;
	color: var( --stfr-tg-n9 );
	flex: 1;
	display: block;
	overflow: hidden;
}

/* `.is-fitted` = JS SUDAH memotong & menyisipkan "…"+tombol sendiri
   (binary search px-akurat, lihat fit() di JS) — line-clamp CSS di sini
   HANYA fallback no-JS/sebelum-JS-sempat-jalan. Kalau line-clamp tetap
   aktif SETELAH kartu ber-`.is-fitted`, dia memotong ULANG hasil JS
   (termasuk tombol "Selengkapnya" di dalamnya) dengan elipsis browser
   sendiri — menghasilkan "..." ganda dan tombol yang separuh
   terpotong/tidak kena klik (persis bug yang dilaporkan di mobile). */
.stfr-tg__quote:not( .is-open ):not( .is-fitted ) {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var( --stfr-tg-lines, 3 );
	line-clamp: var( --stfr-tg-lines, 3 );
}

.stfr-tg__quote.is-anim {
	transition: height .38s cubic-bezier( .22, .8, .24, 1 );
}

/* `!important` di border/background/padding/radius/shadow: ada reset
   tombol dari tema/Elementor yang bisa menimpa elemen `<button>` ini
   dengan spesifisitas lebih tinggi — tanpa dikunci, tombol "Selengkapnya"
   ikut tampil seperti tombol pill tema (latar solid, padding, radius)
   padahal di sini harusnya teks polos bergaris bawah. */
.stfr-tg__more {
	display: inline;
	border: 0 !important;
	background: none !important;
	padding: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var( --stfr-tg-a-d );
	border-bottom: 1px solid transparent;
	transition: border-color .25s, background-color .25s;
}

.stfr-tg__more svg {
	width: 12px;
	height: 12px;
	margin-left: 3px;
	transition: transform .25s;
}

.stfr-tg__more:hover {
	border-bottom-color: currentColor;
}

.stfr-tg__more:hover svg {
	transform: translateX( 3px );
}

.stfr-tg__more.is-less svg {
	transform: rotate( -90deg );
}

.stfr-tg__more.is-less:hover svg {
	transform: rotate( -90deg ) translateX( 3px );
}

.stfr-tg__more:focus-visible {
	outline: 2px solid var( --stfr-tg-p );
	outline-offset: 3px;
	border-radius: 3px;
}

.stfr-tg__who {
	display: flex;
	gap: 12px;
	align-items: center;
	padding-top: 16px;
	border-top: 1px solid var( --stfr-tg-n2 );
}

.stfr-tg__avatar {
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var( --stfr-tg-sage );
	color: var( --stfr-tg-p );
	display: grid;
	place-items: center;
	font-weight: 500;
	font-size: 14px;
}

.stfr-tg__name {
	display: block;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.3;
}

.stfr-tg__role {
	display: block;
	color: var( --stfr-tg-n5 );
	font-size: 13px;
	line-height: 1.35;
}

.stfr-tg__add-cart {
	margin-left: auto;
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	border: 1px solid var( --stfr-tg-p );
	border-radius: 99px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 500;
	color: var( --stfr-tg-p );
	background: transparent;
	text-decoration: none;
	transition: background .15s, color .15s;
}

.stfr-tg__add-cart:hover {
	background: var( --stfr-tg-p );
	color: #fff;
}

.stfr-tg__add-cart-icon {
	width: 15px;
	height: 15px;
	flex: none;
}

/* Mobile: jadi ikon saja, tanpa label (spec perbaikan terbaru) — teks
   tetap ada di markup untuk pembaca layar lewat `aria-label` pada <a>. */
@media ( max-width: 620px ) {
	.stfr-tg__add-cart {
		gap: 0;
		padding: 8px;
		border-radius: 50%;
	}

	.stfr-tg__add-cart span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect( 0 0 0 0 );
		white-space: nowrap;
	}
}

.stfr-tg__foot {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

/* Dua class (`.stfr-tg .stfr-tg__btn`) — BUKAN `!important` — supaya
   spesifisitas lebih tinggi dari reset tema/kit Elementor umum semacam
   `.elementor-kit-xx button{...}` (1 class + 1 tag), tapi TETAP kalah
   dari selector Elementor sendiri untuk kontrol Style tombol ini
   (`{{WRAPPER}} .stfr-tg__btn`, yang menghasilkan 2+ class), jadi
   kontrol warna/border/radius di Tab Style benar-benar bisa menimpa. */
.stfr-tg .stfr-tg__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var( --stfr-tg-p );
	background: transparent;
	color: var( --stfr-tg-p );
	padding: 13px 26px;
	border-radius: 99px;
	font-weight: 500;
	font-size: 15px;
	cursor: pointer;
	transition: .2s;
}

.stfr-tg .stfr-tg__btn:hover {
	background: var( --stfr-tg-p );
	color: #fff;
}

.stfr-tg__btn[hidden] {
	display: none;
}

.stfr-tg__count {
	text-align: center;
	color: var( --stfr-tg-n5 );
	font-size: 13px;
	margin-top: 14px;
}

.stfr-tg__empty {
	text-align: center;
	color: var( --stfr-tg-n7 );
	padding: 48px 16px;
	border: 1px dashed var( --stfr-tg-n2 );
	border-radius: var( --stfr-tg-radius );
	background: rgba( 255, 255, 255, .6 );
}

@media ( prefers-reduced-motion: reduce ) {
	.stfr-tg__quote.is-anim,
	.stfr-tg__card,
	.stfr-tg__more svg {
		transition: none;
	}

	.stfr-tg__card.is-hl {
		animation: none;
	}
}
