/* ============================================================
   PM Image Zoom — Stylesheet
   Plugin:  PM Image Zoom
   Author:  Public Methods
   ============================================================ */

/* Zoomable cursor on eligible images */
.pm-zoomable {
	cursor: zoom-in;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.pm-zoomable:hover {
	opacity: 0.88;
}

/* ── Overlay ── */
#pm-zoom-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	/* background set via JS from plugin settings */
	background: rgba(0, 0, 0, 0.85);
	overflow: auto;
}

#pm-zoom-overlay.pm-active {
	display: flex;
}

/* ── Close button ── */
#pm-zoom-close {
	position: fixed;
	top: 16px;
	right: 20px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
	z-index: 1000001;
	padding: 0;
}

#pm-zoom-close:hover,
#pm-zoom-close:focus {
	background: rgba(255, 255, 255, 0.25);
	transform: rotate(90deg);
	outline: none;
}

/* ── Image container ── */
#pm-zoom-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 100%;
}

/* ── Zoomed image ── */
#pm-zoom-img {
	display: block;
	max-width: 94vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
	cursor: zoom-out;

	/* Initial state for animation */
	opacity: 0;
	transform: scale(0.88);
	transition: opacity 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
	            transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Fade-only animation variant ── */
#pm-zoom-overlay.pm-anim-fade #pm-zoom-img {
	transform: none;
	transition: opacity 0.28s ease;
}

/* ── Visible state ── */
#pm-zoom-img.pm-visible {
	opacity: 1;
	transform: scale(1);
}

#pm-zoom-overlay.pm-anim-fade #pm-zoom-img.pm-visible {
	transform: none;
}

/* ── Caption ── */
#pm-zoom-caption {
	margin: 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	text-align: center;
	max-width: 600px;
	line-height: 1.5;
}

#pm-zoom-caption:empty {
	display: none;
}

/* ── Scrollbar hiding for overlay on small screens ── */
@media (max-width: 600px) {
	#pm-zoom-close {
		top: 10px;
		right: 10px;
		width: 36px;
		height: 36px;
		font-size: 20px;
	}

	#pm-zoom-img {
		max-width: 100%;
		max-height: 80vh;
	}
}
