/* ==========================================================================
   Review shortcodes: [stbhh_rating] and [stbhh_reviews]

   Where the site's Elementor kit styles links and buttons, these rules win by
   specificity (a leading `body`), never by forcing priority.
   ========================================================================== */

/* Design tokens. :where() keeps this block at zero specificity. The shared colours and the heading font
   follow the Design page's Global style; the colours of each part have their own setting there too
   (the second value of each var() is the plugin's own value). Nothing here reads Elementor. */
:where(.stbhh-rate, .stbhh-rev-top, .stbhh-rev-grid, .stbhh-rev-more-wrap) {
	--stbhh-font: var(--stbhh-set-font-head, 'Space Grotesk', sans-serif);
	--stbhh-ink: var(--stbhh-set-ink, #40415E);
	--stbhh-text: var(--stbhh-set-ink70, #6A6B84);
	--stbhh-faint: var(--stbhh-set-ink45, #9A9BAD);
	--stbhh-brand: #6C8AE4;
	--stbhh-verified: #2FA97E;
	--stbhh-border: #E4E7F0;
	--stbhh-muted: var(--stbhh-set-ink70, #6A6B84);
	--stbhh-accent: #2FA97E;
	--stbhh-accent-soft: #CDF3E4;
	--stbhh-star-on: var(--stbhh-set-rv-star-on, #F5B301);
	--stbhh-star-off: var(--stbhh-set-rv-star-off, #E4E7F0);
	--stbhh-track: var(--stbhh-set-rv-track, #EEF0F7);
}

/* Stars (shared): grey base stars, with a gold copy clipped to --pct on top. */
.stbhh-stars {
	--pct: 0%;
	position: relative;
	display: inline-flex;
	line-height: 0;
}

.stbhh-s-base,
.stbhh-s-fill {
	display: flex;
}

.stbhh-stars svg {
	display: block;
	flex-shrink: 0;
	width: var(--stbhh-set-rv-star-sm, 16px);
	height: var(--stbhh-set-rv-star-sm, 16px);
	fill: var(--stbhh-star-off);
}

.stbhh-stars--lg svg {
	width: var(--stbhh-set-rv-star-lg, 18px);
	height: var(--stbhh-set-rv-star-lg, 18px);
}

.stbhh-s-fill {
	position: absolute;
	inset: 0;
	width: var(--pct);
	overflow: hidden;
}

/* Visually hidden text for screen readers (the rating bars). */
.stbhh-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.stbhh-s-fill svg {
	fill: var(--stbhh-star-on);
}

/* [stbhh_rating] */
.stbhh-rate {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--stbhh-muted);
}

.stbhh-rate b {
	font-family: var(--stbhh-set-rv-score-font, var(--stbhh-font));
	font-weight: var(--stbhh-set-rv-score-weight, 700);
	color: var(--stbhh-set-rv-score-color, var(--stbhh-ink));
}

.stbhh-rate-empty {
	color: var(--stbhh-set-rv-empty, var(--stbhh-faint));
}

/* The leading `body` outranks the Elementor kit's `.elementor-kit-N a` rules. */
body .stbhh-rate a {
	color: var(--stbhh-set-rv-link-color, var(--stbhh-accent));
	font-weight: var(--stbhh-set-rv-link-weight, 600);
	text-decoration: underline;
	text-decoration-color: var(--stbhh-set-rv-link-line, var(--stbhh-accent-soft));
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

body .stbhh-rate a:hover,
body .stbhh-rate a:focus,
body .stbhh-rate a:focus-visible {
	color: var(--stbhh-set-rv-link-color, var(--stbhh-accent));
	text-decoration-color: var(--stbhh-set-rv-link-color, var(--stbhh-accent));
}

/* [stbhh_reviews]: the score box and the review cards, each with its own colours and corners. */
.stbhh-rev-top {
	background: var(--stbhh-set-rv-top-bg, #fff);
	border: 1px solid var(--stbhh-set-rv-top-border, var(--stbhh-border));
	border-radius: var(--stbhh-set-rv-top-radius, 24px);
}

.stbhh-rev {
	background: var(--stbhh-set-rv-card-bg, #fff);
	border: 1px solid var(--stbhh-set-rv-card-border, var(--stbhh-border));
	border-radius: var(--stbhh-set-rv-card-radius, 24px);
}

.stbhh-rev-top {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 50px;
	max-width: 530px;
	margin: 0 auto 32px;
	padding: 26px;
}

.stbhh-rev-score {
	text-align: center;
}

.stbhh-big {
	font: var(--stbhh-set-rv-big-weight, 700) var(--stbhh-set-rv-big-size, 46px)/1 var(--stbhh-set-rv-big-font, var(--stbhh-font));
	color: var(--stbhh-set-rv-big-color, var(--stbhh-ink));
}

.stbhh-rev-score small {
	display: block;
	font-size: var(--stbhh-set-rv-caption-size, 13px);
	color: var(--stbhh-set-rv-caption-color, var(--stbhh-faint));
}

/* Rating bars */
.stbhh-bars {
	display: grid;
	gap: 6px;
}

.stbhh-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--stbhh-text);
}

.stbhh-bar-star {
	flex-shrink: 0;
	width: var(--stbhh-set-rv-bar-star, 14px);
	height: var(--stbhh-set-rv-bar-star, 14px);
	fill: var(--stbhh-star-on);
}

.stbhh-bar-count {
	flex-shrink: 0;
	width: 6px;
	font-size: var(--stbhh-set-rv-bar-count-size, 13px);
	font-weight: var(--stbhh-set-rv-bar-count-weight, 600);
	color: var(--stbhh-set-rv-bar-count-color, var(--stbhh-text));
}

.stbhh-track {
	flex: 1;
	height: var(--stbhh-set-rv-track-h, 7px);
	border-radius: 4px;
	background: var(--stbhh-track);
	overflow: hidden;
}

.stbhh-fill {
	width: var(--pct, 0%);
	height: 100%;
	border-radius: 4px;
	background: var(--stbhh-set-rv-fill, var(--stbhh-brand));
}

/* Review cards */
.stbhh-rev-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.stbhh-rev {
	padding: 22px;
}

.stbhh-rev p {
	margin: 10px 0 14px;
	font-size: var(--stbhh-set-rv-text-size, 15px);
	color: var(--stbhh-set-rv-text-color, var(--stbhh-ink));
}

.stbhh-who {
	display: flex;
	align-items: center;
	gap: 10px;
}

.stbhh-av {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: var(--stbhh-set-rv-av-size, 32px);
	height: var(--stbhh-set-rv-av-size, 32px);
	border-radius: 50%;
	background: var(--stbhh-set-rv-av-1, #6C8AE4);
	font: var(--stbhh-set-rv-av-text-weight, 700) var(--stbhh-set-rv-av-text-size, 15px) var(--stbhh-set-rv-av-text-font, var(--stbhh-font));
	color: var(--stbhh-set-rv-av-text-color, var(--stbhh-set-on-cta, #fff));
}

/* The six avatar colours, set on the Review Colours page (the variables are added to this
   stylesheet by PHP); the second value of each var() is used when they are missing. */
.stbhh-av-c1 { background: var(--stbhh-set-rv-av-1, #6C8AE4); }
.stbhh-av-c2 { background: var(--stbhh-set-rv-av-2, #FF8B79); }
.stbhh-av-c3 { background: var(--stbhh-set-rv-av-3, #8A6DE3); }
.stbhh-av-c4 { background: var(--stbhh-set-rv-av-4, #2FA97E); }
.stbhh-av-c5 { background: var(--stbhh-set-rv-av-5, #D65C8A); }
.stbhh-av-c6 { background: var(--stbhh-set-rv-av-6, #506FCB); }

/* Fill levels in 5% steps: the stars and the rating bars take their width from --pct, so no inline style is needed. */
.stbhh-p-0 { --pct: 0%; }
.stbhh-p-5 { --pct: 5%; }
.stbhh-p-10 { --pct: 10%; }
.stbhh-p-15 { --pct: 15%; }
.stbhh-p-20 { --pct: 20%; }
.stbhh-p-25 { --pct: 25%; }
.stbhh-p-30 { --pct: 30%; }
.stbhh-p-35 { --pct: 35%; }
.stbhh-p-40 { --pct: 40%; }
.stbhh-p-45 { --pct: 45%; }
.stbhh-p-50 { --pct: 50%; }
.stbhh-p-55 { --pct: 55%; }
.stbhh-p-60 { --pct: 60%; }
.stbhh-p-65 { --pct: 65%; }
.stbhh-p-70 { --pct: 70%; }
.stbhh-p-75 { --pct: 75%; }
.stbhh-p-80 { --pct: 80%; }
.stbhh-p-85 { --pct: 85%; }
.stbhh-p-90 { --pct: 90%; }
.stbhh-p-95 { --pct: 95%; }
.stbhh-p-100 { --pct: 100%; }

.stbhh-nm {
	font-size: var(--stbhh-set-rv-name-size, 13px);
	font-weight: var(--stbhh-set-rv-name-weight, 600);
}

.stbhh-vf {
	font-size: var(--stbhh-set-rv-verified-size, 12px);
	font-weight: var(--stbhh-set-rv-verified-weight, 600);
	color: var(--stbhh-set-rv-verified-color, var(--stbhh-verified));
}

/* "Show more reviews" (mobile). Reviews past the visible count carry
   .stbhh-is-more (set in PHP, then by reviews-more.js); they are hidden on
   mobile only, so tablet and desktop always show every review. */
.stbhh-rev-more-wrap {
	display: none;
	margin-top: 16px;
	text-align: center;
}

/* Focus is moved to the first newly revealed review (keyboard / screen-reader
   users). It is not an interactive card, so it gets no focus ring. */
body .stbhh-rev-grid .stbhh-rev[tabindex="-1"]:focus,
body .stbhh-rev-grid .stbhh-rev[tabindex="-1"]:focus-visible {
	outline: none;
	box-shadow: none;
}

/* The button is a real <button>, so the Elementor kit styles it (background,
   padding, border, font, transform...). Starting from all:unset on a selector
   that outranks the kit's button rules, in every state, rebuilds it as a plain
   link-style control. */
body .stbhh-rev-more-wrap button.stbhh-rev-more[type="button"] {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 12px 8px;
	border-radius: 6px;
	font: var(--stbhh-set-rv-more-weight, 600) var(--stbhh-set-rv-more-size, 14px)/1.2 var(--stbhh-set-rv-more-font, var(--stbhh-font));
	color: var(--stbhh-set-rv-more-color, var(--stbhh-brand));
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 4px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: text-decoration-color .14s;
}

body .stbhh-rev-more-wrap button.stbhh-rev-more[type="button"]:hover {
	text-decoration-color: currentColor;
}

body .stbhh-rev-more-wrap button.stbhh-rev-more[type="button"]:focus-visible {
	outline: 2px solid var(--stbhh-brand);
	outline-offset: 2px;
}

.stbhh-rev-more svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	transition: transform .14s;
}

.stbhh-rev-more:hover svg {
	transform: translateY(2px);
}

@media (prefers-reduced-motion: reduce) {
	.stbhh-rev-more svg {
		transition: none;
	}

	.stbhh-rev-more:hover svg {
		transform: none;
	}
}

/* Responsive */
@media (max-width: 900px) {
	.stbhh-rev-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 767px) {
	.stbhh-rev-top {
		grid-template-columns: 1fr;
		gap: 24px;
		text-align: center;
	}
}

@media (max-width: 600px) {
	.stbhh-rev-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.stbhh-rev-grid .stbhh-rev.stbhh-is-more {
		display: none;
	}

	.stbhh-rev-more-wrap {
		display: block;
	}

	.stbhh-rev-more-wrap[hidden] {
		display: none;
	}
}
