/* =============================================================================
   MrWin Reviews - what every template shares

   Loaded before the template's own stylesheet, which handles layout and sizes.
   Here: the defaults of the custom properties, the stars, and the voting widget
   (stars to vote with, the button, the message line). A template changes sizes
   and spacing of these, not how they work.

   Colors and radii come from the Styling tab as custom properties on the box
   itself; the values below are only what applies when a setting is empty.
   ============================================================================= */

.mrwin-review {
	--mrwin-radius: 8px;
	--mrwin-radius-control: 6px;
	--mrwin-radius-image: 6px;
	--mrwin-radius-bar: 999px;
	--mrwin-star-size: 1.4rem;
	--mrwin-vote-star-size: 1.6rem;
	/* Behind a rating bar, and behind an image. Mixed from text and background rather than
	   the border color: a border is often the accent, and a bar on a track of its own color
	   reads as full whatever it holds. */
	--mrwin-track: color-mix(in srgb, var(--mrwin-color-text, #1e1e1e) 12%, var(--mrwin-color-background, #ffffff));
}

.mrwin-review [hidden] {
	display: none !important;
}

/* Themes decorate headings in post content - a colored bar on the side, an underline. The
   review's headings are labels inside a box and keep only what its template gives them. */
.mrwin-review.mrwin-review :is(h2, h3, h4) {
	border-left: 0;
	border-right: 0;
	border-top: 0;
	padding-left: 0;
	background: none;
}

/* ── Stars (display) ─────────────────────────────────────────────────────── */

.mrwin-review .mrwin-stars {
	display: inline-flex;
	gap: 0;
	margin: 0;
	padding: 0;
	font-size: var(--mrwin-star-size);
	line-height: 1;
	white-space: nowrap;
}

.mrwin-review .mrwin-star--full {
	color: var(--mrwin-color-star-active, #fbbf24);
}

.mrwin-review .mrwin-star--empty {
	color: var(--mrwin-color-star-empty, #d1d5db);
}

/* The same glyph as the others, painted half and half. */
.mrwin-review .mrwin-star--half {
	color: transparent;
	background: linear-gradient(90deg, var(--mrwin-color-star-active, #fbbf24) 50%, var(--mrwin-color-star-empty, #d1d5db) 50%);
	-webkit-background-clip: text;
	background-clip: text;
}

/* ── Voting widget ───────────────────────────────────────────────────────── */

.mrwin-review .mrwin-voting__input {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
}

.mrwin-review .mrwin-voting__label {
	margin: 0;
	padding: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mrwin-color-text, #1e1e1e);
}

.mrwin-review .mrwin-vote-stars {
	display: inline-flex;
	gap: 2px;
	margin: 0;
	padding: 0;
}

.mrwin-review .mrwin-vote-star {
	display: inline-block;
	margin: 0;
	padding: 2px;
	background: none;
	border: 0;
	border-radius: var(--mrwin-radius-control);
	box-shadow: none;
	font: inherit;
	font-size: var(--mrwin-vote-star-size);
	line-height: 1;
	color: var(--mrwin-color-star-empty, #d1d5db);
	cursor: pointer;
	transition: transform 0.1s ease, color 0.1s ease;
	-webkit-tap-highlight-color: transparent;
}

.mrwin-review .mrwin-vote-star:hover,
.mrwin-review .mrwin-vote-star:focus {
	background: none;
	outline: none;
}

.mrwin-review .mrwin-vote-star--selected {
	color: var(--mrwin-color-star-active, #fbbf24);
}

.mrwin-review .mrwin-vote-star:hover {
	transform: scale(1.15);
}

/* Keyboard focus shows; a click does not leave a ring behind. */
.mrwin-review .mrwin-vote-star:focus-visible {
	outline: 2px solid var(--mrwin-color-primary, #2563eb);
	outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
	.mrwin-review .mrwin-vote-star {
		transition: none;
	}

	.mrwin-review .mrwin-vote-star:hover {
		transform: none;
	}
}

.mrwin-review .mrwin-vote-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 8px 18px;
	background: var(--mrwin-color-primary, #2563eb);
	color: #ffffff;
	border: 0;
	border-radius: var(--mrwin-radius-control);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

.mrwin-review .mrwin-vote-submit:hover:not(:disabled) {
	filter: brightness(0.9);
}

.mrwin-review .mrwin-vote-submit:focus-visible {
	outline: 2px solid var(--mrwin-color-primary, #2563eb);
	outline-offset: 2px;
}

.mrwin-review .mrwin-vote-submit:disabled {
	opacity: 0.45;
	cursor: default;
}

/* Messages are mixed from the box's own background, so they follow a dark theme. */
.mrwin-review .mrwin-vote-status {
	margin: 12px 0 0;
	padding: 8px 12px;
	border: 1px solid var(--mrwin-color-border, #e5e7eb);
	border-radius: var(--mrwin-radius-control);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--mrwin-color-text-muted, #6b7280);
}

.mrwin-review .mrwin-status--success,
.mrwin-review .mrwin-status--error,
.mrwin-review .mrwin-status--info {
	--mrwin-status: var(--mrwin-color-primary, #2563eb);
	color: var(--mrwin-status);
	background: color-mix(in srgb, var(--mrwin-status) 12%, var(--mrwin-color-background, #ffffff));
	border-color: color-mix(in srgb, var(--mrwin-status) 35%, var(--mrwin-color-background, #ffffff));
}

.mrwin-review .mrwin-status--success {
	--mrwin-status: var(--mrwin-color-positive, #10b981);
}

.mrwin-review .mrwin-status--error {
	--mrwin-status: var(--mrwin-color-negative, #ef4444);
}
