/* =========================================================
   Magnetic Gallery — CSS
   ========================================================= */

/* ---------- Wrapper ---------- */
.mg-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
	font-family: inherit;
}

/* ---------- Canvas ---------- */
.mg-canvas {
	display: block;
	width: 100%;
	height: 640px; /* overridden by inline style per widget */
	cursor: crosshair;
	touch-action: none;
	transition: filter 0.35s ease;
}

.mg-wrapper--lb-open .mg-canvas {
	filter: blur(6px) brightness(0.4);
}

/* ---------- HUD Buttons (Snap / Gyro) ---------- */
.mg-snap-btn,
.mg-gyro-btn {
	position: absolute;
	bottom: 18px;
	right: 18px;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.10);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	transition: background 0.2s, transform 0.15s;
	z-index: 10;
}

.mg-gyro-btn {
	right: 72px;
}

.mg-snap-btn:hover,
.mg-gyro-btn:hover {
	background: rgba(255, 255, 255, 0.22);
	transform: scale(1.08);
}

.mg-snap-btn svg,
.mg-gyro-btn svg {
	width: 100%;
	height: 100%;
}

/* ---------- Editor hint (Elementor backend preview) ---------- */
.mg-editor-hint {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: rgba(255,255,255,0.6);
	pointer-events: none;
}

.mg-editor-hint span {
	font-size: 1.25rem;
	font-weight: 600;
}

.mg-editor-hint small {
	font-size: 0.8rem;
	opacity: 0.7;
}

/* ---------- Lightbox ---------- */
.mg-lightbox {
	--mg-lb-bg: rgba(0, 0, 0, 0.94); /* overridden per widget */
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.mg-lightbox[aria-hidden="false"] {
	opacity: 1;
	pointer-events: auto;
}

.mg-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: var(--mg-lb-bg);
	cursor: pointer;
}

.mg-lightbox__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transform: scale(0.86);
	transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
	max-width: 90vw;
}

.mg-lightbox[aria-hidden="false"] .mg-lightbox__panel {
	transform: scale(1);
}

.mg-lightbox__img {
	display: block;
	max-width: 90vw;
	max-height: 82vh;
	border-radius: 6px;
	box-shadow: 0 40px 120px rgba(0,0,0,0.8);
	object-fit: contain;
}

@media (max-width: 767px) {
	.mg-lightbox__img {
		max-width: 95vw;
		max-height: 78vh;
	}
}

.mg-lightbox__caption {
	margin: 0;
	color: rgba(255,255,255,0.72);
	font-size: 0.875rem;
	text-align: center;
	letter-spacing: 0.02em;
	max-width: 72ch;
	line-height: 1.5;
}

/* ---------- Close button ---------- */
.mg-lightbox__close {
	position: absolute;
	top: -48px;
	right: 0;
	width: 38px;
	height: 38px;
	border: none;
	cursor: pointer;
	color: #ffffff;
	padding: 7px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.15s;
}

.mg-lightbox__close--circle {
	background: rgba(255,255,255,0.15);
	border-radius: 50%;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.mg-lightbox__close--x-only {
	background: transparent;
}

.mg-lightbox__close:hover {
	background: rgba(255,255,255,0.28);
	transform: scale(1.12);
}

.mg-lightbox__close svg {
	width: 100%;
	height: 100%;
}
