/**
 * LEMONTEC Review Engine
 *
 * No external fonts, no CDN, no web requests. Everything is overridable through
 * the custom properties on .ltre so a client theme can restyle the widget
 * without touching this file.
 */

.ltre {
	--ltre-star: #f5a623;
	--ltre-ink: #1d1f24;
	--ltre-muted: #6b7280;
	--ltre-card: #f4f5f6;
	--ltre-card-radius: 8px;
	--ltre-summary-bg: #fbfbe9;
	--ltre-cta-bg: #f2e04a;
	--ltre-cta-ink: #1d1f24;
	--ltre-gap: 16px;
	--ltre-card-min: 260px;
	--ltre-card-max: 380px;
	--ltre-card-padding: 16px;
	--ltre-font-size: 15px;
	--ltre-font: inherit;

	color: var(--ltre-ink);
	font-family: var(--ltre-font);
	font-size: var(--ltre-font-size);
	line-height: 1.5;
}

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

/* ---------- summary ---------- */

.ltre__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	padding: 14px 18px;
	margin-bottom: var(--ltre-gap);
	background: var(--ltre-summary-bg);
	border-radius: var(--ltre-card-radius);
}

.ltre__summary-main {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

.ltre__verdict {
	font-weight: 600;
}

.ltre__score {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ltre__count {
	color: var(--ltre-muted);
}

.ltre__count::before {
	content: "|";
	color: var(--ltre-muted);
	opacity: .5;
	margin-right: 12px;
}

.ltre__cta {
	display: inline-block;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--ltre-cta-bg);
	color: var(--ltre-cta-ink);
	font-weight: 600;
	font-size: .93em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.ltre__cta:hover,
.ltre__cta:focus-visible {
	filter: brightness(.94);
	color: var(--ltre-cta-ink);
}

/* ---------- review menu, several locations ---------- */

.ltre__cta-menu {
	position: relative;
}

.ltre__cta-menu > summary {
	list-style: none;
}

.ltre__cta-menu > summary::-webkit-details-marker {
	display: none;
}

.ltre__cta-menu > summary::after {
	content: "";
	display: inline-block;
	width: .4em;
	height: .4em;
	margin-left: .55em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-.15em) rotate(45deg);
}

.ltre__cta-menu[open] > summary::after {
	transform: translateY(.05em) rotate(-135deg);
}

.ltre__cta-list {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 5;
	min-width: 100%;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border-radius: var(--ltre-card-radius);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
}

.ltre__cta-list li {
	margin: 0;
}

.ltre__cta-list a {
	display: block;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--ltre-ink);
	text-decoration: none;
	white-space: nowrap;
}

.ltre__cta-list a:hover,
.ltre__cta-list a:focus-visible {
	background: var(--ltre-card);
}

/* ---------- badge, compact bar ---------- */

.ltre__badge {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 28px;
	padding: 14px 22px;
	background: var(--ltre-summary-bg);
	border-radius: var(--ltre-card-radius);
}

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

.ltre__badge-score {
	font-size: 2.2em;
	font-weight: 500;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ltre__badge-score small,
.ltre__badge-value small {
	font-size: .5em;
	font-weight: 400;
	color: var(--ltre-muted);
	margin-left: 1px;
}

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

.ltre__badge-head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ltre__badge-count {
	color: var(--ltre-muted);
	font-size: .87em;
}

.ltre__badge-sources {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 32px;
	margin: 0;
	padding: 0 0 0 28px;
	list-style: none;
	border-left: 1px solid rgba(0, 0, 0, .15);
}

.ltre__badge-source {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	line-height: 1.25;
}

.ltre__badge-label {
	font-size: .87em;
}

.ltre__badge-value {
	font-size: 1.35em;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.ltre__badge-actions {
	margin-left: auto;
}

.ltre__button {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: transparent;
	color: var(--ltre-ink);
	font-weight: 500;
	font-size: .93em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	list-style: none;
}

.ltre__button:hover,
.ltre__button:focus-visible {
	background: var(--ltre-ink);
	color: var(--ltre-summary-bg);
}

/* ---------- stars ---------- */

.ltre__stars {
	display: inline-flex;
	gap: 1px;
	color: #d3d5d9;
	line-height: 1;
}

.ltre__star.is-on {
	color: var(--ltre-star);
}

/* ---------- viewport and track ---------- */

.ltre__viewport {
	position: relative;
}

/* Gutter so the nav buttons sit beside the cards instead of on top of the
   text. Without it the arrow covers the first and last card. */
.ltre--slider .ltre__viewport {
	padding-inline: 22px;
}

.ltre__track {
	display: flex;
	gap: var(--ltre-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	/* Room for the focus ring, which would otherwise be clipped. */
	padding-block: 2px;
}

.ltre__track::-webkit-scrollbar {
	display: none;
}

.ltre__track:focus-visible {
	outline: 2px solid var(--ltre-star);
	outline-offset: 2px;
}

.ltre__item {
	flex: 0 0 clamp(var(--ltre-card-min), 32%, var(--ltre-card-max));
	scroll-snap-align: start;
	list-style: none;
	margin: 0;
}

/* Grid and list drop the slider behaviour entirely. */

.ltre--grid .ltre__track {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--ltre-card-min), 1fr));
	/* Let each card end where its content ends. Stretching a short review to
	   the height of the longest one in its row just adds dead space. */
	align-items: start;
	overflow: visible;
	scroll-snap-type: none;
}

.ltre--grid .ltre__item,
.ltre--list .ltre__item {
	flex: none;
}

.ltre--list .ltre__track {
	flex-direction: column;
	overflow: visible;
	scroll-snap-type: none;
}

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

.ltre__card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	padding: var(--ltre-card-padding);
	background: var(--ltre-card);
	border-radius: var(--ltre-card-radius);
}

.ltre__card-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

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

.ltre__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #dfe1e4;
	color: #4b5563;
	font-size: 14px;
	font-weight: 600;
}

.ltre__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin-right: auto;
}

.ltre__author {
	font-weight: 600;
	overflow-wrap: break-word;
}

.ltre__date {
	color: var(--ltre-muted);
	font-size: 13px;
}

.ltre__mark--text,
.ltre__card-mark--text {
	flex: none;
	color: var(--ltre-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
}

.ltre__card-mark {
	flex: none;
	max-height: 22px;
	width: auto;
}

/* ---------- body ---------- */

.ltre__body {
	position: relative;
}

.ltre__text {
	margin: 0;
	overflow-wrap: break-word;
}

.ltre__body.is-clamped .ltre__text {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ltre__more {
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ltre-muted);
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

.ltre__more:hover,
.ltre__more:focus-visible {
	color: var(--ltre-ink);
}

.ltre__reply {
	margin-top: auto;
	padding: 10px 12px;
	background: rgba(0, 0, 0, .04);
	border-radius: 6px;
	font-size: 14px;
}

.ltre__reply p {
	margin: 4px 0 0;
}

.ltre__reply-label {
	color: var(--ltre-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
}

/* ---------- nav ---------- */

.ltre__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	transform: translateY(-50%);
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 50%;
	background: #fff;
	color: var(--ltre-ink);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.ltre__nav--prev {
	left: 0;
}

.ltre__nav--next {
	right: 0;
}

.ltre__nav[disabled] {
	opacity: .35;
	cursor: default;
}

/* ---------- a11y ---------- */

.ltre .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ltre__track {
		scroll-behavior: auto;
	}
}

@media (max-width: 640px) {
	.ltre {
		--ltre-card-min: 82%;
	}

	.ltre__nav {
		display: none;
	}

	.ltre__badge-sources {
		width: 100%;
		padding: 12px 0 0;
		border-left: 0;
		border-top: 1px solid rgba(0, 0, 0, .15);
		justify-content: space-around;
	}

	.ltre__badge-actions {
		width: 100%;
		margin-left: 0;
	}

	.ltre__badge-actions .ltre__button,
	.ltre__badge-actions .ltre__cta-menu,
	.ltre__badge-actions .ltre__cta-menu > summary {
		display: block;
		text-align: center;
	}
}
