/**
 * Reva reviews — property feed, rating badge, homepage channel metrics.
 *
 * NAMESPACE: every class is `cwp-reva-*`. The PMS-synced reviews feature already owns
 * `.cwp-review-card__*`, assets/css/reviews.css and the `reviews` component key —
 * reusing any of it would silently restyle that feature. Do not shorten these names.
 *
 * THEMING: colours come only from the `--cwp-*` design tokens, which DesignTokens
 * scopes to `.cwp-root` (not `:root`). Markup therefore has to sit inside a .cwp-root
 * wrapper — shortcodes get that from wrap_output(). Fallbacks are provided so a stray
 * render outside .cwp-root degrades to something readable rather than transparent.
 */

/* ── Stars (shared by all three surfaces) ─────────────────────────────── */
.cwp-reva-stars {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	color: #f5a623;
	line-height: 1;
}
.cwp-reva-stars svg { width: 15px; height: 15px; display: block; }
.cwp-reva-stars--empty { color: var(--cwp-border, #e2e2e2); }

/* ── Rating badge (property sidebar) ──────────────────────────────────── */
.cwp-reva-badge {
	background: var(--cwp-surface, #fff);
	border: 1px solid var(--cwp-border, #e7e4dc);
	border-radius: 12px;
	padding: 16px 18px;
}
.cwp-reva-badge__top { display: flex; align-items: baseline; gap: 8px; }
.cwp-reva-badge__score {
	font-size: 22px;
	font-weight: 700;
	color: var(--cwp-text, #20242b);
	line-height: 1;
}
.cwp-reva-badge__meta {
	font-size: 13px;
	color: var(--cwp-text-muted, #666e78);
	margin-top: 6px;
}
.cwp-reva-badge__link {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cwp-primary, #0a6ebd);
	text-decoration: none;
}
.cwp-reva-badge__link:hover { text-decoration: underline; }

/* ── Reviews feed ─────────────────────────────────────────────────────── */
.cwp-reva-feed__head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.cwp-reva-feed__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--cwp-text, #20242b);
	margin: 0;
}
.cwp-reva-feed__summary { font-size: 14px; color: var(--cwp-text-muted, #666e78); }

.cwp-reva-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cwp-reva-filter {
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	border: 1px solid var(--cwp-border, #e7e4dc);
	background: var(--cwp-surface, #fff);
	color: var(--cwp-text-muted, #666e78);
	cursor: pointer;
	line-height: 1.4;
}
.cwp-reva-filter:hover { border-color: var(--cwp-primary, #0a6ebd); color: var(--cwp-text, #20242b); }
.cwp-reva-filter.is-active {
	background: var(--cwp-primary, #0a6ebd);
	border-color: var(--cwp-primary, #0a6ebd);
	color: #fff;
}

.cwp-reva-list { display: grid; gap: 12px; }

.cwp-reva-card {
	background: var(--cwp-surface, #fff);
	border: 1px solid var(--cwp-border, #e7e4dc);
	border-radius: 12px;
	padding: 16px 18px;
}
.cwp-reva-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cwp-reva-card__avatar {
	width: 36px; height: 36px; border-radius: 50%;
	background: var(--cwp-primary-light, #e9f3fb);
	color: var(--cwp-primary-dark, #0a6ebd);
	display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700; flex: none; text-transform: uppercase;
}
.cwp-reva-card__who { flex: 1; min-width: 0; }
.cwp-reva-card__name {
	font-size: 14px; font-weight: 600; color: var(--cwp-text, #20242b);
	line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cwp-reva-card__sub { font-size: 12px; color: var(--cwp-text-muted, #8a8f96); margin-top: 2px; }
.cwp-reva-card__title { font-size: 14px; font-weight: 600; color: var(--cwp-text, #20242b); margin: 0 0 4px; }
.cwp-reva-card__body {
	font-size: 14px;
	line-height: 1.6;
	color: var(--cwp-text, #20242b);
	margin: 0 0 10px;
	white-space: pre-line; /* guests write in paragraphs; keep their line breaks */
}
.cwp-reva-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cwp-reva-tag {
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 6px;
	background: var(--cwp-primary-light, #e1f5ee);
	color: var(--cwp-primary-dark, #0f6e56);
}

/* "Host replied" indicator.
   Reva's API exposes host_response as a BOOLEAN — it records that the host replied,
   never the reply text. So this is a marker, not a quote. There is no response body
   to style because there is no response body in the data. */
.cwp-reva-card__replied {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--cwp-text-muted, #666e78);
}
.cwp-reva-card__replied svg { width: 14px; height: 14px; flex: none; }

.cwp-reva-more { text-align: center; margin-top: 14px; }
.cwp-reva-more__btn {
	background: none;
	border: 1px solid var(--cwp-border, #e7e4dc);
	border-radius: 10px;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cwp-text, #20242b);
	cursor: pointer;
}
.cwp-reva-more__btn:hover { border-color: var(--cwp-primary, #0a6ebd); }

.cwp-reva-empty {
	font-size: 13px;
	color: var(--cwp-text-muted, #8a8f96);
	padding: 14px 0;
	text-align: center;
}

/* ── Homepage channel metrics ─────────────────────────────────────────── */
.cwp-reva-metrics__overall { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cwp-reva-metrics__score {
	font-size: 28px; font-weight: 700; line-height: 1;
	color: var(--cwp-text, #20242b);
}
.cwp-reva-metrics__caption { font-size: 13px; color: var(--cwp-text-muted, #666e78); }
.cwp-reva-metrics__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
	gap: 12px;
}
.cwp-reva-metric {
	background: var(--cwp-surface, #fff);
	border: 1px solid var(--cwp-border, #e7e4dc);
	border-radius: 10px;
	padding: 14px;
}
.cwp-reva-metric__channel { font-size: 13px; color: var(--cwp-text-muted, #666e78); margin-bottom: 4px; }
.cwp-reva-metric__score { font-size: 20px; font-weight: 700; color: var(--cwp-text, #20242b); line-height: 1; }
.cwp-reva-metric__count { font-size: 12px; color: var(--cwp-text-muted, #8a8f96); margin-top: 3px; }

@media (max-width: 600px) {
	.cwp-reva-feed__title { font-size: 18px; }
	.cwp-reva-card { padding: 14px; }
	.cwp-reva-metrics__score { font-size: 24px; }
}
