/**
 * Markets page ([ainn_markets]). Uses the theme's custom properties, with fallbacks.
 * Selectors are doubled up (.markets .x) to beat the theme's .entry-content heading/list rules.
 */
/* minmax(0, 1fr): an implicit auto column would grow to the forex table's min-content and push the page wider than the phone. */
.markets { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7, 48px); }
.markets .markets__block > h2,
.markets .markets__card > h2 {
	margin: 0 0 var(--s-2, 8px);
	color: var(--heading, #082577);
	font-size: var(--fs-4, 1.25rem);
}
.markets h2 small { color: var(--muted, #5f6b7a); font-size: var(--fs-7, 0.875rem); font-weight: 500; }
.markets__block,
.markets__card { scroll-margin-top: calc(var(--sticky-h, 56px) + 16px); }
.markets__meta,
.markets__empty {
	margin: 0 0 var(--s-3, 12px);
	color: var(--muted, #5f6b7a);
	font-size: var(--fs-7, 0.875rem);
}
.markets__card .markets__meta { margin: var(--s-3, 12px) 0 0; }

/* Exchange rates */
/* position: relative so the table's screen-reader-only spans are clipped by the wrapper, not the page. */
.markets__table-wrap { position: relative; overflow-x: auto; }
.markets__table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}
.markets__table th,
.markets__table td {
	padding: var(--s-2, 8px) var(--s-3, 12px);
	border-bottom: 1px solid var(--line, #e3e8ef);
	text-align: right;
	white-space: nowrap;
}
.markets__table thead th {
	color: var(--muted, #5f6b7a);
	font: 500 var(--fs-7, 0.875rem) / 1.4 var(--font-ui, sans-serif);
}
.markets__table th[scope="row"],
.markets__table thead th:first-child {
	text-align: left;
	font-weight: 500;
	white-space: normal;
}
.markets__iso {
	display: inline-block;
	min-width: 3.2em;
	color: var(--blue, #0B5ED3);
	font: 700 var(--fs-7, 0.875rem) / 1 var(--font-ui, sans-serif);
}

.markets__chg { font: 700 var(--fs-7, 0.875rem) / 1 var(--font-ui, sans-serif); white-space: nowrap; }
.markets__chg.is-up { color: var(--success-text, #15803d); }
.markets__chg.is-down { color: var(--live, #D5040A); }

/* Gold / NEPSE cards */
.markets__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: var(--gutter, 24px);
}
.markets__card {
	padding: var(--s-5, 24px);
	border: 1px solid var(--line, #e3e8ef);
	border-radius: var(--radius, 4px);
	background: var(--bg-soft, #f5f7fa);
}
.markets__card p { margin: 0; }
.markets .markets__list { display: grid; gap: var(--s-2, 8px); margin: 0; }
.markets__list div {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s-2, 8px);
}
.markets__list dt { color: var(--text, #2b303b); }
.markets__list dd {
	margin: 0;
	color: var(--heading, #082577);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.markets__big {
	color: var(--heading, #082577);
	font-size: var(--fs-1, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

/* Weather */
.markets .markets__weather {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
	gap: var(--s-3, 12px);
	margin: 0 0 var(--s-3, 12px);
	padding: 0;
	list-style: none;
}
.markets .markets__weather > li {
	margin: 0;
	display: grid;
	gap: 2px;
	padding: var(--s-3, 12px) var(--s-4, 16px);
	border: 1px solid var(--line, #e3e8ef);
	border-radius: var(--radius, 4px);
}
.markets__city { color: var(--heading, #082577); font-weight: 700; }
.markets__temp { color: var(--heading, #082577); font-size: var(--fs-2, 1.75rem); font-weight: 700; line-height: 1.2; }
.markets__sky { color: var(--text, #2b303b); font-size: var(--fs-7, 0.875rem); }
.markets__range { color: var(--muted, #5f6b7a); font-size: var(--fs-7, 0.875rem); }
