.cgp-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.9);
	display: none;
	z-index: 99999;
}

.cgp-overlay.active {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	padding: 50px 0;
}

.cgp-popup {
	background: #ffffff;
	width: 80%;
	padding: 50px;
	position: relative;
}

.cgp-close {
	position: absolute;
	top: 15px;
	right: 20px;
	font-size: 32px;
	background: none;
	border: none;
	cursor: pointer;
}

.cgp-gallery {
	column-count: 3;
	column-gap: 20px;
}

@media (max-width: 1024px) {

	.cgp-gallery {
		column-count: 2;
	}

	.cgp-popup {
		width: 90%;
		padding: 20px;
	}
}

@media (max-width: 600px) {

	.cgp-gallery {
		column-count: 1;
	}

	.cgp-popup {
		width: 90%;
		padding: 20px;
	}
	
	.cgp-overlay.active {
	align-items: center;
	padding: 0;
}
}
.cgp-item {
	break-inside: avoid;
	margin-bottom: 20px;
}

.cgp-item img {
	width: 100%;
	height: auto;
	display: block;
}

.cgp-loading {
	text-align: center;
	font-size: 18px;
}

/* ========================================================
 MOBILE SLIDER MODE
======================================================== */
@media (max-width: 600px) {

	.cgp-gallery {
		position: relative;
		overflow: hidden;
	}

	.cgp-slider-track {
		display: flex;
		transition: transform 0.35s ease;
		width: 100%;
	}

	.cgp-item {
		flex: 0 0 100%;
		margin-bottom: 0;
	}

	.cgp-arrow {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 44px;
		height: 44px;
		background: rgba(0,0,0,0.6);
		color: #fff;
		border: none;
		cursor: pointer;
		z-index: 10;
		font-size: 24px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.cgp-arrow.prev { left: 10px; }
	.cgp-arrow.next { right: 10px; }
}