/**
 * Monitee Social Proof — front end.
 *
 * Every value falls back to a sensible default, so the blocks still look
 * deliberate on a theme that does not define the Monitee tokens. On the
 * Monitee theme they inherit the real design system.
 */

.mnt-sp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
	gap: var(--wp--preset--spacing--50, 1.5rem);
	align-items: stretch;
	text-align: center;
}

.mnt-sp-stat {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.375rem;
	padding: var(--wp--preset--spacing--50, 1.5rem) var(--wp--preset--spacing--40, 1rem);
	border: 1px solid var(--wp--preset--color--line, #22242d);
	border-radius: var(--wp--custom--radius--lg, 24px);
	background: var(--wp--preset--color--surface, #181920);
	box-shadow: var(--wp--preset--shadow--card, inset 0 1px 0 rgba(255, 255, 255, 0.045));
	text-decoration: none;
	color: inherit;
	transition: border-color 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

a.mnt-sp-stat:hover {
	border-color: var(--wp--preset--color--line-strong, #353b4d);
	transform: translateY(-2px);
	text-decoration: none;
}

.mnt-sp-stat .mnt-stat__value {
	display: block;
	font-size: var(--wp--preset--font-size--stat, clamp(2.25rem, 1.5rem + 2vw, 3.25rem));
	font-weight: 600;
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--display, -0.035em);
	color: var(--wp--preset--color--text, #e4e5f0);
	font-variant-numeric: tabular-nums;
}

.mnt-sp-stat .mnt-stat__value--sm {
	font-size: var(--wp--preset--font-size--heading-2, 2rem);
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	letter-spacing: 0;
}

.mnt-sp-stat .mnt-stat__unit {
	font-size: 0.45em;
	font-weight: 500;
	color: var(--wp--preset--color--text-faint, #7b839f);
	margin-left: 0.08em;
}

.mnt-sp-stat.mnt-stat--warning .mnt-stat__unit {
	color: var(--wp--preset--color--warning, #ffae58);
}

.mnt-sp-stat.mnt-stat--primary .mnt-stat__value {
	color: var(--wp--preset--color--primary, #bac5ee);
}

.mnt-sp-stat .mnt-stat__label {
	display: block;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	color: var(--wp--preset--color--text-muted, #a9aab5);
	text-wrap: balance;
}

/*
 * Sized in em so it tracks the label rather than a fixed pixel value, and set
 * slightly below the baseline because the GitHub mark is optically centred on
 * its own box rather than on a cap height.
 */
.mnt-stat__icon {
	width: 1em;
	height: 1em;
	margin-right: 0.35em;
	vertical-align: -0.15em;
	opacity: 0.75;
}

/* ==========================================================================
   Testimonial wall
   ========================================================================== */

.mnt-sp-wall {
	display: grid;
	gap: var(--wp--preset--spacing--50, 1.5rem);
	align-items: stretch;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

@media (min-width: 900px) {
	.mnt-sp-wall--1 { grid-template-columns: 1fr; }
	.mnt-sp-wall--2 { grid-template-columns: repeat(2, 1fr); }
	.mnt-sp-wall--3 { grid-template-columns: repeat(3, 1fr); }
	.mnt-sp-wall--4 { grid-template-columns: repeat(4, 1fr); }
}

.mnt-sp-quote {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30, 0.75rem);
	height: 100%;
	margin: 0;
	padding: var(--wp--preset--spacing--50, 1.5rem);
	border: 1px solid var(--wp--preset--color--line, #22242d);
	border-radius: var(--wp--custom--radius--lg, 24px);
	background: var(--wp--preset--color--surface, #181920);
	box-shadow: var(--wp--preset--shadow--card, inset 0 1px 0 rgba(255, 255, 255, 0.045));
}

.mnt-sp-quote__stars {
	color: var(--wp--preset--color--warning, #ffae58);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	letter-spacing: 0.12em;
	line-height: 1;
}

.mnt-sp-quote__text {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: var(--wp--preset--font-size--body, 1rem);
	line-height: 1.6;
	color: var(--wp--preset--color--text, #e4e5f0);
	text-wrap: pretty;
}

/* The blockquote sits above the caption, so the caption pins to the bottom
   and every card's attribution line stays on the same baseline. */
.mnt-sp-quote__by {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--30, 0.75rem);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	color: var(--wp--preset--color--text-muted, #a9aab5);
}

.mnt-sp-quote__avatar {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	object-fit: cover;
	flex: none;
	background: var(--wp--preset--color--surface-raised, #23252e);
}

.mnt-sp-quote__avatar--letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--primary-container, #353b4d);
	color: var(--wp--preset--color--primary, #bac5ee);
	font-weight: 600;
}

.mnt-sp-quote__name {
	font-weight: 500;
	color: var(--wp--preset--color--text, #e4e5f0);
}

.mnt-sp-quote__src {
	margin-left: auto;
	font-size: var(--wp--preset--font-size--micro, 0.75rem);
	color: var(--wp--preset--color--text-faint, #7b839f);
}

/* ==========================================================================
   Translated reviews
   ==========================================================================
   A translated quote has to say so. Not a disclaimer — a line of provenance,
   the same size and weight as the rest of the card's small print, with the
   original one click away so the claim is checkable.

   <details> carries the whole interaction, so there is no JavaScript here at
   all: it works in the editor preview, in an RSS reader, and with scripts
   blocked.
   ========================================================================== */

.mnt-sp-quote__trans {
	font-size: var(--wp--preset--font-size--micro, 0.75rem);
	color: var(--wp--preset--color--text-faint, #7b839f);
}

.mnt-sp-quote__transbar {
	display: flex;
	align-items: baseline;
	gap: 0.625rem;
	cursor: pointer;
	list-style: none;
	line-height: 1.5;
}

/* Both are needed: WebKit uses the pseudo-element, everyone else the property. */
.mnt-sp-quote__transbar::-webkit-details-marker {
	display: none;
}

.mnt-sp-quote__translated {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

/* A small globe, drawn in CSS so there is no icon dependency for one mark. */
.mnt-sp-quote__translated::before {
	content: "";
	width: 11px;
	height: 11px;
	flex: none;
	border: 1px solid currentColor;
	border-radius: 999px;
	background:
		linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
		linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
	opacity: 0.8;
}

.mnt-sp-quote__transtoggle {
	margin-left: auto;
	color: var(--wp--preset--color--primary, #bac5ee);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	white-space: nowrap;
}

.mnt-sp-quote__transbar:hover .mnt-sp-quote__transtoggle {
	color: var(--wp--preset--color--text, #e4e5f0);
}

.mnt-sp-quote__transhide,
.mnt-sp-quote__trans[open] .mnt-sp-quote__transshow {
	display: none;
}

.mnt-sp-quote__trans[open] .mnt-sp-quote__transhide {
	display: inline;
}

/*
 * The original is evidence, not a second quote — quieter than the translation
 * above it, and set apart so nobody mistakes the two for one running text.
 */
.mnt-sp-quote__original {
	margin: 0.625rem 0 0;
	padding-left: 0.75rem;
	border-left: 2px solid var(--wp--preset--color--line-strong, #353b4d);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-style: italic;
	line-height: 1.55;
	color: var(--wp--preset--color--text-muted, #a9aab5);
	text-wrap: pretty;
}

.mnt-sp-quote__transbar:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #bac5ee);
	outline-offset: 3px;
	border-radius: var(--wp--custom--radius--xs, 6px);
}

/* Editor-only placeholder. */
.mnt-sp-empty {
	padding: 2rem;
	border: 1px dashed var(--wp--preset--color--line-strong, #353b4d);
	border-radius: var(--wp--custom--radius--md, 16px);
	color: var(--wp--preset--color--text-muted, #a9aab5);
	text-align: center;
	font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
	.mnt-sp-stat { transition: none; }
	a.mnt-sp-stat:hover { transform: none; }
}

/*
 * Attribution badge used when a review has no reviewer name — which is every
 * review imported from Play's bulk reports, since Google omits names there.
 * Quieter than a name so it does not compete with the quote itself.
 */
.mnt-sp-quote__source {
	display: inline-flex;
	align-items: center;
	gap: 0.4375rem;
	padding: 0.25rem 0.6875rem;
	border: 1px solid var(--wp--preset--color--line-strong, #353b4d);
	border-radius: 999px;
	background: var(--wp--preset--color--surface-raised, #23252e);
	color: var(--wp--preset--color--text-muted, #a9aab5);
	font-size: var(--wp--preset--font-size--micro, 0.75rem);
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
}

.mnt-sp-quote__source::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: var(--wp--preset--color--success, #00a15d);
	flex: none;
}
