/* ===========================================================================
   lg-reviews — user reviews on the start page (_components/lg-reviews.php)
   ---------------------------------------------------------------------------

     .lg-reviews
       a.lg-reviews__summary        title, 4,8 / 5, stars, count, "read all"
       .lg-reviews__carousel
         ul.lg-reviews__strip       native horizontal scroll with scroll-snap
           li > a.lg-review         one card
         button.lg-reviews__arrow   prev / next (desktop only)

     a.lg-rating-line               the one-liner in the hero

   Swiping is the browser's own scrolling, not a script: the strip scrolls
   sideways and snaps to a card. The arrows only call scrollBy.
   =========================================================================== */

/* --- Stars ---------------------------------------------------------------- */
.lg-stars {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	line-height: 0;
	vertical-align: middle;
	white-space: nowrap;
}

.lg-stars svg {
	width: 1.1em;
	height: 1.1em;
	margin-right: 2px;
}

.lg-stars__base svg { fill: #dcdce6; }

.lg-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
}

.lg-stars__fill svg { fill: #f4bc55; }

/* Dark mode: the light grey of the empty stars would glare. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .lg-stars__base svg { fill: var(--lg-border-strong); }
}
:root[data-theme="dark"] .lg-stars__base svg { fill: var(--lg-border-strong); }

/* --- Band ----------------------------------------------------------------- */
.lg-reviews {
	display: grid;
	grid-template-columns: 15rem minmax(0, 1fr);
	gap: 1.5rem;
	align-items: stretch;
	padding: 2rem 0 1.75rem;
	font-family: var(--lg-font);
	color: var(--lg-text);
}

.lg-reviews__summary {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.35rem;
	padding: 1.25rem 1.4rem;
	border-radius: var(--lg-radius-card);
	background-color: var(--lg-surface-alt);
	color: var(--lg-text);
	text-decoration: none;
}

.lg-reviews__summary:hover,
.lg-reviews__summary:focus-visible { text-decoration: none; color: var(--lg-text); }
.lg-reviews__summary:hover .lg-reviews__all { text-decoration: underline; }

.lg-reviews__title {
	margin: 0 0 0.35rem;
	padding: 0;
	font-family: var(--lg-font-heading);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.lg-reviews__score {
	color: var(--lg-text-soft);
	font-size: 0.95rem;
	margin-top:0.1rem;
	margin-bottom:0.1rem;
}

.lg-reviews__score strong {
	color: var(--lg-text);
	font-family: var(--lg-font-heading);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1;
}

.lg-reviews__summary .lg-stars { font-size: 1.35rem; }

.lg-reviews__count {
	color: var(--lg-text-soft);
	font-size: 0.9rem;
	margin-top:0.3rem;
}

.lg-reviews__all {
	margin-top: 0.5rem;
	color: var(--lg-red);
	font-size: 0.9rem;
	font-weight: 600;
}

/* --- Cards ---------------------------------------------------------------- */
.lg-reviews__carousel {
	position: relative;
	min-width: 0;
}

.lg-reviews__strip {
	display: flex;
	column-gap: 1rem;
	margin: 0;
	padding: 0rem 0.25rem 0rem;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding: 0 0.25rem;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.lg-reviews__strip::-webkit-scrollbar { display: none; }

/* Three cards on desktop, two on a tablet, one and a bit on a phone (the
   cut-off edge says "swipe"). */
.lg-reviews__item {
	flex: 0 0 calc((100% - 2rem) / 3);
	scroll-snap-align: start;
}

.lg-review {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1rem 1.1rem 1.05rem;
	border: 1px solid var(--lg-border);
	border-radius: var(--lg-radius-card);
	background-color: var(--lg-surface);
	color: var(--lg-text-soft);
	font-size: 0.92rem;
	line-height: 1.5;
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.lg-review:hover,
.lg-review:focus-visible {
	border-color: var(--lg-border-strong);
	color: var(--lg-text-soft);
	text-decoration: none;
}

.lg-review:hover .lg-review__title { text-decoration: underline; }

.lg-review:focus-visible,
.lg-reviews__summary:focus-visible,
.lg-rating-line:focus-visible {
	outline: 2px solid var(--lg-red);
	outline-offset: 2px;
}

.lg-review__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
}

.lg-review__head .lg-stars { font-size: 0.95rem; }

.lg-review__date {
	color: var(--lg-text-muted);
	font-size: 0.8rem;
}

.lg-review__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin-bottom: 0.3rem;
	color: var(--lg-text);
	font-size: 0.97rem;
	font-weight: 700;
	line-height: 1.4;
}

.lg-review__text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

.lg-review__name {
	margin-top: auto;
	padding-top: 0.75rem;
	color: var(--lg-text-muted);
	font-size: 0.85rem;
}

/* --- Arrows --------------------------------------------------------------- */
.lg-reviews__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin-top: -1.25rem;
	padding: 0;
	border: 1px solid var(--lg-border);
	border-radius: 50%;
	background-color: var(--lg-surface);
	box-shadow: 0 4px 12px rgba(var(--lg-shadow-rgb, 120, 98, 72), 0.12);
	color: var(--lg-text);
	cursor: pointer;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.lg-reviews__arrow svg { width: 1.2rem; height: 1.2rem; }
.lg-reviews__arrow:hover { border-color: var(--lg-red); }
.lg-reviews__arrow:focus-visible { outline: 2px solid var(--lg-red); outline-offset: 2px; }
.lg-reviews__arrow--prev { left: -1rem; }
.lg-reviews__arrow--next { right: -1rem; }
.lg-reviews__arrow--next svg { transform: rotate(180deg); }

.lg-reviews__arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 1000px) {
	.lg-reviews__item { flex-basis: calc((100% - 1rem) / 2); }
}

/* Phones: summary on top as one row, then the cards to swipe; no arrows. */
@media (max-width: 700px) {
	.lg-reviews {
		grid-template-columns: minmax(0, 1fr);
		gap: 1rem;
		padding: 1.5rem 0 1.25rem;
	}

	.lg-reviews__summary {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		/* Left, like the heading. The desktop card centres its column
		   vertically with justify-content - in a row that centred the line. */
		justify-content: flex-start;
		column-gap: 0.75rem;
		padding: 1rem 1.1rem;
	}

	.lg-reviews__title { flex: 1 0 100%; margin-bottom: 0; }
	.lg-reviews__score strong { font-size: 1.5rem; }
	.lg-reviews__all { flex: 1 0 100%; margin-top: 0.15rem; }

	.lg-reviews__item { flex-basis: 82%; }
	.lg-reviews__arrow { display: none; }
}

/* 481-700px: the 82% card of the phone layout is a card and a half on a
   screen that has room for two - two, and a bit of the third as the hint to
   swipe. */
@media (min-width: 481px) and (max-width: 700px) {
	.lg-reviews__item { flex-basis: 44%; }
}

@media (prefers-reduced-motion: reduce) {
	.lg-reviews__strip { scroll-behavior: auto; }
}

/* --- Hero line ------------------------------------------------------------ */
.lg-rating-line {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin-top: 1.25rem;
	padding: 0.5rem 0.95rem;
	border-radius: var(--lg-radius-lg);
	background-color: var(--lg-surface-alt);
	color: var(--lg-text-soft);
	font-family: var(--lg-font);
	font-size: 0.95rem;
	text-decoration: none;
}

.lg-rating-line .lg-stars { font-size: 1.05rem; }
/* a.css's reset gives <strong> font:inherit, so the weight has to be set. */
.lg-rating-line strong { color: var(--lg-text); font-weight: 700; }
.lg-rating-line:hover { color: var(--lg-text); text-decoration: none; }
.lg-rating-line:hover span:last-child { text-decoration: underline; }
.lg-rating-line__dot { color: var(--lg-text-muted); }
