/* ==========================================================================
   Economic Trivia — sidebar quiz card
   --------------------------------------------------------------------------
   Redesigned for Sovereign Terminal. Class names are unchanged from the
   soledad-child original because economic-trivia.js writes this markup, so the
   selectors are effectively its public API — only the presentation moved.

   Lives in the post sidebar beneath the subscribe box: a white card with the
   house hairline, a centred header, the question in a tinted well with an
   accent rule down its left edge, and the answer revealed underneath.
   ========================================================================== */

.economic-trivia-container {
	display: block;
	max-width: 100%;
}

.economic-trivia-widget {
	background: var(--card-bg);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	padding: 20px 18px;
	font-family: var(--font-body);
	color: var(--ink-200);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.trivia-header {
	text-align: center;
	padding-bottom: 14px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--line-soft);
}

.trivia-title {
	font-family: var(--font-display);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--ink-100);
	margin: 0 0 4px;
}

.trivia-subtitle {
	font-size: var(--fs-xs);
	color: var(--ink-500);
	margin: 0;
}

/* ── Question ────────────────────────────────────────────────────────────── */
.trivia-question-container {
	transition: opacity var(--dur) var(--ease);
}

/* Applied by the script for the beat between questions. */
.question-fade-out {
	opacity: 0;
}

.trivia-question {
	background: var(--brand-light);
	border-left: 3px solid var(--brand);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 14px 14px 15px;
	margin-bottom: 12px;
}

.question-number {
	font-size: var(--fs-micro);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--brand-dark);
	margin-bottom: 6px;
}

.question-text {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ink-100);
}

/* ── Answer ──────────────────────────────────────────────────────────────── */
/* Collapsed by default and expanded by the .show class the script adds. The
   max-height/opacity pair animates; `display:none` could not. */
.trivia-answer {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	background: var(--navy-850);
	border-radius: var(--radius);
	transition: max-height var(--dur) var(--ease), opacity var(--dur) var(--ease),
		padding var(--dur) var(--ease), margin var(--dur) var(--ease);
	padding: 0 14px;
	margin-bottom: 0;
}

.trivia-answer.show {
	max-height: 260px;
	opacity: 1;
	padding: 12px 14px;
	margin-bottom: 14px;
}

.answer-label {
	font-size: var(--fs-micro);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-500);
	margin-bottom: 4px;
}

.answer-text {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ink-100);
}

/* ── Controls ────────────────────────────────────────────────────────────── */
.trivia-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.trivia-btn {
	font-family: var(--font-body);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 9px 14px;
	border-radius: var(--radius);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
		border-color var(--dur) var(--ease);
}

.btn-show-answer {
	background: var(--brand);
	color: #fff;
}

.btn-show-answer:hover:not(:disabled) {
	background: var(--brand-dark);
}

.btn-next {
	background: transparent;
	color: var(--ink-300);
	border-color: var(--line-firm);
}

/* The resting hover, before the answer is revealed. Once it is, .is-ready
   below takes over and supplies its own hover. */
.btn-next:hover:not(:disabled) {
	border-color: var(--brand);
	color: var(--brand);
}

/* Set by the script once the answer is revealed: the Next button becomes the
   primary action. Previously an inline style, which ignored the accent. */
.btn-next.is-ready:not(:disabled) {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

.btn-next.is-ready:not(:disabled):hover {
	background: var(--brand-dark);
	border-color: var(--brand-dark);
	color: #fff;
}

.trivia-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.trivia-progress {
	margin-left: auto;
}

.progress-info {
	font-size: var(--fs-xs);
	color: var(--ink-500);
	font-variant-numeric: tabular-nums;
}

/* ── Completion ──────────────────────────────────────────────────────────── */
.trivia-complete {
	text-align: center;
	padding: 8px 0 4px;
}

.complete-icon {
	font-size: 2rem;
	line-height: 1;
	margin-bottom: 8px;
}

.complete-message {
	font-family: var(--font-display);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--ink-100);
	margin-bottom: 4px;
}

.complete-stats {
	font-size: var(--fs-sm);
	color: var(--ink-500);
	margin-bottom: 14px;
}

.btn-restart {
	background: var(--brand);
	color: #fff;
}

.btn-restart:hover {
	background: var(--brand-dark);
}

/* ── Loading / error ─────────────────────────────────────────────────────── */
.trivia-loading,
.trivia-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 26px 0;
	font-size: var(--fs-sm);
	color: var(--ink-500);
	text-align: center;
}

.loading-spinner {
	width: 22px;
	height: 22px;
	border: 2px solid var(--line-soft);
	border-top-color: var(--brand);
	border-radius: 50%;
	animation: st-trivia-spin 0.8s linear infinite;
}

@keyframes st-trivia-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.loading-spinner {
		animation-duration: 2.4s;
	}

	.trivia-question-container,
	.trivia-answer,
	.trivia-btn {
		transition: none;
	}
}
