/* ==========================================================================
   SLR Popup — Frontend Styles
   Target classes: .slr-popup-overlay  .slr-popup-box  .slr-popup-close
   ========================================================================== */

/* Overlay — covers the full viewport */
.slr-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;

	/* Hidden by default; revealed by .is-visible */
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.25s ease,
		visibility 0s linear 0.25s;
}

.slr-popup-overlay.is-visible {
	opacity: 1;
	visibility: visible;
	transition:
		opacity 0.25s ease,
		visibility 0s linear 0s;
}

/* Popup container — height-driven; width follows the image naturally */
.slr-popup-box {
	position: relative;
	line-height: 0; /* removes inline gap below image */
	overflow: hidden;
	border-radius: 6px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Image — drives the box dimensions; never stretches or scrolls */
.slr-popup-img {
	display: block;
	height: 90vh;
	width: auto;
	max-width: 95vw;
	object-fit: contain;
}

/* Close button — perfect circle, red border, colour-agnostic × */
.slr-popup-close {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	width: 2rem;
	height: 2rem;
	min-width: 2rem; /* prevent flexbox from squashing it */
	padding: 0;
	border: 2px solid #e02020;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition:
		background 0.2s ease,
		border-color 0.2s ease;
}

.slr-popup-close:hover,
.slr-popup-close:focus {
	background: rgba(224, 32, 32, 0.85);
	border-color: #ff4444;
}

.slr-popup-close:focus {
	outline: 2px solid #ff4444;
	outline-offset: 3px;
}

/* Responsive */
@media (max-width: 480px) {
	.slr-popup-img {
		height: auto;
		width: 95vw;
		max-width: 95vw;
	}
}
