/**
 * MLS Genie — market figures that load after the page (mlsg-market-async.js).
 * Loaded only on pages that show one.
 */

.mlsg-async-load {
	display: inline-flex;
	align-items: baseline;
	min-width: 0;
	vertical-align: baseline;
	transition: opacity 250ms ease-in-out;
}

.mlsg-async-load.mlsg-async-block {
	display: flex;
	width: 100%;
	min-width: 0;
	min-height: 40px;
	align-items: center;
	justify-content: center;
}

.mlsg-async-load.is-swapping {
	opacity: 0;
}

.mlsg-async-load.is-loaded {
	opacity: 1;
}

/* Seeded with a cached value: show it dimmed until live data lands. */
.mlsg-async-load.mlsg-async-seeded {
	opacity: 0.5;
}

/* Seeded chart: show the cached chart under a shimmer sweep. */
.mlsg-async-load.mlsg-async-seeded-chart {
	position: relative;
	overflow: hidden;
}

.mlsg-async-load.mlsg-async-seeded-chart::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
	transform: translateX(-100%);
	animation: mlsg-shimmer 1.4s ease-in-out infinite;
	pointer-events: none;
	z-index: 2;
}

@keyframes mlsg-shimmer {
	100% {
		transform: translateX(100%);
	}
}

.mlsg-mr .mlsg-async-load {
	justify-content: normal;
}

.mlsg-spinner {
	width: 20px;
	height: 20px;
	border: 4px solid rgba(0, 0, 0, 0.12);
	border-top-color: #b4b4b4;
	border-radius: 50%;
	animation: mlsg-rotate 0.75s linear infinite;
	display: block;
	margin: auto;
}

@keyframes mlsg-rotate {
	to {
		transform: rotate(360deg);
	}
}

.mlsg-async-empty {
	font-size: 13px;
	opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
	.mlsg-spinner,
	.mlsg-async-load.mlsg-async-seeded-chart::after {
		animation: none;
	}
}

/* A shortcode asked for something it cannot show. */
.mlsg-market-notice {
	margin: 8px 0;
	padding: 10px 14px;
	border-left: 4px solid #dba617;
	border-radius: 4px;
	background: #fff8e5;
}
