/**
 * Lightbox Component
 *
 * Click an image (e.g. inside `.ttsd-timetable`) to open it full-screen.
 * A single global container is lazy-created by initLightbox() in frontend.js;
 * this file only styles the visual behaviour.
 *
 * Enqueue handle: `ttsd-lightbox` (depends on `ttsd-base`).
 */

/* Images that participate in the lightbox are zoomable. */
.ttsd-timetable img,
[data-ttsd-lightbox] img,
img[data-ttsd-lightbox] {
	cursor: zoom-in;
}

.ttsd-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.9);
}

.ttsd-lightbox.is-open {
	display: flex;
	animation: ttsd-lightbox-fade 0.2s ease-out;
}

@keyframes ttsd-lightbox-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

body.ttsd-lightbox-open {
	overflow: hidden;
}

.ttsd-lightbox__stage {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ttsd-lightbox__img {
	display: block;
	max-width: 96vw;
	max-height: 92vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
	cursor: zoom-out;
	animation: ttsd-lightbox-pop 0.25s ease-out;
}

@keyframes ttsd-lightbox-pop {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

.ttsd-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 32px;
	line-height: 1;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.ttsd-lightbox__close:hover,
.ttsd-lightbox__close:focus {
	background: rgba(255, 255, 255, 0.25);
	transform: rotate(90deg);
	outline: none;
}

@media (max-width: 600px) {
	.ttsd-lightbox {
		padding: 12px;
	}
	.ttsd-lightbox__close {
		top: 10px;
		right: 10px;
		width: 38px;
		height: 38px;
		font-size: 26px;
	}
}
