/**
 * Bright Mosaic – Reviews (Aggregated) block styles.
 *
 * Self-contained mirror of the location template's .bmtc-review card look,
 * scoped under bm-reviews so it has no collision/coupling with the location
 * single template. The location page uses a horizontal scroll rail; this block
 * instead lays the harvested reviews out in a responsive grid (column count is
 * set per-block via the --bm-reviews-cols custom property).
 *
 * Genesis Custom Blocks enqueues this file on the front end (when the block is
 * present) and in the editor preview. Uses the same CSS custom properties as
 * the theme (with safe fallbacks) so it inherits the site's color tokens.
 *
 * Units: the parent theme sets html { font-size: 62.5% }, so 1rem = 10px here.
 * The first version of this file assumed a 16px root and rendered at 62.5% of
 * its intended sizes (source line 8.75px, card padding 15px); corrected on
 * 2026-09-12 (MOBILE_REVIEW.md RV-1). The band that holds the block carries
 * the outer padding, so the block itself has none.
 */

.bm-reviews {
	padding: 0;
	margin-block: 0;
	/* background-color: var(--surface-alt, #fafafa); */
}

/* Boxed: constrain + center on full-width pages. */
.bm-reviews--boxed {
	max-width: 1200px;
	margin-inline: auto;
}

.bm-reviews-title {
	font-size: 2.8rem;
	margin: 0 0 0.75rem 0;
	text-align: center;
	color: var(--color-heading, #004e66);
}

.bm-reviews-intro {
	margin: 0 auto 2rem auto;
	max-width: 640px;
	text-align: center;
	color: var(--color-text, #2e2e2e);
	line-height: var(--lh-body, 1.55);
}

/* Responsive grid; column count comes from the block's `columns` field. */
.bm-reviews-grid {
	display: grid;
	grid-template-columns: repeat(var(--bm-reviews-cols, 3), minmax(0, 1fr));
	gap: 2rem;
	align-items: stretch;
}

.bm-reviews-card {
	background: #fff;
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.bm-reviews-stars {
	display: flex;
	gap: 2px;
	color: #f4b400;
}

.bm-reviews-star-icon {
	flex-shrink: 0;
}

.bm-reviews-text {
	/* The parent theme styles every blockquote with a left border, a 30px indent and weight 600; reset here. */
	border: 0;
	padding: 0;
	margin: 0;
	font-size: 1.6rem;
	font-weight: 400;
	font-style: normal;
	line-height: 1.55;
	color: var(--color-text, #2e2e2e);
	display: -webkit-box;
	-webkit-line-clamp: 6;
	line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex-grow: 0;   /* the clamp only holds when the box does not stretch; the author below takes the slack */
}

.bm-reviews-author {
	margin: auto 0 0;   /* pins author and source to the card bottom */
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--color-heading, #004e66);
}

.bm-reviews-source {
	display: block;
	line-height: 1.5;
	color: var(--color-muted, #6b6b6b);
	font-size: 1.3rem;
}

.bm-reviews-source-icon {
	vertical-align: -0.2em;
	margin-right: 0.3rem;
}

.bm-reviews-source-link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: inherit;
	text-decoration: none;
}

.bm-reviews-source-link:hover {
	text-decoration: underline;
}

.bm-reviews-location {
	display: inline;   /* inline-flex wrapped a long location as a block and stranded the separator dot */
}

.bm-reviews-sep {
	color: var(--color-muted, #6b6b6b);
}

.bm-reviews-location-link {
	color: inherit;
	text-decoration: none;
}

.bm-reviews-location-link:hover {
	text-decoration: underline;
}

/* Editor-only empty-state hint. */
.bm-reviews-empty {
	padding: 1.5rem;
	text-align: center;
	color: var(--color-muted, #6b6b6b);
	background-color: var(--surface-alt, #fafafa);
	border: 1px dashed var(--border, #e6e6e6);
	border-radius: 8px;
}

/* Tablet: never more than 2 columns. */
@media (max-width: 900px) {
	.bm-reviews-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Phone: single column, and cap the visible cards at 6 to avoid a long scroll.
   (The home page overrides this with a swipe rail of all cards; see style.css.) */
@media (max-width: 600px) {
	.bm-reviews-grid {
		grid-template-columns: 1fr;
	}

	.bm-reviews-card:nth-child(n + 7) {
		display: none;
	}
}
