#page-gallery-preview {
	padding: 60px 0;
}

.pg-masonry-grid {
	column-count: 1;
	column-gap: 20px;
	width: 100%;
	display: block !important;
	margin-top:50px;
}

@media (min-width: 500px) {
	.pg-masonry-grid {
		column-count: 2;
		column-gap: 15px;
		display: block !important;
	}
}
@media (min-width: 900px) {
	.pg-masonry-grid {
		column-count: 3;
		column-gap: 20px;
		display: block !important;
	}
}

.pg-gallery-card {
	break-inside: avoid;
	display: inline-block;
	width: 100%;
	margin-bottom: 20px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	box-sizing: border-box;
}

.pg-gallery-img {
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	display: block !important;
	cursor: zoom-in;
	transition: transform 0.3s ease;
	border-radius: 0px !important;
}
.pg-gallery-img:hover {
	transform: scale(1.03);
}

@keyframes pgRevealImage {
	from {
		opacity: 0;
		transform: translateY(25px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.pg-reveal-anim {
	animation: pgRevealImage 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pg-gallery-loader-wrapper {
	width: 100%;
	display: none;
	justify-content: center;
	align-items: center;
	padding: 30px 0;
}

.pg-gallery-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(140, 98, 57, 0.15);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: pg-spin 0.8s linear infinite;
}

@keyframes pg-spin {
	to { transform: rotate(360deg); }
}

.lightbox-overlay {
	display: none;
	position: fixed;
	z-index: 99999;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	align-items: center;
	justify-content: center;
}

.lightbox-content {
	position: relative;
	max-width: 90%;
	max-height: 85vh;
	text-align: center;
}

.lightbox-content img {
	max-width: 100%;
	max-height: 75vh;
	border-radius: 4px;
	box-shadow: var(--shadow-lightbox);
	object-fit: contain;
}

.lightbox-caption {
	color: var(--text-white);
	margin-top: 15px;
	font-size: 1.1rem;
	font-weight: 500;
	letter-spacing: 0.05em;
}

.lightbox-close-btn {
	position: absolute;
	top: -45px;
	right: 0;
	background: none;
	border: none;
	color: var(--text-white);
	font-size: 40px;
	cursor: pointer;
	line-height: 1;
	transition: color 0.2s;
}

.lightbox-close-btn:hover {
	color: var(--primary);
}

#lightbox-modal {
	transition: opacity 0.3s ease;
}
/* Kép kiinduló állapota (kissé zsugorított és átlátszó) */
#lightbox-img {
	opacity: 0;
	transform: scale(0.9);
	transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	max-width: 100%;
	max-height: 80vh;
	display: block;
}
/* Megjelenési animáció osztálya (méretnövekedés és felerősödés) */
#lightbox-img.active {
	opacity: 1;
	transform: scale(1);
}
/* Töltésjelző konténer a lightboxon belül */
.lightbox-loader-container {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: var(--text-white);
	font-family: 'Montserrat', sans-serif;
	z-index: 10;
	pointer-events: none;
}
/* Töltést jelző forgó kör */
.lightbox-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top: 3px solid var(--text-white);
	border-radius: 50%;
	animation: lightbox-spin 0.8s linear infinite;
}
.lightbox-loader-text {
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.5px;
	text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
@keyframes lightbox-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
/* Felirat finom áttűnése */
.lightbox-caption {
	opacity: 0;
	transition: opacity 0.3s ease;
}
.lightbox-caption.active {
	opacity: 1;
}

/* ÚJ: Rácsban lévő képek alaphelyzete (finom áttűnéshez) */
.pg-gallery-card {
	opacity: 0;
	transform: translateY(20px) scale(0.97);
	transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
/* ÚJ: Amikor a kép sikeresen letöltődött a háttérben */
.pg-gallery-card.img-loaded {
	opacity: 1;
	transform: translateY(0) scale(1);
}