/* ASTRA Stock Widget
 * Brand tokens only. Bitcoin Orange is reserved for the logo center node and
 * is intentionally never used here. Chart fills use Horizon Blue (the brand
 * data-visual color). No gradients.
 */

.astra-stock {
	--astra-navy: #0D2E5C;
	--astra-indigo: #0A1F3F;
	--astra-white: #F0EDE8;
	--astra-gold: #C9A84C;
	--astra-azure: #1A5FAD;
	--astra-horizon: #2AACEB;
	--astra-platinum: #B0B8C4;
	--astra-gunmetal: #3D4F60;

	/* Directional cues kept inside the brand palette by default.
	 * Swap to conventional red/green here only if compliance allows. */
	--astra-up: var(--astra-gold);
	--astra-down: var(--astra-platinum);

	--astra-serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
	--astra-sans: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;

	box-sizing: border-box;
	background: var(--astra-navy);
	color: var(--astra-white);
	font-family: var(--astra-sans);
	border-radius: 4px;
	padding: 28px 30px;
	border-left: 3px solid var(--astra-gold);
}

.astra-stock *,
.astra-stock *::before,
.astra-stock *::after {
	box-sizing: border-box;
}

.astra-stock__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.astra-stock__label {
	display: block;
	font-family: var(--astra-sans);
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 12px;
	color: var(--astra-gold);
}

.astra-stock__sym {
	display: block;
	font-size: 12px;
	font-weight: 300;
	color: var(--astra-platinum);
	letter-spacing: 0.06em;
	margin-top: 4px;
}

.astra-stock__quote {
	text-align: right;
}

.astra-stock__price {
	font-family: var(--astra-serif);
	font-weight: 600;
	font-size: 34px;
	line-height: 1;
	color: var(--astra-white);
}

.astra-stock__price--lg {
	display: block;
	font-size: 42px;
	margin: 10px 0 6px;
}

.astra-stock__change {
	display: inline-block;
	font-family: var(--astra-sans);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	margin-top: 6px;
}

.astra-stock__change--up { color: var(--astra-up); }
.astra-stock__change--down { color: var(--astra-down); }
.astra-stock__change--flat { color: var(--astra-platinum); }

.astra-stock__canvas-wrap {
	position: relative;
	width: 100%;
}

.astra-stock__canvas-wrap canvas {
	width: 100% !important;
}

.astra-stock__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 300;
	letter-spacing: 0.04em;
	color: var(--astra-platinum);
}

.astra-stock__loading[hidden] { display: none; }

.astra-stock__foot {
	margin-top: 14px;
}

.astra-stock__updated {
	font-size: 11px;
	font-weight: 300;
	letter-spacing: 0.06em;
	color: var(--astra-gunmetal);
}

.astra-stock__updated[data-stale="1"] { color: var(--astra-gold); }

.astra-stock__note {
	margin: 14px 0 0;
	padding-top: 14px;
	border-top: 1px solid rgba(176, 184, 196, 0.18);
	font-size: 11px;
	font-weight: 300;
	line-height: 1.5;
	letter-spacing: 0.02em;
	color: var(--astra-gunmetal);
}

/* Price stat tiles: square, top-aligned, sized to fit the value */
.astra-stock--price {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	align-items: start;
}

.astra-stock--price .astra-stock__card {
	container-type: inline-size;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 1 / 1;
	min-width: 0;
	background: var(--astra-indigo);
	border-left: 3px solid var(--astra-gold);
	border-radius: 3px;
	padding: 8% 9%;
	overflow: hidden;
}

.astra-stock--price .astra-stock__price--lg {
	margin: 0;
	font-size: clamp(1.05rem, 15cqi, 2rem);
	white-space: nowrap;
}

.astra-stock--price .astra-stock__change {
	margin-top: 0;
	font-size: clamp(0.62rem, 6.5cqi, 0.8125rem);
}

.astra-stock--price .astra-stock__foot,
.astra-stock--price .astra-stock__note {
	grid-column: 1 / -1;
}

@media (max-width: 560px) {
	.astra-stock--price { grid-template-columns: 1fr; }
	.astra-stock--price .astra-stock__card { aspect-ratio: auto; padding: 20px 22px; }
	.astra-stock--price .astra-stock__price--lg { font-size: 34px; }
	.astra-stock__price { font-size: 28px; }
	.astra-stock__price--lg { font-size: 34px; }
}

/* Range selector */
.astra-stock__ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 4px 0 16px;
}

.astra-stock__range {
	appearance: none;
	cursor: pointer;
	font-family: var(--astra-sans);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.06em;
	line-height: 1;
	color: var(--astra-platinum);
	background: transparent;
	border: 1px solid rgba(176, 184, 196, 0.28);
	border-radius: 3px;
	padding: 7px 11px;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.astra-stock__range:hover {
	color: var(--astra-white);
	border-color: var(--astra-platinum);
}

.astra-stock__range:focus-visible {
	outline: 2px solid var(--astra-gold);
	outline-offset: 1px;
}

.astra-stock__range.is-active {
	color: var(--astra-navy);
	background: var(--astra-gold);
	border-color: var(--astra-gold);
}
