/**
 * Lite Slider 前端核心樣式表
 * 零相依、輕量化、零版面位移 (CLS = 0)
 */

/* 1. 樣式隔離 Reset，避免被 WordPress 佈景主題（如 Storefront、WooCommerce）干擾 */
.lite-slider,
.lite-slider *,
.lite-slider *::before,
.lite-slider *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.lite-slider {
	position: relative;
	width: 100%;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y pinch-zoom;
}

/* 2. 排版模式：標準盒裝 vs 全寬破格 */
.lite-slider--layout-boxed {
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* 突破主內容欄位限制，貼齊螢幕 100vw 全寬 */
.lite-slider--layout-full_width {
	width: 100vw !important;
	position: relative !important;
	left: 50% !important;
	right: 50% !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	max-width: 100vw !important;
}

/* 3. 零版面位移 (CLS = 0) 核心容器 */
.lite-slider__track-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: var(--slider-ratio-w, 16) / var(--slider-ratio-h, 9);
	overflow: hidden;
	background-color: #1e1e24; /* 預載佔位底色 */
}

/* 4. 輪播滑動軌道 (Slide 模式) */
.lite-slider__track {
	width: 100%;
	height: 100%;
}

.lite-slider--effect-slide .lite-slider__track {
	display: flex;
	flex-flow: row nowrap;
	transition: transform var(--slider-speed, 500ms) cubic-bezier(0.25, 1, 0.5, 1);
	will-change: transform;
}

.lite-slider--effect-slide .lite-slider__slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	position: relative;
}

/* 5. 平滑淡入淡出 (Fade 模式) */
.lite-slider--effect-fade .lite-slider__track {
	position: relative;
}

.lite-slider--effect-fade .lite-slider__slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--slider-speed, 500ms) ease, visibility var(--slider-speed, 500ms) ease;
	z-index: 1;
}

.lite-slider--effect-fade .lite-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

/* 6. 投影片內部排版與圖片展示 */
.lite-slider__slide-inner {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}

.lite-slider__link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.lite-slider__image {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: center;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition: opacity 0.3s ease;
}

.lite-slider__image--lazy {
	opacity: 0;
}

.lite-slider__image.is-loaded {
	opacity: 1;
}

/* 原圖比例 (Auto) 模式：依照原始圖片尺寸 100% 寬度等比縮放，完全不裁切 */
.lite-slider--ratio-auto .lite-slider__image {
	object-fit: contain !important;
}

.lite-slider--ratio-auto:not([style*="--slider-ratio-w"]) .lite-slider__track-wrapper {
	aspect-ratio: auto;
	height: auto;
}

.lite-slider--ratio-auto:not([style*="--slider-ratio-w"]) .lite-slider__image {
	height: auto !important;
	max-height: none !important;
}

/* 7. 投影片標題與描述文案 (Caption Overlay) */
.lite-slider__caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 40px 30px 24px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 65%, transparent 100%);
	color: #ffffff;
	pointer-events: none;
	z-index: 3;
}

.lite-slider__caption-content {
	max-width: 1140px;
	margin: 0 auto;
}

.lite-slider__title {
	font-family: inherit;
	font-size: clamp(1.2rem, 3vw, 2rem);
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 8px !important;
	color: #ffffff !important;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.lite-slider__desc {
	font-family: inherit;
	font-size: clamp(0.9rem, 1.6vw, 1.1rem);
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.9) !important;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.lite-slider__desc p {
	margin: 0 !important;
}

/* 8. 導航箭頭控制鈕 */
.lite-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
	opacity: 0.75;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lite-slider__arrow:hover {
	background: rgba(255, 255, 255, 0.5);
	opacity: 1;
	transform: translateY(-50%) scale(1.06);
}

.lite-slider__arrow:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.lite-slider__arrow--prev {
	left: 18px;
}

.lite-slider__arrow--next {
	right: 18px;
}

.lite-slider__arrow svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
}

/* 9. 分頁指示圓點 */
.lite-slider__dots {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
}

.lite-slider__dot {
	width: 10px;
	height: 10px;
	border-radius: 5px;
	border: none;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	padding: 0;
	transition: all 0.25s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lite-slider__dot:hover {
	background: rgba(255, 255, 255, 0.8);
}

.lite-slider__dot.is-active {
	width: 24px;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.lite-slider__dot:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* 10. 行動端適應優化 */
@media (max-width: 640px) {
	.lite-slider__arrow {
		width: 36px;
		height: 36px;
	}

	.lite-slider__arrow--prev {
		left: 10px;
	}

	.lite-slider__arrow--next {
		right: 10px;
	}

	.lite-slider__arrow svg {
		width: 16px;
		height: 16px;
	}

	.lite-slider__caption {
		padding: 20px 16px 16px;
	}

	.lite-slider__dots {
		bottom: 10px;
	}
}
