/**
 * Travel Lightbox — 全螢幕燈箱（圖片 / 影片）。
 *
 * 由 [assets/js/components/lightbox.js] 動態建立 .travel-lightbox 容器。
 *
 * @package Travel
 */

.travel-lightbox[hidden] {
	display: none !important;
}

.travel-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: travel-lb-in 0.18s ease-out;
}

.travel-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.travel-lightbox__frame {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--travel-space-4, 1rem);
	box-sizing: border-box;
}

.travel-lightbox__stage {
	position: relative;
	max-width: 90vw;
	max-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.travel-lightbox__img,
.travel-lightbox__video {
	max-width: 90vw;
	max-height: 85vh;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	background: #000;
	border-radius: var(--travel-radius-md, 8px);
}

.travel-lightbox__video {
	min-width: min(70vw, 720px);
}

/* 控制按鈕共用 */
.travel-lightbox__close,
.travel-lightbox__nav {
	position: absolute;
	background: rgba(0, 0, 0, 0.55);
	border: 0;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.15s ease;
	z-index: 2;
}
.travel-lightbox__close:hover,
.travel-lightbox__nav:hover {
	background: rgba(0, 0, 0, 0.85);
}
.travel-lightbox__close:focus-visible,
.travel-lightbox__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.travel-lightbox__close {
	top: var(--travel-space-3, 0.75rem);
	right: var(--travel-space-3, 0.75rem);
	width: 44px;
	height: 44px;
	font-size: 1.75rem;
	line-height: 1;
}

.travel-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 2rem;
	line-height: 1;
}
.travel-lightbox__nav--prev { left: var(--travel-space-3, 0.75rem); }
.travel-lightbox__nav--next { right: var(--travel-space-3, 0.75rem); }
.travel-lightbox__nav[hidden] { display: none; }

.travel-lightbox__counter {
	position: absolute;
	bottom: var(--travel-space-4, 1rem);
	left: 50%;
	transform: translateX(-50%);
	color: #eee;
	font-size: 0.875rem;
	background: rgba(0, 0, 0, 0.5);
	padding: 4px 12px;
	border-radius: 999px;
	pointer-events: none;
}

/* 開啟時鎖捲動 */
body.is-modal-open {
	overflow: hidden;
}

@keyframes travel-lb-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.travel-lightbox {
		animation: none;
	}
	.travel-lightbox__close,
	.travel-lightbox__nav {
		transition: none;
	}
	.travel-lightbox__nav:hover {
		transform: translateY(-50%);
	}
}

/* ---- 手機 ---- */
@media (max-width: 640px) {
	.travel-lightbox__nav {
		width: 40px;
		height: 40px;
		font-size: 1.5rem;
	}
	.travel-lightbox__close {
		width: 40px;
		height: 40px;
		font-size: 1.5rem;
	}
	.travel-lightbox__video {
		min-width: 0;
		width: 100%;
	}
}
