/* ==========================================================================
   Galeria  [jys_galeria]  + visor (lightbox)
   Filas justificadas solo con CSS: cada foto crece segun su proporcion (--r),
   asi las filas llenan el ancho sin recortar de mas y se respeta el orden.
   ========================================================================== */

.jys-gal {
	--jys-gal-h: 260px;
	--jys-gal-gap: 8px;
	--jys-gold: #d7a34f;

	display: flex;
	flex-wrap: wrap;
	gap: var(--jys-gal-gap);
}

/* Evita que la ultima fila se estire de mas */
.jys-gal::after {
	content: "";
	flex-grow: 999999;
}

.jys-gal__item {
	position: relative;
	display: block;
	flex-grow: calc(var(--r) * 100);
	flex-basis: calc(var(--r) * var(--jys-gal-h));
	aspect-ratio: var(--r);
	overflow: hidden;
	background: #151a21;
	border: 0;
	text-decoration: none;
	cursor: zoom-in;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
	transition-delay: calc(var(--d, 0) * 70ms);
}

.jys-gal__item.is-in {
	opacity: 1;
	transform: none;
}

/* Sin JS (o si falla) las fotos se ven igual */
.no-js .jys-gal__item,
.jys-gal:not(.is-ready) .jys-gal__item {
	opacity: 1;
	transform: none;
}

.jys-gal__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .8s cubic-bezier(.22, .61, .36, 1), filter .6s ease;
}

.jys-gal__hover {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(to top, rgba(17, 22, 28, .75), rgba(17, 22, 28, .15) 60%, rgba(17, 22, 28, 0));
	opacity: 0;
	transition: opacity .4s ease;
}

.jys-gal__hover svg {
	width: 54px;
	height: 54px;
	padding: 12px;
	border: 1px solid var(--jys-gold);
	border-radius: 50%;
	fill: none;
	stroke: var(--jys-gold);
	stroke-width: 1.6;
	stroke-linecap: round;
	transform: scale(.7);
	transition: transform .4s cubic-bezier(.22, .61, .36, 1);
}

.jys-gal__item:hover .jys-gal__img,
.jys-gal__item:focus-visible .jys-gal__img {
	transform: scale(1.06);
	filter: brightness(.85);
}

.jys-gal__item:hover .jys-gal__hover,
.jys-gal__item:focus-visible .jys-gal__hover { opacity: 1; }

.jys-gal__item:hover .jys-gal__hover svg,
.jys-gal__item:focus-visible .jys-gal__hover svg { transform: scale(1); }

.jys-gal__item:focus-visible {
	outline: 2px solid var(--jys-gold);
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.jys-gal { --jys-gal-h: 110px !important; --jys-gal-gap: 4px !important; }
	.jys-gal__hover { display: none; }
}

/* --- Visor ------------------------------------------------------------ */
.jys-lb {
	position: fixed;
	inset: 0;
	z-index: 2147483000; /* por encima de la barra flotante de AddToAny */
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 13, 18, .96);
	opacity: 0;
	visibility: hidden;
	transition: opacity .35s ease, visibility 0s linear .35s;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

.jys-lb.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .35s ease;
}

.jys-lb__figure {
	position: relative;
	margin: 0;
	max-width: 92vw;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.jys-lb__img {
	display: block;
	max-width: 92vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
	opacity: 0;
	transform: scale(.97);
	transition: opacity .35s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
}

.jys-lb__img.is-loaded {
	opacity: 1;
	transform: none;
}

.jys-lb__caption {
	min-height: 1.4em;
	margin-top: 14px;
	color: #e9e2d2;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	letter-spacing: .04em;
	text-align: center;
}

.jys-lb__count {
	position: absolute;
	top: 22px;
	left: 26px;
	color: var(--jys-gold, #d7a34f);
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	letter-spacing: .2em;
}

.jys-lb button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	cursor: pointer;
	transition: background-color .25s ease;
}

.jys-lb button:hover,
.jys-lb button:focus-visible { background: #d7a34f; }

.jys-lb button svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.jys-lb__close { top: 14px; right: 16px; }
.jys-lb__prev  { left: 18px; top: 50%; margin-top: -24px; }
.jys-lb__next  { right: 18px; top: 50%; margin-top: -24px; }

.jys-lb__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border: 2px solid rgba(215, 163, 79, .25);
	border-top-color: #d7a34f;
	border-radius: 50%;
	animation: jys-spin .8s linear infinite;
}

.jys-lb.is-loaded .jys-lb__spinner { display: none; }

@keyframes jys-spin { to { transform: rotate(360deg); } }

html.jys-lb-lock,
html.jys-lb-lock body { overflow: hidden; }

@media (max-width: 767px) {
	.jys-lb__prev, .jys-lb__next { top: auto; bottom: 18px; margin-top: 0; }
	.jys-lb__prev { left: calc(50% - 60px); }
	.jys-lb__next { right: calc(50% - 60px); }
	.jys-lb__img { max-height: 72vh; }
}

@media (prefers-reduced-motion: reduce) {
	.jys-gal__item, .jys-gal__img, .jys-lb, .jys-lb__img { transition: none; }
}
