/* Allhart Reviews — front end.
   Deliberately low-specificity and theme-neutral: colours come from CSS
   variables so each site can restyle without touching the plugin. */

.allhart-reviews {
	--allhart-star-color: #ffc107;
	--allhart-border: #e5e7eb;
	--allhart-muted: #6b7280;
	margin: 2.5rem 0;
}

.allhart-reviews-heading {
	margin: 0 0 1rem;
}

/* Stars ------------------------------------------------------------------ */
.allhart-stars {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	line-height: 1;
	font-size: var(--allhart-star-size, 16px);
	vertical-align: middle;
}
.allhart-stars-empty {
	color: rgba(0, 0, 0, 0.18);
	letter-spacing: 1px;
}
.allhart-stars-full {
	position: absolute;
	inset: 0;
	overflow: hidden;
	color: var(--allhart-star-color, #ffc107);
	letter-spacing: 1px;
}
.allhart-stars-inline {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}
.allhart-align-center { justify-content: center; width: 100%; }
.allhart-align-right { justify-content: flex-end; width: 100%; }
.allhart-stars-text { font-weight: 600; font-size: 0.9em; }

.allhart-loop-stars {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0.25rem 0;
	font-size: 0.85em;
}
.allhart-loop-count { color: var(--allhart-muted, #6b7280); }

.allhart-summary-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.25rem 0 0.75rem;
	text-decoration: none;
	font-size: 0.9rem;
	color: inherit;
}
.allhart-summary-link:hover .allhart-summary-count { text-decoration: underline; }

/* Summary ---------------------------------------------------------------- */
.allhart-reviews-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	align-items: center;
	padding: 1.25rem;
	border: 1px solid var(--allhart-border, #e5e7eb);
	border-radius: 10px;
	margin-bottom: 1.25rem;
}
.allhart-summary-score { display: flex; flex-direction: column; gap: 0.35rem; }
.allhart-summary-average { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.allhart-summary-total { color: var(--allhart-muted, #6b7280); font-size: 0.85rem; }

.allhart-histogram { list-style: none; margin: 0; padding: 0; flex: 1 1 240px; min-width: 220px; }
.allhart-histogram li { margin: 0 0 0.25rem; }
.allhart-filter-star {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	background: none;
	border: 0;
	padding: 0.15rem 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: left;
}
.allhart-filter-star[aria-pressed="true"] { font-weight: 700; }
.allhart-histogram-label { width: 2.5em; font-size: 0.85rem; }
.allhart-histogram-bar {
	flex: 1;
	height: 8px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.08);
	overflow: hidden;
}
.allhart-histogram-bar > span {
	display: block;
	height: 100%;
	background: var(--allhart-star-color, #ffc107);
}
.allhart-histogram-count {
	min-width: 3.25em;
	flex: 0 0 auto;
	white-space: nowrap;
	text-align: right;
	font-size: 0.85rem;
	color: var(--allhart-muted, #6b7280);
}

/* Theme-armour: many of the fleet themes apply a global box-shadow / border /
   background to every <button>, which bleeds through the histogram rows and
   draws a black outline across each rating filter on mobile. These controls are
   plain text rows, never buttons — strip the theme chrome inside our block only. */
.allhart-reviews .allhart-histogram,
.allhart-reviews .allhart-histogram li,
.allhart-reviews .allhart-filter-star,
.allhart-reviews .allhart-filter-star:hover,
.allhart-reviews .allhart-filter-star:focus,
.allhart-reviews .allhart-filter-star:active,
.allhart-reviews .allhart-filter-star[aria-pressed="true"] {
	box-shadow: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	background-image: none !important;
	background-color: transparent !important;
	transform: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-height: 0 !important;
	line-height: 1.4 !important;
	outline: none !important;
}
.allhart-reviews .allhart-filter-star:focus-visible {
	outline: 2px solid var(--allhart-star-color, #ffc107) !important;
	outline-offset: 2px;
}
.allhart-reviews .allhart-filter-star::before,
.allhart-reviews .allhart-filter-star::after { content: none !important; }
.allhart-reviews .allhart-histogram-label {
	flex: 0 0 auto;
	min-width: 2.75em;
	white-space: nowrap;
}
.allhart-reviews .allhart-histogram-bar { flex: 1 1 auto; min-width: 40px; }

@media (max-width: 420px) {
	.allhart-reviews .allhart-filter-star { gap: 0.4rem; }
	.allhart-reviews .allhart-histogram-label { min-width: 2.6em; font-size: 0.8rem; }
	.allhart-reviews .allhart-histogram-count { min-width: 3em; font-size: 0.8rem; }
}

/* Photo strip ------------------------------------------------------------ */
.allhart-photo-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.allhart-photo-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }

/* Toolbar ---------------------------------------------------------------- */
.allhart-reviews-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1rem;
}
.allhart-photos-toggle { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }

/* Review cards ----------------------------------------------------------- */
.allhart-reviews-list { display: flex; flex-direction: column; gap: 1rem; }
.allhart-review {
	border: 1px solid var(--allhart-border, #e5e7eb);
	border-radius: 10px;
	padding: 1rem 1.1rem;
	background: #fff;
}
.allhart-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.allhart-review-title { margin: 0; font-size: 1rem; }
.allhart-review-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0.35rem 0 0.6rem;
	font-size: 0.82rem;
	color: var(--allhart-muted, #6b7280);
}
.allhart-review-author { font-weight: 600; color: inherit; }
.allhart-badge {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-size: 0.72rem;
	background: rgba(16, 122, 66, 0.1);
	color: #0b6b3a;
}
.allhart-badge-incentivised { background: rgba(0, 0, 0, 0.06); color: #444; }
.allhart-review-product { font-size: 0.82rem; margin-bottom: 0.4rem; }
.allhart-review-body p { margin: 0 0 0.6rem; }
.allhart-review-photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.allhart-review-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.allhart-review-reply {
	margin-top: 0.75rem;
	padding: 0.7rem 0.9rem;
	border-left: 3px solid var(--allhart-star-color, #ffc107);
	background: rgba(0, 0, 0, 0.03);
	border-radius: 0 8px 8px 0;
}
.allhart-review-reply-head { font-weight: 600; font-size: 0.82rem; display: block; margin-bottom: 0.3rem; }
.allhart-review-reply-date { font-weight: 400; color: var(--allhart-muted, #6b7280); margin-left: 0.35rem; }

.allhart-reviews-more { text-align: center; margin-top: 1rem; }
.allhart-load-more { cursor: pointer; }

/* Grid ------------------------------------------------------------------- */
.allhart-reviews-grid { display: grid; gap: 1rem; margin: 1rem 0; }
.allhart-cols-1 { grid-template-columns: 1fr; }
.allhart-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.allhart-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.allhart-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
	.allhart-cols-3, .allhart-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.allhart-reviews-grid { grid-template-columns: 1fr; }
	.allhart-reviews-summary { gap: 1rem; }
}
.allhart-pagination { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.allhart-pagination a {
	padding: 0.35rem 0.6rem;
	border: 1px solid var(--allhart-border, #e5e7eb);
	border-radius: 6px;
	text-decoration: none;
}
.allhart-pagination a.current { background: #111; color: #fff; border-color: #111; }

/* Category summary ------------------------------------------------------- */
.allhart-cat-summary {
	border: 1px solid var(--allhart-border, #e5e7eb);
	border-radius: 10px;
	padding: 1.1rem 1.25rem;
	margin: 1.5rem 0;
}
.allhart-cat-summary-score { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.9rem; }
.allhart-cat-summary-quotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.allhart-cat-summary-quotes blockquote { margin: 0.25rem 0; font-size: 0.92rem; }
.allhart-cat-summary-quotes cite { font-style: normal; font-size: 0.8rem; color: var(--allhart-muted, #6b7280); }
.allhart-cat-summary-quotes cite a { margin-left: 0.35rem; }

/* Form ------------------------------------------------------------------- */
.allhart-write { margin-top: 1.75rem; text-align: center; }
.allhart-write-toggle {
	background: var(--allhart-star-color, #ffc107);
	border: 0;
	border-radius: 999px;
	padding: 0.6rem 1.2rem;
	font-weight: 700;
	color: #111;
	cursor: pointer;
}
.allhart-write-panel {
	max-width: 720px;
	margin: 1rem auto 0;
	text-align: left;
	border: 1px solid var(--allhart-border, #e5e7eb);
	border-radius: 10px;
	padding: 1.1rem 1.25rem;
}
.allhart-field { margin: 0 0 0.9rem; display: block; }
.allhart-field label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
.allhart-field input[type="text"],
.allhart-field input[type="email"],
.allhart-field textarea { width: 100%; }
.allhart-field-note { display: block; font-weight: 400; font-size: 0.78rem; color: var(--allhart-muted, #6b7280); margin-top: 0.2rem; }
.allhart-required { color: #b32d2e; }
.allhart-field-rating { border: 0; padding: 0; margin: 0 0 0.9rem; }
.allhart-field-rating legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.allhart-rating-input { display: inline-flex; flex-direction: row-reverse; gap: 0.2rem; }
.allhart-rating-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.allhart-rating-input label { font-size: 1.75rem; line-height: 1; color: rgba(0, 0, 0, 0.2); cursor: pointer; margin: 0; }
.allhart-rating-input input:checked ~ label,
.allhart-rating-input label:hover,
.allhart-rating-input label:hover ~ label { color: var(--allhart-star-color, #ffc107); }
.allhart-rating-input input:focus-visible + label { outline: 2px solid currentColor; outline-offset: 2px; }
.allhart-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }
.allhart-form-verified { font-size: 0.85rem; color: #0b6b3a; margin: 0 0 0.75rem; }
.allhart-disclosure, .allhart-policy { font-size: 0.78rem; color: var(--allhart-muted, #6b7280); }
.allhart-reviews-empty { color: var(--allhart-muted, #6b7280); }
.allhart-reviews-form-locked { font-size: 0.9rem; color: var(--allhart-muted, #6b7280); margin-top: 1rem; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
