/**
 * Top Rank Reviews — review display styles (grid/list/slider + rating summary).
 * Neutral, theme-friendly palette; override any of these in your theme's CSS.
 */

.trr-reviews-empty {
	color: #70757a;
	font-style: italic;
}

/* ------------------------------------------------------------------ */
/* Deferred rendering — this block is never above the fold, so skip its */
/* layout/paint cost until the browser is about to scroll it into view. */
/* The full HTML is still present from the very first response (source */
/* view, screen readers and crawlers all see it immediately) — only the */
/* browser's *rendering work* is deferred, not the markup itself. The   */
/* height estimate below avoids a layout jump when it comes into view;  */
/* browsers that don't support content-visibility just ignore this and  */
/* render normally, so it's safe to ship unconditionally. */
/* ------------------------------------------------------------------ */
.trr-reviews {
	content-visibility: auto;
	contain-intrinsic-size: auto 600px;
}

/* ------------------------------------------------------------------ */
/* Layouts                                                             */
/* ------------------------------------------------------------------ */
.trr-reviews--grid {
	display: grid;
	grid-template-columns: repeat(var(--trr-reviews-columns, 3), minmax(0, 1fr));
	gap: 20px;
}

@media (max-width: 900px) {
	.trr-reviews--grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.trr-reviews--grid {
		grid-template-columns: 1fr;
	}
}

.trr-reviews--list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.trr-reviews--list .trr-review-card {
	max-width: 720px;
}

.trr-reviews--slider .trr-reviews__track {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.trr-reviews--slider .trr-reviews__track::-webkit-scrollbar {
	display: none;
}

.trr-reviews--slider .trr-review-card {
	flex: 0 0 280px;
	scroll-snap-align: start;
}

.trr-reviews__nav {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	justify-content: flex-end;
}

.trr-reviews__prev,
.trr-reviews__next {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: 1px solid #ddd;
	background: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.trr-reviews__prev:hover,
.trr-reviews__next:hover {
	background: #f5f5f5;
}

@media (prefers-reduced-motion: reduce) {
	.trr-reviews--slider .trr-reviews__track {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------------ */
/* Review card                                                         */
/* ------------------------------------------------------------------ */
.trr-review-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trr-review-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.trr-review-card__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.trr-review-card__avatar--fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #4285f4;
	color: #fff;
	font-weight: 600;
	text-transform: uppercase;
}

.trr-review-card__who {
	min-width: 0;
}

.trr-review-card__author {
	font-weight: 600;
	font-size: 14px;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.trr-stars {
	color: #fbbc04;
	font-size: 14px;
	letter-spacing: 1px;
}

.trr-review-card__time {
	font-size: 12px;
	color: #70757a;
}

.trr-review-card__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #3c4043;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.trr-review-card__response {
	background: #f8f9fa;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	color: #3c4043;
}

.trr-review-card__response strong {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	color: #5f6368;
}

.trr-review-card__link {
	font-size: 13px;
	color: #1a73e8;
	text-decoration: none;
}

.trr-review-card__link:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Rating summary                                                       */
/* ------------------------------------------------------------------ */
.trr-rating-summary {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin-bottom: 16px;
}

.trr-rating-summary__name {
	font-weight: 700;
	font-size: 18px;
	color: #1a1a1a;
}

.trr-rating-summary__row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.trr-rating-summary__row .trr-stars {
	font-size: 20px;
}

.trr-rating-summary__value {
	font-weight: 600;
	font-size: 16px;
	color: #1a1a1a;
}

.trr-rating-summary__count {
	font-size: 13px;
	color: #70757a;
}

.trr-rating-summary__powered {
	font-size: 12px;
	color: #9aa0a6;
}
