/*
 * Reviews block (esclub-reviews). escape. design system: dark only, Ubuntu,
 * one red accent, gold stars as a rating badge, card radius 16px, button 6px.
 * Tokens come from the page (--surface, --border…); fallbacks keep the block
 * right on pages without them. Clamp and arrows switch on only with JS
 * (.esc-rv--js); without it the text is full and the strip still scrolls.
 */

.esc-rv {
	--rv-surface: var(--surface, #242424);
	--rv-inset: var(--surface-2, #2b2b2b);
	--rv-border: var(--border, rgba(255, 255, 255, .08));
	--rv-border-hover: var(--border-strong, rgba(255, 255, 255, .16));
	--rv-head: #f2f2f2;
	--rv-body: var(--muted, #b3b3b3);
	--rv-caption: #7d7d7d;
	--rv-red-text: #ff6b6d;
	--rv-gold: #ffc93c;
	--rv-gap: 20px;
	position: relative;
	color: var(--rv-body);
	font-family: 'Ubuntu', Arial, sans-serif;
}

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

.esc-rv [hidden] {
	display: none !important;
}

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

.esc-rv .esc-rv-sum {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 24px;
	margin: 0 0 24px;
}

.esc-rv .esc-rv-total {
	display: flex;
	align-items: center;
	gap: 12px;
}

.esc-rv .esc-rv-score {
	color: #fff;
	font-size: clamp(40px, 5vw, 52px);
	font-weight: 700;
	line-height: 1;
}

.esc-rv .esc-rv-total-side {
	display: grid;
	gap: 4px;
}

.esc-rv .esc-rv-count {
	color: var(--rv-caption);
	font-size: 14px;
}

.esc-rv .esc-rv-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.esc-rv .esc-rv-chip {
	appearance: none;
	margin: 0;
	font: inherit;
	cursor: default;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 6px 14px 6px 6px;
	border: 1px solid var(--rv-border);
	border-radius: 999px;
	background: var(--rv-surface);
	color: var(--rv-body);
	font-size: 14px;
	text-decoration: none;
	transition: border-color .2s ease-in-out, color .2s ease-in-out;
}

.esc-rv .esc-rv-chip.is-plain {
	padding-left: 14px;
}

.esc-rv button.esc-rv-chip {
	cursor: pointer;
	white-space: nowrap;
}

.esc-rv button.esc-rv-chip:hover,
.esc-rv button.esc-rv-chip:focus-visible {
	border-color: var(--rv-border-hover);
	color: #fff;
}

/* The chosen platform: a light outline and a lifted surface, one accent stays for text. */
.esc-rv button.esc-rv-chip[aria-pressed="true"] {
	border-color: #fff;
	background: var(--rv-inset);
	color: #fff;
}

.esc-rv button.esc-rv-chip:active {
	transform: scale(.975);
}

.esc-rv .esc-rv-chip b {
	color: #fff;
	font-weight: 700;
}

.esc-rv .esc-rv-chip-n {
	color: var(--rv-caption);
}

.esc-rv .esc-rv-leave {
	flex: 1 1 100%;
	margin: 0;
	color: var(--rv-caption);
	font-size: 14px;
}

.esc-rv .esc-rv-all {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: var(--rv-border-hover);
	text-underline-offset: 4px;
	transition: text-decoration-color .2s ease-in-out;
}

.esc-rv .esc-rv-all:hover,
.esc-rv .esc-rv-all:focus-visible {
	color: #fff;
	text-decoration-color: currentColor;
}

.esc-rv .esc-rv-leave a {
	margin-left: 6px;
	color: var(--rv-red-text);
	font-weight: 500;
	text-decoration: none;
	transition: color .2s ease-in-out;
}

.esc-rv .esc-rv-leave a:hover,
.esc-rv .esc-rv-leave a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

/* Platform mark: a quiet monochrome tile, no brand colours (one accent only). */
.esc-rv .esc-rv-mark {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--rv-inset);
	color: #f2f2f2;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1;
}

/* Real platform logo (Yandex Maps, 2GIS, Google Maps, VK, Zoon) in place of the letter tile. */
.esc-rv .esc-rv-logo {
	display: block;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-left: 3px;
	object-fit: contain;
}

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

.esc-rv .esc-rv-stars {
	display: inline-flex;
	gap: 2px;
}

.esc-rv .esc-rv-star {
	display: block;
	width: 16px;
	height: 16px;
	color: rgba(255, 255, 255, .18);
}

.esc-rv .esc-rv-star.is-on {
	color: var(--rv-gold);
}

.esc-rv .esc-rv-star svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* A part of a star (4,9 → the fifth one filled to 90 %). */
.esc-rv .esc-rv-star.is-part {
	position: relative;
}

.esc-rv .esc-rv-star-fill {
	position: absolute;
	inset: 0 auto 0 0;
	overflow: hidden;
	color: var(--rv-gold);
}

.esc-rv .esc-rv-star-fill svg {
	width: 16px;
	height: 16px;
}

.esc-rv .is-p1 .esc-rv-star-fill { width: 10%; }
.esc-rv .is-p2 .esc-rv-star-fill { width: 20%; }
.esc-rv .is-p3 .esc-rv-star-fill { width: 30%; }
.esc-rv .is-p4 .esc-rv-star-fill { width: 40%; }
.esc-rv .is-p5 .esc-rv-star-fill { width: 50%; }
.esc-rv .is-p6 .esc-rv-star-fill { width: 60%; }
.esc-rv .is-p7 .esc-rv-star-fill { width: 70%; }
.esc-rv .is-p8 .esc-rv-star-fill { width: 80%; }
.esc-rv .is-p9 .esc-rv-star-fill { width: 90%; }

/* ------------------------------------------------------------------- List */

.esc-rv .esc-rv-track {
	position: relative;
	outline: none;
}

.esc-rv .esc-rv-track:focus-visible {
	box-shadow: 0 0 0 2px var(--accent, #ff0004);
	border-radius: 16px;
}

.esc-rv .esc-rv-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.esc-rv .esc-rv-item {
	margin: 0;
	padding: 0;
	min-width: 0;
}

/* Carousel: native scroll-snap strip; a phone sees the edge of the next card. */
.esc-rv.esc-rv--carousel .esc-rv-track {
	/* Room for the 6px hover lift and the focus ring; no visible scrollbar. */
	padding: 8px 2px 8px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.esc-rv.esc-rv--carousel .esc-rv-track::-webkit-scrollbar {
	display: none;
}

/* Faded edge where more cards wait (set by the script). */
.esc-rv.esc-rv--carousel .esc-rv-track.is-more-right {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}

.esc-rv.esc-rv--carousel .esc-rv-track.is-more-left {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 32px);
	mask-image: linear-gradient(90deg, transparent, #000 32px);
}

.esc-rv.esc-rv--carousel .esc-rv-track.is-more-left.is-more-right {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

.esc-rv.esc-rv--carousel .esc-rv-list {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: min(86%, 360px);
	gap: var(--rv-gap);
}

.esc-rv.esc-rv--carousel .esc-rv-item {
	scroll-snap-align: start;
	display: flex;
}

@media (min-width: 768px) {
	.esc-rv.esc-rv--carousel .esc-rv-list {
		grid-auto-columns: calc((100% - var(--rv-gap)) / 2);
	}
}

@media (min-width: 1100px) {
	.esc-rv.esc-rv--carousel .esc-rv-list {
		grid-auto-columns: calc((100% - 2 * var(--rv-gap)) / 3);
	}
}

/* Grid: columns of different heights, reading order down each column. */
.esc-rv.esc-rv--grid .esc-rv-list {
	columns: 3 300px;
	column-gap: var(--rv-gap);
}

.esc-rv.esc-rv--grid .esc-rv-item {
	break-inside: avoid;
	margin-bottom: var(--rv-gap);
}

/* Compact: one column, smaller cards. */
.esc-rv.esc-rv--compact .esc-rv-list {
	display: grid;
	gap: 12px;
	max-width: 760px;
}

.esc-rv.esc-rv--compact .esc-rv-card {
	padding: 18px;
	gap: 10px;
}

/* ------------------------------------------------------------------- Card */

.esc-rv .esc-rv-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	padding: 24px;
	border: 1px solid var(--rv-border);
	border-radius: 16px;
	background: var(--rv-surface);
	transition: border-color .2s ease-in-out, transform .3s ease-in-out;
}

.esc-rv .esc-rv-card:hover {
	border-color: var(--rv-border-hover);
	transform: translateY(-6px);
}

/* Quiet quote sign in the corner (the platform is named in the footer). */
.esc-rv .esc-rv-q {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 28px;
	height: 28px;
	color: rgba(255, 255, 255, .08);
	pointer-events: none;
}

.esc-rv .esc-rv-q svg {
	display: block;
	width: 100%;
	height: 100%;
}

.esc-rv .esc-rv-card-head {
	padding-right: 36px;
}

.esc-rv .esc-rv-card-head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.esc-rv .esc-rv-ava {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--rv-inset);
}

.esc-rv .esc-rv-ava--init {
	display: grid;
	place-items: center;
	background: var(--accent-grad, linear-gradient(135deg, #ff3b3e 0%, #ff0004 100%));
	color: #fff;
	font-size: 17px;
	font-weight: 700;
}

.esc-rv .esc-rv-who {
	display: grid;
	flex: 1 1 auto;
	gap: 2px;
	min-width: 0;
}

.esc-rv .esc-rv-name {
	overflow: hidden;
	color: var(--rv-head);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.esc-rv .esc-rv-meta {
	color: var(--rv-caption);
	font-size: 13px;
	line-height: 1.35;
}

.esc-rv .esc-rv-text {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--rv-body);
	font-size: 16px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.esc-rv .esc-rv-text p {
	margin: 0 0 .7em;
}

.esc-rv .esc-rv-text p:last-child {
	margin-bottom: 0;
}

/* With JS: long texts fold to 7 lines (max-height works with several <p>
 * in every engine, line-clamp does not); the full text stays in the page. */
.esc-rv.esc-rv--js .esc-rv-text {
	max-height: calc(1.6em * 7);
	overflow: hidden;
}

.esc-rv.esc-rv--js.esc-rv--compact .esc-rv-text {
	max-height: calc(1.6em * 4);
}

.esc-rv.esc-rv--js .esc-rv-text.is-clamped {
	-webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
	mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.esc-rv.esc-rv--js .esc-rv-card.is-open .esc-rv-text {
	max-height: none;
	-webkit-mask-image: none;
	mask-image: none;
}

.esc-rv .esc-rv-more {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: 44px;
	margin: -12px 0 -8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rv-red-text);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: color .2s ease-in-out;
}

.esc-rv .esc-rv-more:hover,
.esc-rv .esc-rv-more:focus-visible {
	color: #fff;
}

.esc-rv .esc-rv-more {
	gap: 6px;
}

.esc-rv .esc-rv-more svg {
	width: 16px;
	height: 16px;
	transition: transform .3s ease-in-out;
}

.esc-rv .esc-rv-more[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.esc-rv .esc-rv-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.esc-rv .esc-rv-photo {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px;
}

.esc-rv .esc-rv-photo.has-more::after {
	content: attr(data-more);
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
}

.esc-rv .esc-rv-photo img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	transition: transform .45s ease-in-out;
}

.esc-rv .esc-rv-photo:hover img {
	transform: scale(1.05);
}

.esc-rv .esc-rv-foot {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--rv-border);
	font-size: 13px;
}

.esc-rv .esc-rv-foot a,
.esc-rv .esc-rv-foot span {
	color: var(--rv-caption);
	text-decoration: none;
	transition: color .2s ease-in-out;
}

.esc-rv .esc-rv-foot a:hover,
.esc-rv .esc-rv-foot a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

/* ----------------------------------------------------------------- Arrows */

.esc-rv .esc-rv-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 24px;
	margin-top: 10px;
}

.esc-rv .esc-rv-nav {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.esc-rv .esc-rv-pos {
	margin-right: 6px;
	color: var(--rv-caption);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.esc-rv .esc-rv-arrow {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--rv-border-hover);
	border-radius: 6px;
	background: var(--rv-surface);
	color: #fff;
	cursor: pointer;
	transition: border-color .2s ease-in-out, transform .3s ease-in-out, opacity .2s ease-in-out;
}

.esc-rv .esc-rv-arrow svg {
	width: 22px;
	height: 22px;
}

.esc-rv .esc-rv-arrow:hover:not(:disabled) {
	border-color: #fff;
	transform: translateY(-2px);
}

.esc-rv .esc-rv-arrow:active:not(:disabled) {
	transform: scale(.975);
}

.esc-rv .esc-rv-arrow:disabled {
	opacity: .35;
	cursor: default;
}

.esc-rv :focus-visible {
	outline: 2px solid var(--accent, #ff0004);
	outline-offset: 2px;
}

/* Platform switch: dim while loading, soft fade-in of the new cards. */
.esc-rv.is-loading .esc-rv-list {
	opacity: .45;
	transition: opacity .2s ease-in-out;
}

.esc-rv .esc-rv-list.is-in .esc-rv-item {
	animation: esc-rv-in .45s ease-in-out both;
}

@keyframes esc-rv-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.esc-rv .esc-rv-empty {
	display: block;
	grid-column: 1 / -1;
	padding: 24px;
	border: 1px dashed var(--rv-border-hover);
	border-radius: 16px;
	color: var(--rv-body);
}

.esc-rv .esc-rv-empty p {
	margin: 0;
}

/* A block in its own section (shortcode with a heading). */
.esc-rv-section .esc-rv-head {
	margin-bottom: clamp(32px, 3.6vw, 48px);
}

/* Phones: the chips go in one scrolling row instead of four lines. */
@media (max-width: 600px) {
	.esc-rv .esc-rv-chips {
		flex-wrap: nowrap;
		width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
		mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
	}

	.esc-rv .esc-rv-chips::-webkit-scrollbar {
		display: none;
	}

	.esc-rv .esc-rv-chips li {
		flex: 0 0 auto;
	}

	.esc-rv .esc-rv-chips li:last-child {
		padding-right: 28px;
	}
}

@media (max-width: 480px) {
	.esc-rv .esc-rv-card {
		padding: 20px;
	}

	.esc-rv .esc-rv-sum {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.esc-rv *,
	.esc-rv *::before,
	.esc-rv *::after {
		transition: none !important;
	}

	.esc-rv .esc-rv-photo:hover img,
	.esc-rv .esc-rv-arrow:hover:not(:disabled),
	.esc-rv .esc-rv-card:hover,
	.esc-rv button.esc-rv-chip:active {
		transform: none;
	}

	.esc-rv .esc-rv-list.is-in .esc-rv-item {
		animation: none;
	}
}
