/* ==========================================================================
   Investor Quotes — rotating quotation card
   --------------------------------------------------------------------------
   Redesigned for Sovereign Terminal. Class names are unchanged from the
   soledad-child original because investor-quotes.js writes this markup.

   The card is placed in the dark footer's middle column, so it is authored
   light-on-dark and takes its colours from --iq-* locals. Dropped into a light
   surface (a post body, a sidebar) the .investor-quotes-container--light
   modifier flips those four values and nothing else has to change.
   ========================================================================== */

.investor-quotes-container {
	--iq-ink: rgba(255, 255, 255, 0.94);
	--iq-muted: rgba(255, 255, 255, 0.58);
	--iq-line: rgba(255, 255, 255, 0.14);
	--iq-surface: rgba(255, 255, 255, 0.04);

	display: block;
	max-width: 100%;
}

.investor-quotes-container--light {
	--iq-ink: var(--ink-100);
	--iq-muted: var(--ink-500);
	--iq-line: var(--line-soft);
	--iq-surface: var(--navy-850);
}

/* A flex column, so the quote stack inside can claim the leftover space when a
   host stretches this card — see .quotes-container's `flex: 1`. Without this
   the stack would ignore the extra height and sit at the top. */
.investor-quotes-widget {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--iq-surface);
	border: 1px solid var(--iq-line);
	border-radius: var(--radius);
	padding: 26px 22px;
	font-family: var(--font-body);
	color: var(--iq-ink);
}

/* ── Quote stack ─────────────────────────────────────────────────────────── */
/* Slides are stacked in the same box and cross-faded, so the card's height is
   set by the tallest quote and never jumps as they rotate. This container is
   the vertical layout: the slide stage, then the progress bar, then the dots. */
.quotes-container {
	display: flex;
	flex-direction: column;
	/* Grows when a host stretches the widget (the footer column does), so the
	   quote stays optically centred rather than pinned to the top of a tall
	   card. Harmless at natural height, where there is nothing to absorb. */
	flex: 1;
	min-height: 150px;
}

/* The slide stack. This — not .quotes-container — is the positioning context
   for the cross-faded quotes, so `inset: 0` covers only the quote area and
   leaves the progress bar and dots below it untouched. Previously the slides
   were positioned against the whole container and painted straight over both. */
.quotes-stage {
	position: relative;
	flex: 1;
	min-height: 110px;
}

.quote-content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
		visibility var(--dur) var(--ease);
}

.quote-content.active {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* The decorative open-quote mark above each quotation. */
.quote-content::before {
	content: "\201C";
	display: block;
	font-family: var(--font-display);
	font-size: 2.6rem;
	line-height: 0.8;
	color: var(--brand);
	margin-bottom: 10px;
}

.quote-text {
	font-family: var(--font-display);
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: -0.005em;
	color: var(--iq-ink);
	margin: 0 0 12px;
}

.quote-author {
	font-size: var(--fs-micro);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--iq-muted);
	margin: 0;
}

/* Small em-dash lead-in before the attribution. */
.quote-author::before {
	content: "— ";
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
/* A sibling of the slide stage, so it is never covered by the slides. */
.quote-progress {
	position: relative;
	height: 2px;
	margin-top: 16px;
	background: var(--iq-line);
	border-radius: var(--radius-pill);
	overflow: hidden;
}

.quote-progress-bar {
	height: 100%;
	width: 0;
	background: var(--brand);
	border-radius: inherit;
	transition: width 0.1s linear;
}

/* ── Dots ────────────────────────────────────────────────────────────────── */
.quote-dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 14px;
}

.quote-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--iq-line);
	cursor: pointer;
	transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.quote-dot:hover {
	background: var(--iq-muted);
}

.quote-dot.active {
	background: var(--brand);
	transform: scale(1.35);
}

.quote-dot:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
}

/* ── Loading / error ─────────────────────────────────────────────────────── */
.quotes-loading,
.quotes-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 150px;
	font-size: var(--fs-sm);
	color: var(--iq-muted);
	text-align: center;
}

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

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

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

	.quote-content,
	.quote-dot,
	.quote-progress-bar {
		transition: none;
	}
}
