/* Lightbox genérico (vídeo de Cantoria + slideshow de fotos do Álbum) */

.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	transition: opacity .3s ease;
}

.lightbox.active {
	display: flex;
	opacity: 1;
}

.lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	width: 1000px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lightbox-media-wrap {
	position: relative;
	width: 100%;
}

.lightbox-media {
	width: 100%;
	transition: opacity .25s ease;
}

.lightbox-media-wrap.is-loading .lightbox-media {
	opacity: 0;
}

.lightbox-media-wrap.is-loading {
	min-height: 40vh;
}

.lightbox-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	pointer-events: none;
	animation: lightbox-spin .8s linear infinite;
}

.lightbox-media-wrap.is-loading .lightbox-spinner {
	display: block;
}

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

.lightbox-media iframe,
.lightbox-media video {
	width: 100%;
	aspect-ratio: 16/9;
	border: 0;
	border-radius: 18px;
	display: block;
}

.lightbox-media img {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.lightbox-close {
	position: absolute;
	top: -53px;
	right: 0;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	padding: 10px;
	transition: color .3s ease;
	z-index: 1001;
}

.lightbox-close:hover {
	color: var(--lavender);
}

.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, .9);
	border: none;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	color: var(--rose);
	transition: all .3s ease;
	z-index: 1001;
}

.lightbox-nav:hover {
	background: #fff;
	transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
	left: -70px;
}

.lightbox-next {
	right: -70px;
}

.lightbox[data-type="video"] .lightbox-nav {
	display: none;
}

.lightbox-counter {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: .85rem;
	font-weight: 500;
	padding: .35rem 1rem;
	border-radius: 999px;
	pointer-events: none;
	z-index: 2;
}

.lightbox-counter:empty {
	display: none;
}

.lightbox-description {
	font-size: .9rem;
	color: rgba(255, 255, 255, .8);
	max-width: 600px;
	margin: 1rem auto 0;
	text-align: center;
}

.lightbox-description:empty {
	display: none;
	margin: 0;
}

.lightbox-thumbnails {
	max-width: 420px;
	overflow: hidden;
	margin: 1rem auto 0;
	padding: 4px;
}

.lightbox-thumbnails:empty {
	display: none;
	margin: 0;
}

.lightbox-thumbnails-track {
	position: relative;
	display: flex;
	gap: .5rem;
	transition: transform .3s ease;
}

.lightbox-thumbnail {
	width: 64px;
	height: 64px;
	flex: none;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	padding: 0;
	background: none;
	cursor: pointer;
	opacity: .55;
	transition: opacity .3s ease, border-color .3s ease;
}

.lightbox-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 6px;
}

.lightbox-thumbnail:hover {
	opacity: .85;
}

.lightbox-thumbnail.active {
	opacity: 1;
	border-color: var(--lavender);
}

@media (max-width: 768px) {
	.poem-post {
		padding: 2rem;
	}
	.lightbox-content {
		max-width: 95vw;
	}
	.lightbox-prev {
		left: -50px;
	}
	.lightbox-next {
		right: -50px;
	}
	.lightbox-nav {
		width: 40px;
		height: 40px;
		font-size: 1rem;
	}
	.lightbox-thumbnails {
		max-width: 260px;
	}
	.lightbox-thumbnail {
		width: 48px;
		height: 48px;
	}
}

