.cpg-gallery {
	--cpg-purple: #97D359;
	--cpg-radius: 14px;
	--cpg-gap: 22px;
	background: #fff;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 8px 0 40px;
	box-sizing: border-box;
}

.cpg-gallery *,
.cpg-gallery *::before,
.cpg-gallery *::after {
	box-sizing: border-box;
}

/* ---- Filters ---- */
.cpg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 28px;
}

.cpg-filter {
	appearance: none;
	border: 1px solid #e2e2e6;
	background: #fff;
	color: #1a1a1a;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	padding: 11px 20px;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
	white-space: nowrap;
}

.cpg-filter:hover {
	border-color: var(--cpg-purple);
	color: #3d5a1c;
}

.cpg-filter.is-active {
	background: var(--cpg-purple);
	border-color: var(--cpg-purple);
	color: #1f3009;
	box-shadow: 0 6px 16px rgba(151, 211, 89, .35);
}

/* ---- Grid ---- */
.cpg-grid {
	display: grid;
	grid-template-columns: repeat(var(--cpg-cols, 3), 1fr);
	gap: var(--cpg-gap);
}

.cpg-item {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	border-radius: var(--cpg-radius);
	overflow: hidden;
	text-decoration: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: left;
	/* filter animation */
	opacity: 1;
	transform: scale(1);
	transition: opacity .35s ease, transform .35s ease, box-shadow .3s ease;
}

.cpg-item:hover {
	box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
}

.cpg-item.cpg-hidden {
	display: none;
}

.cpg-item.cpg-animating {
	opacity: 0;
	transform: scale(.96);
}

.cpg-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1; /* uniform size + proportion */
	overflow: hidden;
	background: #f2f2f4;
}

.cpg-thumb .cpg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

.cpg-item:hover .cpg-thumb .cpg-img {
	transform: scale(1.06);
}

/* multi-image count badge */
.cpg-count {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	z-index: 3;
	backdrop-filter: blur(2px);
}

.cpg-count svg { display: block; }

/* ---- Title overlay with shade ---- */
.cpg-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 18px 18px 40px;
	background: linear-gradient(180deg, rgba(0, 0, 0, .65) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, 0) 100%);
	z-index: 2;
	pointer-events: none;
	transition: opacity .3s ease;
}

.cpg-title {
	margin: 0;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .01em;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
	transform: translateY(0);
	transition: transform .35s ease;
}

.cpg-item:hover .cpg-title {
	transform: translateY(-2px);
}

/* ---- Lightbox ---- */
body.cpg-no-scroll { overflow: hidden; }

.cpg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(15, 15, 18, .9);
	padding: 4vh 4vw;
	opacity: 0;
	transition: opacity .25s ease;
}

.cpg-lightbox.is-open {
	display: flex;
	opacity: 1;
}

.cpg-lb-stage {
	margin: 0;
	max-width: 92vw;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.cpg-lb-img {
	max-width: 92vw;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	background: #222;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
	opacity: 0;
	transform: scale(.98);
	transition: opacity .3s ease, transform .3s ease;
}

.cpg-lb-img.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.cpg-lb-caption {
	margin-top: 16px;
	text-align: center;
	color: #fff;
}

.cpg-lb-title {
	display: block;
	font-size: 17px;
	font-weight: 600;
}

.cpg-lb-link {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--cpg-purple);
	color: #1f3009;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: filter .2s ease;
}

.cpg-lb-link:hover { filter: brightness(1.05); }

.cpg-lb-close,
.cpg-lb-nav {
	position: absolute;
	background: rgba(255, 255, 255, .12);
	border: 0;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .2s ease;
	z-index: 2;
}

.cpg-lb-close:hover,
.cpg-lb-nav:hover { background: rgba(255, 255, 255, .28); }

.cpg-lb-close {
	top: 18px;
	right: 18px;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 1;
}

.cpg-lb-nav {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 34px;
	line-height: 1;
}

.cpg-lb-prev { left: 20px; }
.cpg-lb-next { right: 20px; }

.cpg-lb-dots {
	position: absolute;
	bottom: 22px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.cpg-lb-dots i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .4);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.cpg-lb-dots i.is-active {
	background: var(--cpg-purple);
	transform: scale(1.15);
}
@media (max-width: 1024px) {
	.cpg-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
	.cpg-grid { grid-template-columns: 1fr; }
	.cpg-filter { font-size: 14px; padding: 10px 16px; }
	.cpg-lb-nav { width: 42px; height: 42px; font-size: 26px; }
	.cpg-lb-prev { left: 8px; }
	.cpg-lb-next { right: 8px; }
	.cpg-lb-img { max-height: 68vh; }
}
