/* =============================================================
   MortgageWire — rate-history.css
   Rate History Charts tool styles
   ============================================================= */


/* --- BACK NAV --- */
.rh-nav-back {
	margin-bottom: 20px;
}

.rh-nav-back a {
	font-size: 13px;
	color: #2176C7;
	transition: color 0.15s;
}

.rh-nav-back a:hover {
	color: #1A5FA0;
}


/* --- PAGE WRAPPER --- */
.rh-wrap {
	padding: 24px 24px 48px;
	max-width: 1200px;
	margin: 0 auto;
}


/* --- TITLE ROW --- */
.rh-title-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 20px;
	gap: 20px;
}

.rh-eyebrow {
	font-size: 10px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #999490;
	font-weight: 500;
	margin-bottom: 6px;
}

.rh-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 26px;
	font-weight: 400;
	color: #1A1A1A;
	letter-spacing: -0.3px;
	margin-bottom: 5px;
}

.rh-subtitle {
	font-size: 14px;
	color: #666660;
}

.rh-updated {
	text-align: right;
	flex-shrink: 0;
}

.rh-updated-label {
	font-size: 10px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #999490;
	margin-bottom: 3px;
}

.rh-updated-val {
	font-size: 13px;
	color: #666660;
}


/* --- CHART CARD --- */
.rh-chart-card {
	background: #ffffff;
	border-radius: 10px;
	border: 0.5px solid #E0DDD6;
	margin-bottom: 16px;
	overflow: hidden;
}


/* --- CHART HEADER --- */
.rh-chart-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 16px 20px 14px;
	border-bottom: 0.5px solid #F0EDE6;
	gap: 16px;
	flex-wrap: wrap;
}

.rh-chart-head-left {
	min-width: 0;
}

.rh-chart-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 16px;
	font-weight: 400;
	color: #1A1A1A;
	margin-bottom: 3px;
}

.rh-chart-source {
	font-size: 11px;
	color: #999490;
}

.rh-controls {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.rh-series-tabs,
.rh-range-tabs {
	display: flex;
	gap: 3px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.rh-tab,
.rh-range {
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 20px;
	border: 0.5px solid #D0CCC4;
	background: #F7F5F0;
	color: #666660;
	cursor: pointer;
	font-family: 'Source Sans 3', sans-serif;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
	white-space: nowrap;
}

.rh-tab:hover,
.rh-range:hover {
	background: #EAF2FC;
	color: #1A5FA0;
	border-color: #2176C7;
}

.rh-tab.on {
	background: #2176C7;
	color: #ffffff;
	border-color: #2176C7;
}

/* Compare mode — second series gets a teal accent */
.rh-tab.compare-on {
	background: #1A7A60;
	color: #ffffff;
	border-color: #1A7A60;
}

.rh-range.on {
	background: #2176C7;
	color: #ffffff;
	border-color: #2176C7;
}

/* Compare toggle button */
.rh-compare-toggle {
	font-size: 11px;
	padding: 4px 12px;
	border-radius: 20px;
	border: 0.5px solid #D0CCC4;
	background: #F7F5F0;
	color: #666660;
	cursor: pointer;
	font-family: 'Source Sans 3', sans-serif;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
	white-space: nowrap;
}

.rh-compare-toggle:hover {
	background: #EAF2FC;
	color: #1A5FA0;
	border-color: #2176C7;
}

.rh-compare-toggle.active {
	background: #F0FAF6;
	color: #1A7A60;
	border-color: #1A7A60;
}

.rh-controls-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.rh-controls-divider {
	width: 0.5px;
	height: 16px;
	background: #D0CCC4;
	flex-shrink: 0;
}


/* --- CHART CANVAS AREA --- */
.rh-chart-wrap {
	padding: 16px 20px 8px;
	position: relative;
}

.rh-chart-wrap canvas {
	width: 100%;
	display: block;
}

/* Legend for compare mode */
.rh-legend {
	display: none;
	align-items: center;
	gap: 16px;
	padding: 0 20px 12px;
	flex-wrap: wrap;
}

.rh-legend.visible {
	display: flex;
}

.rh-legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #666660;
}

.rh-legend-dot {
	width: 10px;
	height: 3px;
	border-radius: 2px;
	flex-shrink: 0;
}

.rh-legend-dot--primary   { background: #2176C7; }
.rh-legend-dot--secondary { background: #1A7A60; }

/* Tooltip */
.rh-tooltip {
	position: absolute;
	background: #0C2340;
	color: #ffffff;
	border-radius: 6px;
	padding: 8px 12px;
	pointer-events: none;
	z-index: 10;
	white-space: nowrap;
	display: none;
}

.rh-tt-date {
	font-size: 10px;
	color: #7AAAD8;
	margin-bottom: 4px;
}

.rh-tt-row {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 2px;
	font-size: 13px;
}

.rh-tt-row:last-child {
	margin-bottom: 0;
}

.rh-tt-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}

.rh-tt-dot--primary   { background: #5BA8F5; }
.rh-tt-dot--secondary { background: #4ABFA0; }

.rh-tt-label {
	font-size: 10px;
	color: #7AAAD8;
	flex: 1;
}

.rh-tt-val {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 14px;
	color: #ffffff;
}


/* --- STATS BAR --- */
.rh-stats {
	display: flex;
	gap: 0;
	border-top: 0.5px solid #F0EDE6;
}

.rh-stat {
	flex: 1;
	padding: 12px 16px;
	border-right: 0.5px solid #F0EDE6;
	text-align: center;
}

.rh-stat:last-child {
	border-right: none;
}

.rh-stat-label {
	font-size: 10px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: #999490;
	margin-bottom: 4px;
}

.rh-stat-val {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 17px;
	font-weight: 400;
	color: #1A1A1A;
}

.rh-stat-val--high  { color: #C0402A; }
.rh-stat-val--low   { color: #2A8A5A; }


/* --- DIRECTION COLORS --- */
.up   { color: #C0402A; }
.dn   { color: #2A8A5A; }
.flat { color: #999490; }


/* --- CURRENT RATES STRIP --- */
.rh-rates-strip {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
	margin-bottom: 16px;
}

.rh-rate-card {
	background: #ffffff;
	border-radius: 10px;
	border: 0.5px solid #E0DDD6;
	padding: 14px 16px;
	cursor: pointer;
	transition: border-color 0.12s, box-shadow 0.12s;
}

.rh-rate-card:hover {
	border-color: #2176C7;
}

.rh-rate-card.active {
	border-color: #2176C7;
	box-shadow: 0 0 0 2px rgba(33, 118, 199, 0.12);
}

.rh-rate-card.compare-active {
	border-color: #1A7A60;
	box-shadow: 0 0 0 2px rgba(26, 122, 96, 0.12);
}

.rh-rc-label {
	font-size: 10px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #999490;
	margin-bottom: 6px;
}

.rh-rc-val {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 22px;
	font-weight: 400;
	color: #0C2340;
	letter-spacing: -0.5px;
	line-height: 1;
	margin-bottom: 4px;
}

.rh-rc-chg {
	font-size: 11px;
	font-weight: 500;
}


/* --- CONTEXT --- */
.rh-context {
	background: #F7F5F0;
	border-radius: 10px;
	border: 0.5px solid #E0DDD6;
	padding: 16px 20px;
}

.rh-context-head {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #999490;
	margin-bottom: 8px;
}

.rh-context-body {
	font-size: 12px;
	color: #888880;
	line-height: 1.7;
}


/* --- NO DATA STATE --- */
.rh-no-data {
	background: #ffffff;
	border-radius: 10px;
	border: 0.5px dashed #D0CCC4;
	padding: 56px 24px;
	text-align: center;
	margin-bottom: 16px;
}

.rh-no-data-icon {
	margin: 0 auto 16px;
	width: 40px;
	height: 40px;
	color: #C0BCB6;
}

.rh-no-data-icon svg {
	width: 40px;
	height: 40px;
}

.rh-no-data-hed {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 17px;
	font-weight: 400;
	color: #666660;
	margin-bottom: 8px;
}

.rh-no-data-sub {
	font-size: 13px;
	color: #999490;
	max-width: 420px;
	margin: 0 auto;
	line-height: 1.6;
}


/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
	.rh-rates-strip {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.rh-wrap {
		padding: 18px 16px 32px;
	}

	.rh-title-row {
		flex-direction: column;
		align-items: flex-start;
		margin-bottom: 16px;
	}

	.rh-updated {
		text-align: left;
	}

	.rh-rates-strip {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.rh-chart-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.rh-controls {
		width: 100%;
		align-items: flex-start;
	}

	.rh-controls-row {
		justify-content: flex-start;
	}

	.rh-series-tabs,
	.rh-range-tabs {
		justify-content: flex-start;
	}

	.rh-stats {
		flex-wrap: wrap;
	}

	.rh-stat {
		flex: 1 1 33%;
		border-right: none;
		border-bottom: 0.5px solid #F0EDE6;
	}

	.rh-stat:last-child {
		border-bottom: none;
	}
}

@media (max-width: 480px) {
	.rh-rates-strip {
		grid-template-columns: 1fr 1fr;
	}

	.rh-rc-val {
		font-size: 19px;
	}

	.rh-title {
		font-size: 22px;
	}

	.rh-stat {
		flex: 1 1 50%;
	}
}
