/* ---------- Сетка галереи ---------- */
.wpga-grid,
.wpga-albums-grid {
	display: grid;
	grid-template-columns: repeat(var(--wpga-cols, 3), 1fr);
	gap: var(--wpga-spacing, 10px);
}

.wpga-album-title { margin: 0 0 16px; }

.wpga-item {
	margin: 0;
	position: relative;
	border-radius: var(--wpga-radius, 8px);
	overflow: hidden;
}

.wpga-item .wpga-link {
	display: block;
	position: relative;
	overflow: hidden;
	background: #eee;
}

.wpga-item .wpga-link img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

/* Пропорции миниатюр */
.wpga-ratio-1-1 .wpga-link { aspect-ratio: 1 / 1; }
.wpga-ratio-4-3 .wpga-link { aspect-ratio: 4 / 3; }
.wpga-ratio-3-2 .wpga-link { aspect-ratio: 3 / 2; }
.wpga-ratio-16-9 .wpga-link { aspect-ratio: 16 / 9; }
.wpga-ratio-auto .wpga-link { aspect-ratio: auto; }
.wpga-ratio-auto .wpga-link img { height: auto; }

/* Зум при наведении */
.wpga-hover-zoom .wpga-link img { transition: transform .3s ease; }
.wpga-hover-zoom .wpga-link:hover img { transform: scale(1.08); }

/* Оверлей */
.wpga-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px 10px 8px;
	background: linear-gradient(transparent, rgba(0,0,0,.7));
	color: #fff;
	font-size: 13px;
	opacity: 0;
	transition: opacity .3s ease;
}
.wpga-link:hover .wpga-overlay { opacity: 1; }

/* Подписи */
.wpga-caption {
	padding: 6px 4px 0;
	font-size: 13px;
	line-height: 1.4;
}
.wpga-caption .wpga-title { display: block; font-weight: 600; }
.wpga-caption .wpga-desc { color: #666; }

/* Кнопка «Показать ещё» */
.wpga-loadmore-wrap { text-align: center; margin-top: 20px; }
.wpga-loadmore {
	cursor: pointer;
	padding: 10px 26px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 6px;
	font-size: 15px;
	transition: background .2s ease;
}
.wpga-loadmore:hover { background: #f5f5f5; }
.wpga-loadmore.wpga-loading { opacity: .6; pointer-events: none; }

/* ---------- Список альбомов ---------- */
.wpga-album-card {
	text-decoration: none;
	color: inherit;
	display: block;
	border-radius: var(--wpga-radius, 8px);
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
	transition: transform .2s ease, box-shadow .2s ease;
}
.wpga-album-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0,0,0,.12);
	color: inherit;
}
.wpga-album-cover { aspect-ratio: 4 / 3; overflow: hidden; }
.wpga-album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpga-album-cover-empty { background: linear-gradient(135deg, #e0e0e0, #cfcfcf); }
.wpga-album-meta { padding: 10px 12px; display: flex; flex-direction: column; }
.wpga-album-name { font-weight: 600; }
.wpga-album-count { font-size: 12px; color: #888; margin-top: 2px; }

.wpga-empty, .wpga-error { color: #666; font-style: italic; }

/* ---------- Лайтбокс ---------- */
.wpga-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.92);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}
.wpga-lightbox.wpga-open { display: flex; }
.wpga-lightbox-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.wpga-lightbox-img { max-width: 92vw; max-height: 88vh; display: block; margin: 0 auto; border-radius: 4px; }
.wpga-lightbox-caption {
	text-align: center;
	color: #fff;
	padding: 12px 40px;
	font-size: 14px;
	min-height: 20px;
}
.wpga-lightbox-close,
.wpga-lightbox-prev,
.wpga-lightbox-next {
	position: absolute;
	cursor: pointer;
	border: none;
	background: rgba(255,255,255,.12);
	color: #fff;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 22px;
	line-height: 1;
	transition: background .2s ease;
}
.wpga-lightbox-close:hover,
.wpga-lightbox-prev:hover,
.wpga-lightbox-next:hover { background: rgba(255,255,255,.3); }
.wpga-lightbox-close { top: 10px; right: 10px; }
.wpga-lightbox-prev { left: 10px; top: 45%; transform: translateY(-50%); }
.wpga-lightbox-next { right: 10px; top: 45%; transform: translateY(-50%); }

/* ---------- Адаптивность ---------- */
@media (max-width: 768px) {
	.wpga-grid, .wpga-albums-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.wpga-grid, .wpga-albums-grid { grid-template-columns: 1fr; }
}