/*
 * Gestión ABORDO - Gallery frontend styles.
 * Scoped under .ga-gallery to avoid conflicts with the active theme or
 * page builders. Same design tokens/approach as frontend-revistas.css.
 */

.ga-gallery {
	--ga-gallery-primary: #0096ce;
	--ga-gallery-primary-hover: #007ba8;
	--ga-gallery-text: #111827;
	--ga-gallery-text-soft: #6b7280;
	--ga-gallery-border: #e5e7eb;
	--ga-gallery-surface: #ffffff;
	--ga-gallery-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
	--ga-gallery-radius: 14px;
	--ga-gallery-font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;

	box-sizing: border-box;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 16px;
	font-family: var(--ga-gallery-font);
	color: var(--ga-gallery-text);
}

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

.ga-gallery-inner {
	transition: opacity 0.2s ease;
}

/* ---------------------------------------------------------------------- */
/* Grid + cards                                                            */
/* ---------------------------------------------------------------------- */

.ga-gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--ga-gallery-cols-desktop, 3), minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 1024px) {
	.ga-gallery-grid {
		grid-template-columns: repeat(var(--ga-gallery-cols-tablet, 2), minmax(0, 1fr));
		gap: 20px;
	}
}

@media (max-width: 640px) {
	.ga-gallery {
		padding: 0 16px;
	}
	.ga-gallery-grid {
		grid-template-columns: repeat(var(--ga-gallery-cols-mobile, 2), minmax(0, 1fr));
		gap: 14px;
	}
}

.ga-gallery-card {
	margin: 0;
	background: var(--ga-gallery-surface);
	border-radius: var(--ga-gallery-radius);
	overflow: hidden;
	box-shadow: var(--ga-gallery-shadow);
	border: 1px solid var(--ga-gallery-border);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ga-gallery-card:hover {
	box-shadow: 0 18px 34px rgba(23, 23, 23, 0.12);
	transform: translateY(-2px);
}

.ga-gallery-image-btn {
	display: block;
	position: relative;
	width: 100%;
	border: none;
	background: none;
	padding: 0;
	margin: 0;
	cursor: zoom-in;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.ga-gallery-image,
.ga-gallery-image-btn img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.ga-gallery-image--empty {
	background: #f1f5f9;
}

.ga-gallery-image-btn:hover img,
.ga-gallery-image-btn:focus-visible img {
	transform: scale(1.05);
}

.ga-gallery-zoom-hint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(17, 24, 39, 0);
	opacity: 0;
	transition: opacity 0.2s ease, background 0.2s ease;
	pointer-events: none;
}

.ga-gallery-image-btn:hover .ga-gallery-zoom-hint,
.ga-gallery-image-btn:focus-visible .ga-gallery-zoom-hint {
	opacity: 1;
	background: rgba(17, 24, 39, 0.28);
}

.ga-gallery-image-btn:focus-visible {
	outline: 2px solid var(--ga-gallery-primary);
	outline-offset: 2px;
}

.ga-gallery-caption {
	padding: 14px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ga-gallery-text);
	text-align: center;
}

.ga-gallery-empty {
	text-align: center;
	color: var(--ga-gallery-text-soft);
	padding: 60px 0;
	font-size: 15px;
	grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------- */
/* Pagination                                                              */
/* ---------------------------------------------------------------------- */

.ga-gallery-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.ga-gallery-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--ga-gallery-border);
	border-radius: 8px;
	color: var(--ga-gallery-text);
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ga-gallery-pagination a.page-numbers:hover,
.ga-gallery-pagination a.page-numbers:focus-visible {
	background: var(--ga-gallery-primary);
	border-color: var(--ga-gallery-primary);
	color: #fff;
}

.ga-gallery-pagination .page-numbers.current {
	background: var(--ga-gallery-primary);
	border-color: var(--ga-gallery-primary);
	color: #fff;
}

.ga-gallery-pagination .page-numbers.dots {
	border-color: transparent;
}

/* ---------------------------------------------------------------------- */
/* Skeleton loader (shown by frontend-gallery.js while paginating)         */
/* ---------------------------------------------------------------------- */

.ga-gallery-skeleton[hidden] {
	display: none;
}

.ga-gallery-skeleton-card {
	border-radius: var(--ga-gallery-radius);
	overflow: hidden;
	border: 1px solid var(--ga-gallery-border);
	background: var(--ga-gallery-surface);
}

.ga-gallery-shimmer {
	position: relative;
	overflow: hidden;
	background: #e9ebf0;
}

.ga-gallery-shimmer::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
	animation: ga-gallery-shimmer 1.4s ease-in-out infinite;
}

@keyframes ga-gallery-shimmer {
	100% {
		transform: translateX(100%);
	}
}

.ga-gallery-skeleton-image {
	width: 100%;
	aspect-ratio: 1 / 1;
}

.ga-gallery-skeleton-line {
	height: 16px;
	margin: 14px 16px 16px;
	border-radius: 4px;
	width: 60%;
}

@media (prefers-reduced-motion: reduce) {
	.ga-gallery-shimmer::after {
		animation: none;
	}
	.ga-gallery-card,
	.ga-gallery-image-btn img {
		transition: none;
	}
}

/* ---------------------------------------------------------------------- */
/* Click-to-enlarge lightbox                                               */
/* ---------------------------------------------------------------------- */

.ga-gallery-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100050;
	padding: 24px;
	opacity: 0;
	animation: ga-gallery-fade-in 0.15s ease forwards;
}

@keyframes ga-gallery-fade-in {
	to {
		opacity: 1;
	}
}

.ga-gallery-lightbox-figure {
	max-width: min(92vw, 1200px);
	max-height: 88vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.ga-gallery-lightbox-figure img {
	max-width: 100%;
	max-height: 80vh;
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	display: block;
}

.ga-gallery-lightbox-figure figcaption {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.ga-gallery-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	color: #111827;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
	z-index: 2;
}

.ga-gallery-lightbox-close svg {
	width: 24px;
	height: 24px;
}

.ga-gallery-lightbox-close:hover,
.ga-gallery-lightbox-close:focus-visible {
	background: #fff;
	transform: scale(1.06);
	outline: none;
}

.ga-gallery-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	color: #111827;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
	z-index: 2;
}

.ga-gallery-lightbox-nav svg {
	width: 24px;
	height: 24px;
}

.ga-gallery-lightbox-nav:hover,
.ga-gallery-lightbox-nav:focus-visible {
	background: #fff;
	outline: none;
}

.ga-gallery-lightbox-nav:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.ga-gallery-lightbox-prev {
	left: 16px;
}

.ga-gallery-lightbox-next {
	right: 16px;
}

@media (max-width: 640px) {
	.ga-gallery-lightbox-nav {
		width: 40px;
		height: 40px;
	}

	.ga-gallery-lightbox-prev {
		left: 8px;
	}

	.ga-gallery-lightbox-next {
		right: 8px;
	}
}

body.ga-gallery-lightbox-open {
	overflow: hidden;
}
