/**
 * Temporary gray placeholder + spinner while lazy images load.
 * After load, appearance matches the parent theme.
 */
.bahr-lazy-wrap {
	position: relative;
	background-color: #e8e8e8;
}

.bahr-lazy-wrap.is-loaded {
	background-color: transparent;
}

.bahr-lazy-wrap .bahr-lazy-spinner {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.bahr-lazy-wrap.is-loaded .bahr-lazy-spinner {
	opacity: 0;
	visibility: hidden;
}

.bahr-lazy-wrap .bahr-lazy-spinner::after {
	content: "";
	width: 28px;
	height: 28px;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-top-color: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	animation: bahr-spin 0.7s linear infinite;
}

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

.bahr-lazy-wrap img.bahr-lazy-img {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bahr-lazy-wrap.is-loaded img.bahr-lazy-img {
	opacity: 1;
}

/* Restore parent background-image after load — no layout overrides */
.post-image.bahr-lazy-wrap:not(.is-loaded) {
	background-image: none !important;
}

.post-image.bahr-lazy-wrap.is-loaded {
	background-image: var(--bahr-bg) !important;
}

@media (prefers-reduced-motion: reduce) {
	.bahr-lazy-wrap .bahr-lazy-spinner::after {
		animation: none;
	}

	.bahr-lazy-wrap img.bahr-lazy-img {
		transition: none;
	}
}
