/* Magnitof Gallery styles */
.mgnf-gallery__wrap { width: 100%; }
.mgnf-gallery {
	--mgnf-cols: 3;
	--mgnf-gap: 12px;
	display: grid;
	grid-template-columns: repeat(var(--mgnf-cols), 1fr);
	gap: var(--mgnf-gap);
}
/* Grid (fixed aspect) */
.mgnf-gallery--grid .mgnf-gallery__ratio {
	position: relative;
	width: 100%;
}
.mgnf-gallery--grid .mgnf-gallery__ratio::before {
	content: "";
	display: block;
	width: 100%;
	/* aspect set inline by JS via style="--ratio:..." using aspect-ratio where supported */
}
.mgnf-gallery--grid .mgnf-gallery__ratio {
	aspect-ratio: var(--ratio, 4/3);
}
/* Tiles – auto height but still grid */
.mgnf-gallery--tiles .mgnf-gallery__ratio {
	position: relative;
	width: 100%;
	height: 100%;
}
/* Masonry using CSS columns */
.mgnf-gallery--masonry {
	column-count: var(--mgnf-cols);
	column-gap: var(--mgnf-gap);
	display: block;
}
.mgnf-gallery--masonry .mgnf-gallery__item {
	break-inside: avoid;
	margin-bottom: var(--mgnf-gap);
}
.mgnf-gallery__item {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #f5f5f7;
}
.mgnf-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.mgnf-gallery__item:hover .mgnf-gallery__img {
	transform: scale(1.03);
}

/* Shine effect */
.mgnf-gallery__item::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.65) 40%, rgba(255,255,255,0) 60%);
	transform: translateX(-120%) skewX(-18deg);
	transition: transform .6s ease;
}
.mgnf-gallery__item.mgnf--shine:hover::after {
	transform: translateX(120%) skewX(-18deg);
}

/* Caption */
.mgnf-gallery__caption {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
	color: #fff;
	padding: 24px 12px 10px;
	font-size: 14px;
	line-height: 1.25;
}

/* Lightbox */
.mgnf-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.9);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2147483647; /* максимально возможный приоритет */
}
.mgnf-lightbox.is-open { display: flex; }
.mgnf-lightbox__img {
	max-width: 92vw;
	max-height: 92vh;
	object-fit: contain;
	box-shadow: 0 20px 60px rgba(0,0,0,.5);
	border-radius: 8px;
}
.mgnf-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 28px;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	user-select: none;
}
.mgnf-lightbox__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 36px;
	color: #fff;
	cursor: pointer;
	user-select: none;
	padding: 12px;
}
.mgnf-lightbox__arrow--left { left: 16px; }
.mgnf-lightbox__arrow--right { right: 16px; }

/* Responsive helpers (JS sets CSS variables) */
