/* Reviewly — front-end. Scoped under .reviewly to avoid theme clashes. */

.reviewly {
	--rvly-bg: #f4f5f7;
	--rvly-card: #ffffff;
	--rvly-ink: #1f2430;
	--rvly-muted: #8a8f9c;
	--rvly-line: #eceef2;
	--rvly-accent: #2563eb;
	--rvly-accent-soft: #e8f0ff;
	--rvly-star: #f6b01e;
	--rvly-verified: #1d9bf0;
	--rvly-radius: 18px;
	--rvly-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
	--rvly-font: "Inter Tight", sans-serif;

	font-family: var(--rvly-font);
	color: var(--rvly-ink);
	max-width: 720px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}

.reviewly *,
.reviewly *::before,
.reviewly *::after { box-sizing: border-box; }

.reviewly__title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 1rem;
}

/* ---- Toolbar ---- */
.reviewly__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.reviewly__filters {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.reviewly-pill {
	display: inline-flex;
	align-items: center;
	gap: .28rem;
	border: 0;
	cursor: pointer;
	background: var(--rvly-card);
	color: var(--rvly-ink);
	font-size: .85rem;
	font-weight: 600;
	padding: .48rem .85rem;
	border-radius: 999px;
	box-shadow: var(--rvly-shadow);
	transition: background .15s ease, color .15s ease, transform .08s ease;
	line-height: 1;
}
.reviewly-pill:hover { transform: translateY(-1px); }
.reviewly-pill:focus-visible { outline: 2px solid var(--rvly-accent); outline-offset: 2px; }
.reviewly-pill.is-active {
	background: var(--rvly-accent);
	color: #fff;
}
.reviewly-pill--star .reviewly-star { width: 13px; height: 13px; fill: var(--rvly-star); }
.reviewly-pill.is-active .reviewly-star { fill: #fff; }

/* ---- Sort ---- */
.reviewly__sort { position: relative; }
.reviewly-sort-toggle {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: var(--rvly-card);
	border: 0;
	cursor: pointer;
	font-size: .85rem;
	font-weight: 600;
	color: var(--rvly-muted);
	padding: .55rem 1rem;
	border-radius: 999px;
	box-shadow: var(--rvly-shadow);
}
.reviewly-sort-caret { width: 16px; height: 16px; fill: var(--rvly-muted); }
.reviewly-sort-menu {
	position: absolute;
	right: 0;
	top: calc(100% + .4rem);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(16,24,40,.14);
	list-style: none;
	margin: 0;
	padding: .35rem;
	min-width: 200px;
	z-index: 20;
}
.reviewly-sort-menu li {
	padding: .55rem .7rem;
	border-radius: 8px;
	font-size: .85rem;
	cursor: pointer;
	color: var(--rvly-ink);
}
.reviewly-sort-menu li:hover { background: var(--rvly-bg); }
.reviewly-sort-menu li.is-active { color: var(--rvly-accent); font-weight: 700; }

/* ---- Count ---- */
.reviewly__count {
	color: var(--rvly-muted);
	font-size: .82rem;
	margin: 0 0 1rem .15rem;
}
.reviewly__count strong { color: var(--rvly-ink); }

/* ---- List & cards ---- */
.reviewly__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.reviewly-card {
	background: var(--rvly-card);
	border-radius: var(--rvly-radius);
	padding: 1.15rem 1.25rem 1.25rem;
	box-shadow: var(--rvly-shadow);
	animation: rvly-in .35s ease both;
}
.reviewly-card.is-featured {
	box-shadow: 0 0 0 1.5px var(--rvly-accent-soft), var(--rvly-shadow);
}

.reviewly-card__head {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-bottom: .7rem;
}

.reviewly-avatar {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: .95rem;
}

.reviewly-card__name-row {
	display: flex;
	align-items: center;
	gap: .35rem;
}
.reviewly-card__name {
	font-weight: 700;
	font-size: .95rem;
}
.reviewly-verified { width: 16px; height: 16px; flex: none; }

.reviewly-card__meta {
	display: flex;
	align-items: center;
	gap: .55rem;
	margin-top: .15rem;
}
.reviewly-stars { display: inline-flex; gap: 1px; }
.reviewly-stars .reviewly-star { width: 14px; height: 14px; fill: #d9dce3; }
.reviewly-stars .reviewly-star.is-filled { fill: var(--rvly-star); }
.reviewly-card__date { font-size: .72rem; color: var(--rvly-muted); }

.reviewly-card__text {
	margin: 0;
	font-size: .9rem;
	line-height: 1.55;
	color: #3a4150;
	white-space: pre-line;
}

.reviewly-card__reply {
	margin-top: .85rem;
	padding: .75rem .85rem;
	background: var(--rvly-bg);
	border-radius: 12px;
}
.reviewly-card__reply-head {
	display: flex;
	align-items: center;
	gap: .4rem;
	font-size: .74rem;
	font-weight: 700;
	color: var(--rvly-muted);
	text-transform: uppercase;
	letter-spacing: .02em;
	margin-bottom: .35rem;
}
.reviewly-reply-icon { width: 14px; height: 14px; fill: var(--rvly-muted); }
.reviewly-card__reply p {
	margin: 0;
	font-size: .85rem;
	line-height: 1.5;
	color: #4a5160;
}

.reviewly-empty {
	background: var(--rvly-card);
	border-radius: var(--rvly-radius);
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--rvly-muted);
	box-shadow: var(--rvly-shadow);
}

/* ---- Pagination ---- */
.reviewly__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: .35rem;
	margin-top: 1.5rem;
	flex-wrap: wrap;
}
.reviewly-page {
	min-width: 38px;
	height: 38px;
	border: 0;
	background: var(--rvly-card);
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
	font-size: .85rem;
	color: var(--rvly-ink);
	box-shadow: var(--rvly-shadow);
	padding: 0 .6rem;
	transition: background .15s, color .15s;
}
.reviewly-page:hover:not(:disabled) { background: var(--rvly-accent-soft); }
.reviewly-page.is-active { background: var(--rvly-accent); color: #fff; }
.reviewly-page:disabled { opacity: .4; cursor: default; }
.reviewly-page--ellipsis { background: transparent; box-shadow: none; cursor: default; }

/* ---- Loader ---- */
.reviewly__loader { display: flex; justify-content: center; padding: 1.25rem 0; }
.reviewly-spinner {
	width: 26px; height: 26px;
	border: 3px solid var(--rvly-line);
	border-top-color: var(--rvly-accent);
	border-radius: 50%;
	animation: rvly-spin .7s linear infinite;
}
.reviewly__list.is-loading { opacity: .45; transition: opacity .2s; pointer-events: none; }

@keyframes rvly-spin { to { transform: rotate(360deg); } }
@keyframes rvly-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
	.reviewly__toolbar { gap: .6rem; }
	.reviewly-pill { padding: .42rem .7rem; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
	.reviewly-card { animation: none; }
	.reviewly-spinner { animation-duration: 1.4s; }
}
