/**
 * ReviewBeam front-end widget styles.
 * Namespaced entirely under .rvb-widget to avoid leaking into the host theme.
 */

.rvb-widget {
	--rvb-bg: #ffffff;
	--rvb-fg: #1a1a1a;
	--rvb-muted: #6b7280;
	--rvb-border: #e5e7eb;
	--rvb-accent: #16a34a;
	--rvb-star: #fbbf24;
	--rvb-star-empty: #d1d5db;
	--rvb-radius: 10px;

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--rvb-fg);
	max-width: 100%;
}

.rvb-widget.rvb-theme-dark {
	--rvb-bg: #111827;
	--rvb-fg: #f9fafb;
	--rvb-muted: #9ca3af;
	--rvb-border: #1f2937;
	--rvb-accent: #22c55e;
}

.rvb-widget * {
	box-sizing: border-box;
}

/* ---------- Summary header ---------- */

.rvb-summary-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.rvb-summary-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rvb-summary-title {
	font-weight: 700;
	font-size: 16px;
}

.rvb-summary-base {
	font-size: 13px;
	color: var(--rvb-muted);
}

.rvb-summary-stars {
	flex-shrink: 0;
}

.rvb-google-mark {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	vertical-align: -2px;
}

.rvb-g-icon {
	width: 14px;
	height: 14px;
}

/* ---------- Stars ---------- */

.rvb-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	line-height: 1;
	white-space: nowrap;
}

.rvb-star svg {
	width: 1em;
	height: 1em;
	display: block;
}

.rvb-mode-slider .rvb-stars,
.rvb-mode-grid .rvb-stars,
.rvb-mode-list .rvb-stars {
	font-size: 18px;
}

.rvb-card .rvb-stars {
	font-size: 15px;
}

.rvb-star--full {
	color: var(--rvb-star);
}

.rvb-star--half {
	color: var(--rvb-star);
}

.rvb-star--empty {
	color: var(--rvb-star-empty);
}

/* Unicode fallback glyphs pick up currentColor automatically. */

/* ---------- Track / nav (slider, grid, list, sidebar) ---------- */

.rvb-track-wrap {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.rvb-track {
	display: flex;
	gap: 14px;
	overflow: hidden;
	scroll-behavior: smooth;
	flex: 1 1 auto;
}

.rvb-track--slider {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.rvb-track--slider::-webkit-scrollbar {
	display: none;
}

.rvb-track--slider .rvb-card {
	scroll-snap-align: start;
	flex: 0 0 280px;
}

.rvb-track--grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	overflow: visible;
	width: 100%;
}

.rvb-track--list {
	flex-direction: column;
	overflow: visible;
}

.rvb-track--list .rvb-card {
	flex: 1 1 auto;
}

.rvb-track--sidebar {
	flex: 1 1 auto;
	overflow: hidden;
}

.rvb-track--sidebar .rvb-card {
	flex: 0 0 100%;
}

.rvb-nav {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--rvb-border);
	background: var(--rvb-bg);
	color: var(--rvb-fg);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	align-self: center;
}

.rvb-nav:hover {
	background: var(--rvb-border);
}

.rvb-sidebar-nav {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 10px;
}

/* ---------- Review card ---------- */

.rvb-card {
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	border-radius: var(--rvb-radius);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.rvb-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
}

.rvb-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.rvb-avatar--initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rvb-accent);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
}

.rvb-card-author {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.rvb-author-name {
	font-weight: 600;
	font-size: 14px;
	color: var(--rvb-fg);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rvb-author-name:hover {
	text-decoration: underline;
}

.rvb-card-time {
	font-size: 12px;
	color: var(--rvb-muted);
}

.rvb-card-google {
	flex-shrink: 0;
}

.rvb-card-google .rvb-g-icon {
	width: 18px;
	height: 18px;
}

.rvb-card-text-wrap {
	position: relative;
}

.rvb-card-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rvb-fg);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rvb-card-text-wrap.rvb-expanded .rvb-card-text {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.rvb-read-more {
	background: none;
	border: none;
	padding: 4px 0 0;
	color: var(--rvb-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Buttons (chip) layout: 3 selectable styles ---------- */

.rvb-mode-buttons .rvb-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.rvb-chip-label {
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.03em;
}

.rvb-chip-count {
	color: var(--rvb-muted);
	white-space: nowrap;
}

/* Style 1: pill chip — bordered pill, label + stars + count side by side. */
.rvb-chip--pill {
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	border-radius: 999px;
	padding: 8px 16px;
}

/* Style 2: badge — a squared card with a large rating number stacked
   over the stars and count; reads well as a standalone trust badge. */
.rvb-chip--badge {
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	border-radius: 10px;
	padding: 12px 16px;
	gap: 12px;
}

.rvb-chip-rating {
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
}

.rvb-chip-badge-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.rvb-chip-badge-meta .rvb-chip-count {
	font-size: 12.5px;
}

/* Style 3: minimal — no background or border, just stars + text, for
   dropping inline into a nav bar, footer line, or next to a heading. */
.rvb-chip--minimal {
	background: transparent;
	border: none;
	padding: 0;
}

.rvb-chip--minimal .rvb-chip-count {
	font-weight: 600;
	color: var(--rvb-fg);
}

/* ---------- Badge layout ---------- */

.rvb-mode-badge .rvb-badge-card {
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	border-radius: var(--rvb-radius);
	padding: 16px 18px;
	max-width: 280px;
}

.rvb-mode-badge .rvb-summary-header {
	margin-bottom: 6px;
}

/* ---------- Attribution ---------- */

.rvb-attribution {
	margin-top: 10px;
	font-size: 11px;
	color: var(--rvb-muted);
	text-align: right;
}

.rvb-attribution a {
	color: inherit;
	text-decoration: none;
}

.rvb-attribution a:hover {
	text-decoration: underline;
}

.rvb-empty {
	color: var(--rvb-muted);
	font-size: 14px;
}

/* ---------- Sidebar (floating dock) ---------- */

.rvb-mode-sidebar.rvb-sidebar-floating {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99999;
	display: flex;
	align-items: center;
}

.rvb-mode-sidebar.rvb-sidebar-right {
	right: 0;
	flex-direction: row-reverse;
}

.rvb-mode-sidebar.rvb-sidebar-left {
	left: 0;
}

.rvb-sidebar-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	padding: 12px 8px;
	cursor: pointer;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	font-size: 12px;
	font-weight: 600;
	color: var(--rvb-fg);
}

.rvb-sidebar-right .rvb-sidebar-tab {
	border-radius: 8px 0 0 8px;
	border-right: none;
}

.rvb-sidebar-left .rvb-sidebar-tab {
	border-radius: 0 8px 8px 0;
	border-left: none;
	writing-mode: vertical-lr;
}

.rvb-sidebar-panel {
	width: 300px;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--rvb-bg);
	border: 1px solid var(--rvb-border);
	border-radius: var(--rvb-radius);
	padding: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	display: none;
}

.rvb-mode-sidebar:not(.rvb-sidebar-floating) .rvb-sidebar-panel {
	display: block;
	width: 100%;
	box-shadow: none;
}

.rvb-mode-sidebar.rvb-sidebar-floating.rvb-open .rvb-sidebar-panel {
	display: block;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.rvb-track--slider .rvb-card {
		flex: 0 0 240px;
	}

	.rvb-sidebar-panel {
		width: 86vw;
	}
}
