/* Galerías desde carpetas — estilos públicos */

.gc-galeria { margin: 1.5em 0; }
.gc-titulo { margin: 0 0 .6em; }

.gc-rejilla,
.gc-indice {
	display: grid;
	grid-template-columns: repeat(var(--gc-columnas, 4), minmax(0, 1fr));
	gap: 10px;
}

@media (max-width: 782px) {
	.gc-rejilla, .gc-indice { grid-template-columns: repeat(min(var(--gc-columnas, 4), 3), minmax(0, 1fr)); }
}
@media (max-width: 480px) {
	.gc-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gc-indice  { grid-template-columns: 1fr; }
}

.gc-item {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: #eee;
	cursor: zoom-in;
	line-height: 0;
}
.gc-item img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform .35s ease, opacity .35s ease;
}
.gc-recorte .gc-item img,
.gc-indice .gc-item img {
	aspect-ratio: 1 / 1;
	height: 100%;
	object-fit: cover;
}
.gc-indice .gc-item img { aspect-ratio: 4 / 3; }
.gc-item:hover img,
.gc-item:focus-visible img { transform: scale(1.04); opacity: .92; }
.gc-item:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; }
.gc-oculto { display: none !important; }

/* Índice de galerías */
.gc-tarjeta { margin: 0; }
.gc-tarjeta figcaption {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: .5em;
	padding: .5em .1em 0;
}
.gc-tarjeta-titulo { font-weight: 600; }
.gc-tarjeta-total { font-size: .85em; opacity: .7; white-space: nowrap; }

/* Aviso para editores */
.gc-aviso {
	padding: .8em 1em;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	font-size: .9em;
}

/* ---------------- Lightbox ---------------- */

.gc-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 12, .94);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s;
	touch-action: pan-y;
}
.gc-lb.gc-abierto { opacity: 1; visibility: visible; }

.gc-lb-escena {
	position: relative;
	max-width: 92vw;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.gc-lb-img {
	max-width: 92vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	transition: opacity .2s ease;
	user-select: none;
	-webkit-user-drag: none;
}
.gc-lb.gc-cargando .gc-lb-img { opacity: .25; }

.gc-lb-pie {
	color: #ddd;
	font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
	text-align: center;
	margin-top: .8em;
	min-height: 1.4em;
}
.gc-lb-contador {
	position: absolute;
	top: 18px;
	left: 20px;
	color: #bbb;
	font: 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.gc-lb button {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background .2s;
	padding: 0;
}
.gc-lb button:hover,
.gc-lb button:focus-visible { background: rgba(255, 255, 255, .22); outline: none; }
.gc-lb button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gc-lb-cerrar { top: 12px; right: 12px; width: 46px; height: 46px; }
.gc-lb-ant,
.gc-lb-sig { top: 50%; width: 54px; height: 54px; transform: translateY(-50%); }
.gc-lb-ant { left: 16px; }
.gc-lb-sig { right: 16px; }
.gc-lb.gc-unica .gc-lb-ant,
.gc-lb.gc-unica .gc-lb-sig { display: none; }

@media (max-width: 600px) {
	.gc-lb-ant, .gc-lb-sig { width: 42px; height: 42px; top: auto; bottom: 14px; transform: none; }
	.gc-lb-ant { left: calc(50% - 56px); }
	.gc-lb-sig { right: calc(50% - 56px); }
	.gc-lb-escena { max-height: 78vh; }
	.gc-lb-img { max-height: 70vh; }
}

body.gc-sin-scroll { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.gc-lb, .gc-lb-img, .gc-item img { transition: none; }
}
