/**
 * Range Trust widget styles. The widget inherits the theme's font and
 * exposes custom properties for per-widget colours:
 *   --rt-accent  links, CTAs, focus (default: near-black)
 *   --rt-star    star fill
 *   --rt-columns grid/masonry column count
 * Style presets (.rt-style-*) only swap surface tokens, so every layout
 * works with every style, light or dark.
 */

.rt-widget {
	--rt-accent: #1d2327;
	--rt-star: #f5a623;
	--rt-columns: 3;
	--rt-bg: transparent;
	--rt-card-bg: #ffffff;
	--rt-card-border: transparent;
	--rt-card-shadow: none;
	--rt-card-radius: 8px;
	--rt-text: #1d2327;
	--rt-muted: #646970;
	--rt-line: #e2e2e0;
	font: inherit;
	color: var(--rt-text);
	box-sizing: border-box;
}
.rt-widget *,
.rt-widget *::before,
.rt-widget *::after { box-sizing: inherit; }

/* ---- style presets ------------------------------------------------ */
.rt-style-light { --rt-card-bg: #f7f7f6; }
.rt-style-light-border { --rt-card-bg: #ffffff; --rt-card-border: #e2e2e0; }
.rt-style-shadow { --rt-card-bg: #ffffff; --rt-card-shadow: 0 1px 4px rgba(29, 35, 39, 0.14); }
.rt-style-minimal { --rt-card-bg: transparent; --rt-card-radius: 0; }
.rt-style-minimal .rt-card { border-bottom: 1px solid var(--rt-line); }
.rt-style-soft { --rt-card-bg: #f4f1ec; --rt-card-radius: 14px; }
.rt-style-contrast { --rt-card-bg: #1d2327; --rt-text: #f6f7f7; --rt-muted: #a7aaad; --rt-line: #3c434a; --rt-card-bg: #23292e; --rt-accent: #f6f7f7; }
.rt-style-dark { --rt-text: #f0f0ef; --rt-muted: #a7aaad; --rt-line: #33383d; --rt-card-bg: #23292e; --rt-card-border: #33383d; --rt-accent: #f0f0ef; }
.rt-style-minimal-dark { --rt-text: #f0f0ef; --rt-muted: #a7aaad; --rt-line: #33383d; --rt-card-bg: transparent; --rt-card-radius: 0; --rt-accent: #f0f0ef; }
.rt-style-minimal-dark .rt-card { border-bottom: 1px solid var(--rt-line); }

/* ---- header ------------------------------------------------------- */
.rt-header { margin: 0 0 1.25em; }
.rt-header-title { margin: 0 0 0.35em; font-weight: 600; font-size: 1.15em; }
.rt-header-rating { display: flex; align-items: center; gap: 0.5em; flex-wrap: wrap; }
.rt-header-score { font-size: 1.9em; font-weight: 700; line-height: 1; }
.rt-header-count { color: var(--rt-muted); font-size: 0.9em; }
.rt-summary { margin: 0.75em 0 0; color: var(--rt-muted); font-size: 0.95em; max-width: 60ch; }

/* ---- stars -------------------------------------------------------- */
.rt-stars { display: inline-flex; gap: 1px; line-height: 0; }
.rt-star { position: relative; width: 1em; height: 1em; display: inline-block; }
.rt-star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rt-star-base path { fill: var(--rt-line); }
.rt-star-top { clip-path: inset(0 calc(100% - var(--rt-fill, 100%)) 0 0); }
.rt-star-top path { fill: var(--rt-star); }
.rt-stars-lg .rt-star { width: 1.3em; height: 1.3em; }

/* ---- cards -------------------------------------------------------- */
.rt-card {
	background: var(--rt-card-bg);
	border: 1px solid var(--rt-card-border);
	border-radius: var(--rt-card-radius);
	box-shadow: var(--rt-card-shadow);
	padding: 1em 1.1em;
	display: flex;
	flex-direction: column;
	gap: 0.55em;
}
.rt-card-head { display: flex; align-items: center; gap: 0.65em; }
.rt-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.rt-avatar-initials {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--rt-line); color: var(--rt-text);
	font-size: 0.85em; font-weight: 600;
}
.rt-card-meta { display: flex; flex-direction: column; min-width: 0; }
.rt-card-name { font-weight: 600; }
.rt-card-date { color: var(--rt-muted); font-size: 0.82em; }
.rt-card-platform { margin-left: auto; color: var(--rt-muted); font-size: 0.8em; flex: none; }
.rt-card-title { margin: 0; font-size: 1em; font-weight: 600; }
.rt-card-text { margin: 0; line-height: 1.55; }
.rt-card-reply { border-left: 3px solid var(--rt-line); padding: 0.25em 0 0.25em 0.8em; font-size: 0.92em; }
.rt-card-reply-label { display: block; font-weight: 600; font-size: 0.85em; color: var(--rt-muted); }
.rt-card-reply p { margin: 0.25em 0 0; }
.rt-card-link { font-size: 0.85em; color: var(--rt-accent); text-decoration: underline; align-self: flex-start; }
.rt-empty { color: #646970; font-style: italic; }

/* ---- CTA ---------------------------------------------------------- */
.rt-cta {
	display: inline-block;
	background: var(--rt-accent);
	color: var(--rt-card-bg, #fff);
	border: 0;
	border-radius: 4px;
	padding: 0.55em 1.1em;
	font-weight: 600;
	font-size: 0.95em;
	text-decoration: none;
	cursor: pointer;
}
.rt-style-dark .rt-cta, .rt-style-contrast .rt-cta, .rt-style-minimal-dark .rt-cta { color: #1d2327; }
.rt-cta:hover { opacity: 0.88; color: var(--rt-card-bg, #fff); }

/* ---- slider ------------------------------------------------------- */
.rt-slider { position: relative; display: flex; align-items: stretch; gap: 0.5em; }
.rt-track {
	display: flex; gap: 1em; overflow-x: auto; scroll-snap-type: x mandatory;
	scrollbar-width: none; flex: 1; padding: 2px;
}
.rt-track::-webkit-scrollbar { display: none; }
.rt-slide { flex: 0 0 calc((100% - 2em) / var(--rt-columns)); scroll-snap-align: start; display: flex; }
.rt-slide .rt-card { flex: 1; }
.rt-arrow {
	flex: none; align-self: center; width: 34px; height: 34px; border-radius: 50%;
	border: 1px solid var(--rt-line); background: var(--rt-card-bg); color: var(--rt-text);
	font-size: 18px; line-height: 1; cursor: pointer;
}
.rt-arrow:hover { border-color: var(--rt-accent); }
.rt-dots { display: flex; justify-content: center; gap: 6px; margin-top: 0.75em; }
.rt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rt-line); border: 0; padding: 0; cursor: pointer; }
.rt-dot[aria-selected="true"] { background: var(--rt-accent); }

/* ---- grid / masonry / list ---------------------------------------- */
.rt-grid { display: grid; grid-template-columns: repeat(var(--rt-columns), 1fr); gap: 1em; }
.rt-masonry { columns: var(--rt-columns); column-gap: 1em; }
.rt-masonry .rt-card { break-inside: avoid; margin: 0 0 1em; }
.rt-list { display: flex; flex-direction: column; gap: 1em; max-width: 46em; }

/* ---- badge / button / banner -------------------------------------- */
.rt-badge {
	display: inline-flex; align-items: center; gap: 0.7em;
	background: var(--rt-card-bg); border: 1px solid var(--rt-card-border);
	border-radius: var(--rt-card-radius); box-shadow: var(--rt-card-shadow);
	padding: 0.6em 1em; text-decoration: none; color: var(--rt-text);
}
.rt-badge-score { font-size: 1.7em; font-weight: 700; line-height: 1; }
.rt-badge-body { display: flex; flex-direction: column; gap: 2px; }
.rt-badge-count { color: var(--rt-muted); font-size: 0.82em; }
.rt-button {
	display: inline-flex; align-items: center; gap: 0.55em;
	background: var(--rt-accent); color: #fff; border-radius: 999px;
	padding: 0.55em 1.2em; text-decoration: none; font-weight: 600; font-size: 0.95em;
}
.rt-button .rt-star svg path { fill: rgba(255, 255, 255, 0.35); }
.rt-button:hover { opacity: 0.9; color: #fff; }
.rt-banner {
	display: flex; align-items: center; gap: 1.25em; flex-wrap: wrap;
	background: var(--rt-card-bg); border: 1px solid var(--rt-card-border);
	border-radius: var(--rt-card-radius); box-shadow: var(--rt-card-shadow);
	padding: 1em 1.25em;
}
.rt-banner-rating { display: flex; align-items: center; gap: 0.5em; }
.rt-banner-score { font-size: 1.9em; font-weight: 700; line-height: 1; }
.rt-banner-text { margin: 0; flex: 1; min-width: 12em; }

/* ---- floating bubble ---------------------------------------------- */
.rt-layout-floating { position: fixed; left: 18px; bottom: 18px; z-index: 9990; }
.rt-bubble {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
	background: var(--rt-card-bg); color: var(--rt-text);
	border: 1px solid var(--rt-line); border-radius: 10px;
	box-shadow: 0 2px 10px rgba(29, 35, 39, 0.18);
	padding: 0.6em 0.9em; cursor: pointer;
}
.rt-bubble-score { font-weight: 700; font-size: 1.2em; line-height: 1; }
.rt-bubble-count { color: var(--rt-muted); font-size: 0.78em; }
.rt-panel {
	position: fixed; left: 18px; bottom: 84px; z-index: 9991;
	width: min(360px, calc(100vw - 36px)); max-height: min(70vh, 560px);
	background: var(--rt-card-bg); color: var(--rt-text);
	border: 1px solid var(--rt-line); border-radius: 12px;
	box-shadow: 0 6px 24px rgba(29, 35, 39, 0.22);
	display: flex; flex-direction: column; overflow: hidden;
}
.rt-panel-head { display: flex; align-items: flex-start; padding: 1em 1em 0; }
.rt-panel-head .rt-header { flex: 1; margin-bottom: 0.75em; }
.rt-panel-close, .rt-popup-close {
	background: none; border: 0; color: var(--rt-muted); font-size: 20px;
	line-height: 1; cursor: pointer; padding: 2px 6px;
}
.rt-panel-body { overflow-y: auto; padding: 0 1em 1em; display: flex; flex-direction: column; gap: 0.75em; }

/* ---- popup toasts ------------------------------------------------- */
.rt-layout-popup { position: fixed; left: 18px; bottom: 18px; z-index: 9990; }
.rt-popup {
	position: relative; width: min(340px, calc(100vw - 36px));
	animation: rt-popup-in 0.35s ease;
}
.rt-popup .rt-card { box-shadow: 0 4px 18px rgba(29, 35, 39, 0.2); border: 1px solid var(--rt-line); }
.rt-popup-close { position: absolute; top: 6px; right: 6px; }
@keyframes rt-popup-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- ticker wall -------------------------------------------------- */
.rt-wall { overflow: hidden; }
.rt-wall-track { display: flex; gap: 1em; width: max-content; animation: rt-wall-scroll 40s linear infinite; }
.rt-wall-track .rt-card { width: 300px; flex: none; }
.rt-wall:hover .rt-wall-track { animation-play-state: paused; }
@keyframes rt-wall-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- funnel ------------------------------------------------------- */
.rt-funnel { max-width: 34em; }
.rt-funnel-title { margin: 0 0 0.25em; }
.rt-funnel-intro { color: var(--rt-muted); margin: 0 0 1em; }
.rt-funnel-stars { display: flex; gap: 6px; margin: 0 0 1.25em; }
.rt-funnel-star { background: none; border: 0; padding: 0; cursor: pointer; width: 2.2em; height: 2.2em; }
.rt-funnel-star svg { width: 100%; height: 100%; fill: var(--rt-line); transition: fill 0.15s ease; }
.rt-funnel-star.rt-lit svg { fill: var(--rt-star); }
.rt-funnel-ask { font-weight: 600; }
.rt-funnel-links { display: flex; gap: 0.6em; flex-wrap: wrap; margin: 0.5em 0 1.25em; }
.rt-funnel-form p { margin: 0 0 0.9em; }
.rt-funnel-form label { display: block; font-weight: 600; margin-bottom: 0.25em; }
.rt-funnel-form input[type="text"], .rt-funnel-form input[type="email"], .rt-funnel-form textarea {
	width: 100%; padding: 0.5em 0.65em; border: 1px solid var(--rt-line); border-radius: 4px;
	background: var(--rt-card-bg); color: var(--rt-text); font: inherit;
}
.rt-hp { position: absolute !important; left: -9999px !important; height: 1px; width: 1px; overflow: hidden; }
.rt-funnel-thanks { font-weight: 600; }

/* ---- responsive --------------------------------------------------- */
@media (max-width: 900px) {
	.rt-grid { grid-template-columns: repeat(2, 1fr); }
	.rt-masonry { columns: 2; }
	.rt-slide { flex-basis: calc((100% - 1em) / 2); }
}
@media (max-width: 560px) {
	.rt-grid { grid-template-columns: 1fr; }
	.rt-masonry { columns: 1; }
	.rt-slide { flex-basis: 100%; }
	.rt-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.rt-wall-track { animation: none; }
	.rt-popup { animation: none; }
}
