.pgm-grid {
	--pgm-cols: 3;
	--pgm-gap: 24px;
	--pgm-card-radius: 8px;
	--pgm-img-height: 280px;
	--pgm-overlay-color: rgba(0, 0, 0, 0.35);
	--pgm-modal-bg: rgba(0, 0, 0, 0.92);
	display: grid;
	grid-template-columns: repeat(var(--pgm-cols), minmax(0, 1fr));
	gap: var(--pgm-gap);
}

.pgm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	cursor: pointer;
	background: transparent;
}

.pgm-card:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

.pgm-thumb {
	position: relative;
	overflow: hidden;
	border-radius: var(--pgm-card-radius);
	background: #1d1d1d;
}

.pgm-thumb img {
	display: block;
	width: 100%;
	height: var(--pgm-img-height);
	object-fit: cover;
	transition: transform 0.3s ease;
}

.pgm-card:hover .pgm-thumb img,
.pgm-card:focus-visible .pgm-thumb img {
	transform: scale(1.05);
}

.pgm-empty-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--pgm-img-height);
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.pgm-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--pgm-overlay-color);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.pgm-card:hover .pgm-overlay,
.pgm-card:focus-visible .pgm-overlay {
	opacity: 1;
}

.pgm-expand-icon {
	position: relative;
	width: 36px;
	height: 36px;
	border: 2px solid #fff;
	border-radius: 50%;
}

.pgm-expand-icon::before,
.pgm-expand-icon::after {
	content: "";
	position: absolute;
	background: #fff;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.pgm-expand-icon::before {
	width: 16px;
	height: 2px;
}

.pgm-expand-icon::after {
	width: 2px;
	height: 16px;
}

.pgm-count-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 28px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
}

.pgm-camera-icon {
	position: relative;
	display: inline-block;
	width: 14px;
	height: 10px;
	border: 2px solid currentColor;
	border-radius: 2px;
}

.pgm-camera-icon::before {
	content: "";
	position: absolute;
	left: 2px;
	top: -5px;
	width: 6px;
	height: 3px;
	border-radius: 2px 2px 0 0;
	background: currentColor;
}

.pgm-camera-icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 4px;
	height: 4px;
	border: 1px solid currentColor;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

.pgm-title {
	margin: 14px 0 0;
	padding: 0;
	color: inherit;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	text-align: center;
	background: none;
}

#pgm-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 56px 72px;
	background: var(--pgm-modal-bg, rgba(0, 0, 0, 0.92));
	opacity: 0;
	transition: opacity 0.25s ease;
}

#pgm-overlay.pgm-is-open {
	display: flex;
	opacity: 1;
}

.pgm-modal-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
}

.pgm-img-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
}

.pgm-main-img {
	display: block;
	width: 50%;
	height: auto;
	max-width: 50%;
	max-height: 100%;
	object-fit: contain;
	transition: opacity 0.25s ease;
}

.pgm-close {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease;
}

.pgm-close:hover,
.pgm-close:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.06);
}

.pgm-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.pgm-arrow:hover,
.pgm-arrow:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	border-color: #fff;
	transform: translateY(-50%) scale(1.04);
}

.pgm-arrow-prev {
	left: -64px;
}

.pgm-arrow-next {
	right: -64px;
}

#pgm-overlay.pgm-arrow-solid .pgm-arrow {
	border-color: #fff;
	background: #fff;
	color: #111;
}

#pgm-overlay.pgm-arrow-solid .pgm-arrow:hover,
#pgm-overlay.pgm-arrow-solid .pgm-arrow:focus-visible {
	background: rgba(255, 255, 255, 0.82);
}

.pgm-thumb-strip {
	display: flex;
	flex-flow: row nowrap;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	margin-top: 16px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.pgm-modal-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	opacity: 0.7;
	transition: border-color 0.25s ease, opacity 0.25s ease;
}

.pgm-modal-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pgm-modal-thumb.pgm-active,
.pgm-modal-thumb:hover,
.pgm-modal-thumb:focus-visible {
	border-color: #fff;
	opacity: 1;
}

body.pgm-modal-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	.pgm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	#pgm-overlay {
		padding: 56px 24px;
	}

	.pgm-arrow-prev {
		left: 12px;
	}

	.pgm-arrow-next {
		right: 12px;
	}
}

@media (max-width: 767px) {
	.pgm-grid {
		--pgm-gap: 18px;
		grid-template-columns: 1fr;
	}

	.pgm-title {
		margin-top: 10px;
		font-size: 17px;
	}

	#pgm-overlay {
		padding: 56px 12px 16px;
	}

	.pgm-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 24px;
	}

	.pgm-arrow {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}

	.pgm-arrow-prev {
		left: 6px;
	}

	.pgm-arrow-next {
		right: 6px;
	}

	.pgm-main-img {
		max-width: 95%;
		max-height: 90%;
	}

	.pgm-modal-thumb {
		width: 48px;
		height: 48px;
	}
}

@media (max-width: 480px) {
	.pgm-title {
		font-size: 16px;
	}

	.pgm-main-img {
		max-width: 100%;
		max-height: 88%;
	}
}
