/* ── Gallery grid ────────────────────────────────────────────────────────── */

.portfolio-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin: 0 0 16px;
}

/* ── Individual item ─────────────────────────────────────────────────────── */

.pg-item {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	background: #f0f0f0;
	cursor: pointer;
}

.pg-item img {
	display: block;
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: opacity 0.2s ease;
}

.pg-item:hover img {
	opacity: 0.85;
}

/* ── Remove button (×) ───────────────────────────────────────────────────── */

.pg-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(220, 38, 38, 0.85);
	color: #fff;
	font-size: 16px;
	line-height: 24px;
	text-align: center;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease, background 0.15s ease;
	z-index: 10;
}

.pg-item:hover .pg-remove {
	opacity: 1;
}

.pg-remove:hover {
	background: rgba(185, 28, 28, 1);
}

/* ── Add Images button ───────────────────────────────────────────────────── */

.pg-add-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pg-add-btn:hover {
	background: #1d4ed8;
}

/* ── Lightbox overlay ────────────────────────────────────────────────────── */

.pg-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.78);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.pg-lightbox-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* ── Lightbox image ──────────────────────────────────────────────────────── */

.pg-lightbox-img-wrap {
	max-width: 85vw;
	max-height: 82vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pg-lightbox-img-wrap img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 6px;
	display: block;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
	height: auto;
	width: auto;
}

/* ── Navigation arrows ───────────────────────────────────────────────────── */

.pg-lightbox-prev,
.pg-lightbox-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
	padding: 0;
}

.pg-lightbox-prev {
	left: 16px;
}

.pg-lightbox-next {
	right: 16px;
}

.pg-lightbox-prev:hover,
.pg-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ── Close button ────────────────────────────────────────────────────────── */

.pg-lightbox-close {
	position: fixed;
	top: 16px;
	right: 16px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
	padding: 0;
}

.pg-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ── Counter (1 / N) ─────────────────────────────────────────────────────── */

.pg-lightbox-counter {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	font-family: sans-serif;
	letter-spacing: 0.05em;
	pointer-events: none;
}
