/*!
 * MLS Genie™ — Full Market Report Stylesheet
 *
 * Scoped under .mlsg-mr root. All colours derive from the CSS custom
 * properties set inline on the wrapper:
 *   --mr-brand-primary, --mr-brand-secondary, --mr-brand-neutral,
 *   --mr-brand-primary-soft, --mr-brand-primary-alpha,
 *   --mr-brand-secondary-soft, --mr-brand-success, --mr-brand-danger,
 *   --mr-text-on-primary, --mr-text-on-neutral
 *
 * These are populated server-side from Genie CRM Settings → Company Info.
 * BEM naming convention; !important reserved for overriding third-party
 * theme bleed.
 */

.mlsg-mr {
	font-family: inherit;
	color: #1f2937;
	line-height: 1.55;
	max-width: 1180px;
	margin: 0 auto;
}

.mlsg-mr * { box-sizing: border-box; }

/* Section + headings */
.mlsg-mr-section {
	margin-bottom: 28px;
}
.mlsg-mr-h1 {
	margin: 0 0 8px;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.18;
	color: var(--mr-brand-primary);
	letter-spacing: -0.01em;
}
.mlsg-mr-h2 {
	margin: 0 0 16px;
	font-size: 22px;
	font-weight: 700;
	color: var(--mr-brand-primary);
}
.mlsg-mr-h3 {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 600;
	color: var(--mr-brand-primary);
}
.mlsg-mr-lede {
	margin: 0 0 14px;
	font-size: 15px;
	color: #4b5563;
}
.mlsg-mr-eyebrow {
	display: inline-block;
	margin-bottom: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--mr-brand-primary-soft);
	color: var(--mr-brand-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Hero */
.mlsg-mr-hero {
	display: grid;
	grid-template-columns: 1.35fr 0.85fr;
	gap: 18px;
	align-items: stretch;
}
.mlsg-mr-hero-main {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 28px;
}
.mlsg-mr-hero-side {
	background: var(--mr-brand-primary);
	color: var(--mr-text-on-primary);
	border-radius: 16px;
	padding: 22px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.mlsg-mr-hero-side .mlsg-mr-mai-toplabel,
.mlsg-mr-hero-side .mlsg-mr-mai-label,
.mlsg-mr-hero-side .mlsg-mr-mos-label {
	color: var(--mr-text-on-primary);
	opacity: 0.85;
}
.mlsg-mr-hero-side .mlsg-mr-mai-score,
.mlsg-mr-hero-side .mlsg-mr-mos-value {
	color: var(--mr-text-on-primary);
}
.mlsg-mr-hero-side .mlsg-mr-help {
	background: rgba(255, 255, 255, 0.18);
	color: var(--mr-text-on-primary);
}
.mlsg-mr-headline-stat {
	margin-top: 18px;
}
.mlsg-mr-headline-label {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 4px;
}
.mlsg-mr-headline-value {
	font-size: 32px;
	font-weight: 700;
	color: var(--mr-card-text, #0f172a);
	line-height: 1.15;
}

/* Pills */
.mlsg-mr-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}
.mlsg-mr-pill {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 999px;
	background: #f3f4f6;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
}

/* Market Action Index sidebar */
.mlsg-mr-mai-toplabel {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.mlsg-mr-mai-score {
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
	margin: 8px 0 4px;
}
.mlsg-mr-mai-label {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 14px;
}
.mlsg-mr-mos {
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.mlsg-mr-mos-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin-bottom: 4px;
}
.mlsg-mr-mos-value {
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}

/* Snapshot grid */
.mlsg-mr-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}
.mlsg-mr-grid.mlsg-mr-grid-3 {
	grid-template-columns: repeat(3, 1fr);
}
.mlsg-mr-metric {
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: center;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px 18px;
	min-width: 0;
}
.mlsg-mr-metric-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #6b7280;
	margin-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	line-height: 1.3;
}
.mlsg-mr-metric-value {
	font-size: 22px;
	font-weight: 700;
	color: var(--mr-card-text, #0f172a);
	line-height: 1.15;
}

/* Narrative + buyer/seller */
.mlsg-mr-narrative {
	background: var(--mr-brand-primary-soft);
	padding: 22px 26px;
	border-radius: 12px;
	font-size: 16px;
	line-height: 1.65;
}
.mlsg-mr-narrative p {
	margin: 0 0 12px;
	color: #1f2937;
}
.mlsg-mr-narrative p:last-child {
	margin-bottom: 0;
}
.mlsg-mr-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.mlsg-mr-side-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 22px 24px;
}
.mlsg-mr-side-card p {
	margin: 0;
	color: #4b5563;
	font-size: 15px;
	line-height: 1.6;
}

/* Charts */
.mlsg-mr-charts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.mlsg-mr-chart {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px;
	min-width: 0;
}
.mlsg-mr-chart-label {
	font-size: 14px;
	font-weight: 700;
	color: var(--mr-brand-primary);
	margin-bottom: 8px;
}
.mlsg-mr-chart .mlsg-async-load,
.mlsg-mr-chart .mlsg-async-block {
	display: block;
	min-height: 220px;
}

/* Segments table */
.mlsg-mr-segments-wrap {
	overflow-x: auto;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #ffffff;
}
.mlsg-mr-segments {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.mlsg-mr-segments thead th {
	background: var(--mr-brand-primary-soft);
	color: var(--mr-brand-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}
.mlsg-mr-segments tbody td {
	padding: 14px;
	border-bottom: 1px solid #f1f3f5;
	color: #1f2937;
	white-space: nowrap;
}
.mlsg-mr-segments tbody tr:last-child td {
	border-bottom: none;
}
.mlsg-mr-tier-label {
	font-weight: 700;
	color: var(--mr-brand-primary);
}
.mlsg-mr-tier-empty {
	color: #9ca3af;
	font-style: italic;
}

/* FAQs */
.mlsg-mr-faqs .mlsg-mr-faq {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 14px 18px;
	margin-bottom: 10px;
}
.mlsg-mr-faqs .mlsg-mr-faq summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--mr-brand-primary);
	font-size: 15px;
	list-style: none;
}
.mlsg-mr-faqs .mlsg-mr-faq summary::-webkit-details-marker {
	display: none;
}
.mlsg-mr-faqs .mlsg-mr-faq summary::before {
	content: "›";
	display: inline-block;
	margin-right: 10px;
	transition: transform 0.2s ease;
	color: var(--mr-brand-secondary);
	font-weight: 700;
}
.mlsg-mr-faqs .mlsg-mr-faq[open] summary::before {
	transform: rotate(90deg);
}
.mlsg-mr-faq-body {
	margin-top: 10px;
	color: #4b5563;
	font-size: 15px;
	line-height: 1.65;
}

/* Footnote */
.mlsg-mr-footnote {
	margin-top: 24px;
	padding: 14px 18px;
	border-top: 1px solid #e5e7eb;
	font-size: 12px;
	color: #6b7280;
	line-height: 1.55;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}
.mlsg-mr-footnote .mlsg-credit {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	font-size: 11px;
	color: #9ca3af;
	white-space: nowrap;
}
.mlsg-mr-footnote .mlsg-credit a {
	display: inline-flex;
	align-items: center;
	opacity: 0.65;
	transition: opacity 160ms ease;
	text-decoration: none;
	border-bottom: none;
}
.mlsg-mr-footnote .mlsg-credit a:hover,
.mlsg-mr-footnote .mlsg-credit a:focus {
	opacity: 1;
}
.mlsg-mr-footnote .mlsg-credit .mlsg-logo-small {
	height: 16px;
	width: auto;
	display: block;
}

/* Strip the default .mlsg-card chrome when nested inside a market report
 * (e.g. chart panels rendered by the existing market-data shortcodes).
 * The market report provides its own card framing so the inner card's
 * border + padding + shared footer + disclaimer are redundant. */
.mlsg-mr .mlsg-card {
	border: none;
	padding: 0;
}
.mlsg-mr .mlsg-card .mlsg-shared-footer,
.mlsg-mr .mlsg-card .mlsg-data-disclaimer {
	display: none;
}

/* When the standalone [mls_market_action_index] output appears inside the
 * full report (rare — the hero uses its own markup), its inline separator
 * dot looks redundant against the hero's stacked layout. Hide it. */
.mlsg-mr .mlsg-mr-mai-sep { display: none; }

/* Housing Stock — age distribution rows */
.mlsg-mr-age-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 6px;
}
.mlsg-mr-age-row {
	display: grid;
	grid-template-columns: 200px 1fr 56px;
	align-items: center;
	gap: 14px;
	padding: 8px 12px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: help;
}
.mlsg-mr-age-label {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.mlsg-mr-age-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--mr-brand-primary);
	line-height: 1.2;
}
.mlsg-mr-age-range {
	font-size: 12px;
	color: #6b7280;
	line-height: 1.2;
	margin-top: 2px;
}
.mlsg-mr-age-bar {
	position: relative;
	height: 10px;
	background: var(--mr-brand-neutral);
	border-radius: 999px;
	overflow: hidden;
}
.mlsg-mr-age-bar-fill {
	display: block;
	height: 100%;
	background: var(--mr-brand-secondary);
	border-radius: 999px;
	transition: width 0.4s ease;
}
.mlsg-mr-age-pct {
	font-size: 14px;
	font-weight: 700;
	color: var(--mr-brand-primary);
	text-align: right;
}

/* Help icon (?) */
.mlsg-mr-help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--mr-brand-neutral);
	color: var(--mr-brand-primary);
	font-size: 11px;
	font-weight: 700;
	cursor: help;
	margin-left: 4px;
	user-select: none;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
}
.mlsg-mr-help:hover {
	background: var(--mr-brand-primary);
	color: var(--mr-text-on-primary);
}

/* Empty state */
.mlsg-mr-empty {
	padding: 28px;
	text-align: center;
	color: #9ca3af;
	background: #ffffff;
	border: 1px dashed #e5e7eb;
	border-radius: 12px;
}

/* Hero side state colour overrides — tints the sidebar based on market state */
.mlsg-mr-state-strong_buyer  { background: var(--mr-brand-primary); }
.mlsg-mr-state-buyer         { background: var(--mr-brand-primary); }
.mlsg-mr-state-balanced      { background: var(--mr-brand-primary); }
.mlsg-mr-state-seller        { background: var(--mr-brand-primary); }
.mlsg-mr-state-strong_seller { background: var(--mr-brand-primary); }

/* Responsive */
@media (max-width: 980px) {
	.mlsg-mr-hero {
		grid-template-columns: 1fr;
	}
	.mlsg-mr-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.mlsg-mr-grid.mlsg-mr-grid-3 {
		grid-template-columns: repeat(2, 1fr);
	}
	.mlsg-mr-charts {
		grid-template-columns: 1fr;
	}
	.mlsg-mr-age-row {
		grid-template-columns: 160px 1fr 48px;
	}
}
@media (max-width: 720px) {
	.mlsg-mr-h1 { font-size: 26px; }
	.mlsg-mr-h2 { font-size: 19px; }
	.mlsg-mr-headline-value { font-size: 26px; }
	.mlsg-mr-mai-score { font-size: 44px; }
	.mlsg-mr-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.mlsg-mr-grid.mlsg-mr-grid-3 {
		grid-template-columns: 1fr;
	}
	.mlsg-mr-two-col {
		grid-template-columns: 1fr;
	}
	.mlsg-mr-hero-main,
	.mlsg-mr-hero-side {
		padding: 20px;
	}
	.mlsg-mr-age-row {
		grid-template-columns: 130px 1fr 44px;
		gap: 10px;
	}
}
@media (max-width: 460px) {
	.mlsg-mr-grid {
		grid-template-columns: 1fr;
	}
	.mlsg-mr-age-row {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.mlsg-mr-age-pct {
		text-align: left;
	}
}
