/* Rejilla de temáticas de un estilo. Cada tarjeta abre el lightbox con sus fotos. */

.pb-galerias {
	display: grid;
	grid-template-columns: repeat(var(--pb-gal-cols, 2), minmax(0, 1fr));
	gap: 14px;
}

.pb-gal-tarjeta { position: relative; }

.pb-gal-portada {
	position: relative;
	display: block;
	overflow: hidden;
	text-decoration: none;
	line-height: 0;
}

.pb-gal-portada img {
	width: 100%;
	/* la tarjeta ocupa todo el alto que le toca por su ancho, en vertical como el diseño */
	aspect-ratio: 3 / 4;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .45s ease;
}
a.pb-gal-portada:hover img { transform: scale(1.04); }

/* el nombre, sobre la foto y SIN degradado: el diseño no lleva sombreado */
.pb-gal-nombre {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	margin: 0;
	padding: 1em 1.1em;
	color: #ffffff;
	font-family: orbitron, "Orbitron", sans-serif;
	font-weight: 700;
	font-size: 1.6rem;
	letter-spacing: .02em;
	line-height: 1.15;
	background: none;
}

/* icono de lupa, para que se vea que la tarjeta abre algo */
a.pb-gal-portada::after {
	content: "";
	position: absolute;
	top: 14px; right: 14px;
	width: 34px; height: 34px;
	border-radius: 50%;
	background: rgba(0,0,0,.55) no-repeat center /16px 16px
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E");
	opacity: 0;
	transition: opacity .25s ease;
}
a.pb-gal-portada:hover::after,
a.pb-gal-portada:focus-visible::after { opacity: 1; }

/* el resto de la galería solo existe para que el lightbox la encuentre */
.pb-gal-ocultas { display: none; }

/* ---------------------------------------------------------------------------
   Rejilla de trabajos de un artista  ·  [pb_trabajos artista="rodrigo"]
   Misma tarjeta que las temáticas, pero aquí cada hueco es una foto suelta y
   todas pertenecen a la misma galería: al pulsar una se abre el carrusel por ella.
   --------------------------------------------------------------------------- */

.pb-trabajos {
	display: grid;
	grid-template-columns: repeat(var(--pb-gal-cols, 4), minmax(0, 1fr));
	gap: 14px;
}

.pb-trabajo {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
	text-decoration: none;
}

.pb-trabajo img {
	width: 100%;
	/* las fotos vienen en proporciones distintas; el recorte las iguala */
	aspect-ratio: 3 / 4;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .45s ease;
}
.pb-trabajo:hover img { transform: scale(1.04); }

/* la misma lupa que en las tarjetas de temática */
.pb-trabajo::after {
	content: "";
	position: absolute;
	top: 14px; right: 14px;
	width: 34px; height: 34px;
	border-radius: 50%;
	background: rgba(0,0,0,.55) no-repeat center /16px 16px
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E");
	opacity: 0;
	transition: opacity .25s ease;
}
.pb-trabajo:hover::after,
.pb-trabajo:focus-visible::after { opacity: 1; }

@media (max-width: 900px) {
	.pb-trabajos {
		display: flex;
		gap: 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-inline: 1px;
	}
	.pb-trabajos::-webkit-scrollbar { display: none; }
	.pb-trabajo { flex: 0 0 62%; scroll-snap-align: start; }
}
@media (max-width: 520px) {
	.pb-trabajo { flex-basis: 78%; }
}

/* en tablet y móvil deja de ser rejilla y pasa a tira horizontal, que se arrastra */
@media (max-width: 900px) {
	.pb-galerias {
		display: flex;
		gap: 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-inline: 1px;
	}
	.pb-galerias::-webkit-scrollbar { display: none; }
	.pb-gal-tarjeta { flex: 0 0 62%; scroll-snap-align: start; }
	.pb-gal-nombre { font-size: 1.2rem; }
}
@media (max-width: 520px) {
	.pb-gal-tarjeta { flex-basis: 78%; }
	.pb-gal-nombre { font-size: 1.05rem; }
}

/* ---------------------------------------------------------------------------
   Popup de la temática: carrusel con TRES fotos a la vista que va pasando solo
   --------------------------------------------------------------------------- */

body.pb-modal-abierto { overflow: hidden; }

.pb-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pb-modal[hidden] { display: none; }

.pb-modal-fondo { position: absolute; inset: 0; background: rgba(10, 9, 9, .94); }

.pb-modal-caja {
	position: relative;
	/* a todo el ancho de la ventana, solo con aire a los lados */
	width: calc(100vw - 5em);
	max-height: 94vh;
	display: flex;
	flex-direction: column;
	gap: 1.1em;
}

/* cabecera */
.pb-modal-cab { display: flex; align-items: center; gap: .9em; }
.pb-modal-titulo {
	margin: 0;
	color: #ffffff;
	font-family: orbitron, "Orbitron", sans-serif;
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: .03em;
}
.pb-modal-cuenta {
	color: rgba(255, 255, 255, .6);
	font-size: .85rem;
	letter-spacing: .04em;
}
.pb-modal-cerrar {
	margin-left: auto;
	width: 44px; height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: transparent;
	color: #ffffff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.pb-modal-cerrar:hover { background: #ffffff; color: #222422; }

/* el carrusel */
.pb-modal-cuerpo { position: relative; display: flex; align-items: center; gap: .8em; }

.pb-modal-pista {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.pb-modal-pista::-webkit-scrollbar { display: none; }

/* tres a la vista, descontando los dos huecos */
.pb-modal-foto {
	flex: 0 0 calc((100% - 2 * 16px) / 3);
	margin: 0;
	scroll-snap-align: start;
	line-height: 0;
}
.pb-modal-foto img {
	width: 100%;
	height: 74vh;
	/* contain y no cover: en un visor la foto se ve entera, sin recortar.
	   Los tatuajes son verticales y en un hueco ancho cover se comería medio brazo. */
	object-fit: contain;
	display: block;
}

/* flechas */
.pb-modal-flecha {
	flex: 0 0 auto;
	width: 46px; height: 46px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	position: relative;
	transition: background .2s ease, border-color .2s ease;
}
.pb-modal-flecha::before {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 10px; height: 10px;
	border-top: 2px solid #ffffff;
	border-right: 2px solid #ffffff;
}
.pb-modal-next::before { transform: translate(-60%, -50%) rotate(45deg); }
.pb-modal-prev::before { transform: translate(-40%, -50%) rotate(-135deg); }
.pb-modal-flecha:hover { background: rgba(255, 255, 255, .14); border-color: #ffffff; }

/* puntos, a la derecha como en el resto del sitio */
.pb-modal-puntos { display: flex; justify-content: flex-end; gap: 9px; }
.pb-modal-puntos[hidden] { display: none; }
.pb-modal-punto {
	width: 10px; height: 10px;
	padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .3);
	cursor: pointer;
	transition: background .2s ease;
}
.pb-modal-punto.is-activa { background: #4085F4; }
.pb-modal-punto:hover     { background: rgba(255, 255, 255, .6); }

@media (max-width: 1100px) {
	.pb-modal-foto { flex-basis: calc((100% - 16px) / 2); }
}
@media (max-width: 680px) {
	.pb-modal-foto { flex-basis: 100%; }
	.pb-modal-foto img { height: 62vh; }
	.pb-modal-flecha { width: 38px; height: 38px; }
	.pb-modal-titulo { font-size: 1.15rem; }
}

/* ---------------------------------------------------------------------------
   Segunda capa: una foto sola a pantalla completa, encima del carrusel
   --------------------------------------------------------------------------- */

.pb-zoom {
	position: fixed;
	inset: 0;
	z-index: 10;              /* por encima del carrusel, dentro del mismo modal */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1em;
	padding: 1.5em;
}
.pb-zoom[hidden] { display: none; }

.pb-zoom-fondo { position: absolute; inset: 0; background: rgba(6, 6, 6, .97); }

.pb-zoom-img {
	position: relative;
	max-width: calc(100% - 12em);
	max-height: 92vh;
	object-fit: contain;
	display: block;
}

.pb-zoom-cerrar {
	position: absolute;
	top: 1.2em; right: 1.4em;
	width: 46px; height: 46px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: transparent;
	color: #ffffff;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.pb-zoom-cerrar:hover { background: #ffffff; color: #222422; }

.pb-zoom-flecha {
	position: relative;
	flex: 0 0 auto;
	width: 52px; height: 52px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease;
}
.pb-zoom-flecha::before {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 11px; height: 11px;
	border-top: 2px solid #ffffff;
	border-right: 2px solid #ffffff;
}
.pb-zoom-next::before { transform: translate(-60%, -50%) rotate(45deg); }
.pb-zoom-prev::before { transform: translate(-40%, -50%) rotate(-135deg); }
.pb-zoom-flecha:hover { background: rgba(255, 255, 255, .14); border-color: #ffffff; }

.pb-zoom-cuenta {
	position: absolute;
	bottom: 1.4em;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, .65);
	font-size: .85rem;
	letter-spacing: .06em;
}

/* la foto del carrusel invita a pulsarla */
.pb-modal-foto { cursor: zoom-in; }

@media (max-width: 680px) {
	.pb-zoom { padding: .8em; gap: .4em; }
	.pb-zoom-img { max-width: calc(100% - 7em); }
	.pb-zoom-flecha { width: 40px; height: 40px; }
}

/* ---------------------------------------------------------------------------
   Efecto de enfoque, al abrir el popup
   Las fotos del slider entran desenfocadas y se enfocan, como una cámara al ajustar.
   Va solo aquí: la rejilla de tarjetas se muestra sin efecto.
   El popup lo monta el JS, así que si el JS no carga esto no llega a pintarse.
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {

	/* Fotos del carrusel: entran desenfocadas y se enfocan. Las tres que se ven al
	   abrir lo hacen en cascada (el retardo lo pone el JS); el resto, al cargar. */
	.pb-modal-foto img {
		opacity: 0;
		filter: blur(18px);
		transform: scale(1.04);
		transition: opacity .7s ease, filter .7s ease, transform .7s ease;
		will-change: filter, opacity;
	}
	.pb-modal-foto img.pb-enfocada {
		opacity: 1;
		filter: blur(0);
		transform: none;
		will-change: auto;
	}

	/* y la foto sola a pantalla completa */
	.pb-zoom-img {
		opacity: 0;
		filter: blur(18px);
		transition: opacity .45s ease, filter .45s ease;
	}
	.pb-zoom-img.pb-enfocada { opacity: 1; filter: blur(0); }
}
