/**
 * TK Mobile Lightbox — overlay styles.
 * Active only at viewport <= 768px. Desktop never sees any of these rules.
 */

.tk-mlb-overlay { display: none; }

@media (max-width: 768px) {

	.tk-mlb-overlay.is-open {
		position: fixed;
		inset: 0;
		z-index: 999999;
		display: flex;
		flex-direction: column;
		background: #000;
		animation: tk-mlb-fade-in 180ms ease-out;
	}

	.tk-mlb-track {
		flex: 1 1 auto;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-behavior: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.tk-mlb-track::-webkit-scrollbar { display: none; }

	.tk-mlb-slide {
		flex: 0 0 100%;
		scroll-snap-align: center;
		scroll-snap-stop: always;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0;
		padding: 0;
		/* pan-x lets horizontal swipe propagate to the track's scroll-snap;
		   pinch-zoom keeps native pinch on the image. Without pan-x, the
		   browser blocks the swipe gesture on the slide element. */
		touch-action: pan-x pinch-zoom;
	}

	.tk-mlb-slide img {
		display: block;
		max-width: 100%;
		max-height: 100%;
		width: auto;
		height: auto;
		object-fit: contain;
		user-select: none;
		-webkit-user-select: none;
		-webkit-touch-callout: none;
	}

	.tk-mlb-close {
		position: absolute;
		top: calc(env(safe-area-inset-top, 0px) + 12px);
		right: 12px;
		width: 44px;
		height: 44px;
		padding: 0;
		margin: 0;
		background: rgba(0, 0, 0, 0.55);
		border: 0;
		border-radius: 50%;
		color: #fff;
		font-size: 28px;
		line-height: 1;
		cursor: pointer;
		z-index: 2;
	}
	.tk-mlb-close:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 2px;
	}

	.tk-mlb-counter {
		position: absolute;
		bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
		left: 50%;
		transform: translateX(-50%);
		padding: 6px 14px;
		background: rgba(0, 0, 0, 0.55);
		border-radius: 999px;
		color: #fff;
		font: 600 14px/1 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
		white-space: nowrap;
		z-index: 2;
		pointer-events: none;
	}

	body.tk-mlb-lock { overflow: hidden; }
}

@keyframes tk-mlb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
