/* =========================================================
 * FW Slider – 前端样式
 * 仿 ProSlider 的视觉：圆形深色箭头、胶囊圆点、淡入淡出。
 * 只承载图片，所有设备下图片宽度 100%，高度按图片比例自适应。
 * ========================================================= */

.fws-slider {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	line-height: 0;
	font-size: 16px;
	box-sizing: border-box;
	--fws-arrow-color: #ffffff;
	--fws-arrow-bg: rgba( 0, 0, 0, 0.35 );
	--fws-dot-color: rgba( 255, 255, 255, 0.5 );
	--fws-dot-active: #ffffff;
}

/*
 * 屏幕全宽：宽度与左偏移由前端脚本按真实视口宽度计算后写入内联样式。
 * 不使用 100vw，避免 Windows 等平台滚动条带来的横向溢出。
 */
.fws-slider.fws-fullbleed {
	max-width: none;
}

.fws-slider:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.fws-viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #0b0d10;
}

.fws-ready .fws-viewport {
	transition: height 0.5s cubic-bezier( 0.4, 0, 0.2, 1 );
}

/* ---------- 幻灯片：叠放 + 淡入淡出 ---------- */
.fws-slide {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	z-index: 0;
	transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* 脚本就绪前的降级：只显示第一张，容器高度由第一张图片撑开 */
.fws-slide:first-child {
	position: relative;
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.fws-ready .fws-slide {
	position: absolute;
	opacity: 0;
	visibility: hidden;
	z-index: 0;
}

.fws-ready .fws-slide.fws-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.fws-slide:not(.fws-active) {
	pointer-events: none;
}

/* ---------- 图片：始终全宽、高度自适应 ---------- */
.fws-slider .fws-img {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: initial;
	vertical-align: top;
	-webkit-user-drag: none;
}

/* 图片链接：铺满整张幻灯片，不产生额外高度 */
.fws-slider .fws-link {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	color: inherit;
	line-height: 0;
	text-decoration: none;
}

.fws-slider .fws-link:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: -4px;
}

/* ---------- 左右箭头 ---------- */
.fws-arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 5;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var( --fws-arrow-bg, rgba( 0, 0, 0, 0.35 ) );
	color: var( --fws-arrow-color, #ffffff );
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: background 0.25s ease, filter 0.25s ease, opacity 0.35s ease;
}

.fws-ready .fws-arrow {
	opacity: 1;
}

/* 初始化完成前隐藏导航，避免无脚本时出现不可聚焦的透明按钮 */
.fws-slider:not( .fws-ready ) .fws-arrow,
.fws-slider:not( .fws-ready ) .fws-dots {
	visibility: hidden;
}

.fws-arrow svg {
	display: block;
	width: 1em;
	height: 1em;
	flex: none;
}

.fws-arrow.fws-next svg {
	transform: scaleX( -1 ); /* 下一张：同款箭头镜像 */
}

.fws-arrow:hover {
	filter: brightness( 1.35 );
}

.fws-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fws-prev {
	left: 16px;
}

.fws-next {
	right: 16px;
}

/* ---------- 圆点导航 ---------- */
.fws-dots {
	position: absolute;
	right: 0;
	bottom: 22px;
	left: 0;
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	line-height: 0;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.fws-ready .fws-dots {
	opacity: 1;
}

.fws-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: var( --fws-dot-color, rgba( 255, 255, 255, 0.5 ) );
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.35 );
	cursor: pointer;
	transition: width 0.3s ease, background 0.3s ease;
}

.fws-dot.fws-active {
	width: 26px;
	background: var( --fws-dot-active, #ffffff );
}

.fws-dot:focus-visible {
	outline: 2px solid var( --fws-dot-active, #ffffff );
	outline-offset: 3px;
}

/* ---------- 屏幕阅读器文本 ---------- */
.fws-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

/* ---------- Elementor 编辑器占位 ---------- */
.fws-editor-placeholder {
	padding: 18px 20px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	color: #50575e;
	font-size: 14px;
	line-height: 1.6;
}

/* ---------- 移动端 ---------- */
@media ( max-width: 640px ) {
	.fws-arrow {
		display: none;
	}

	.fws-dots {
		bottom: 12px;
		gap: 6px;
	}

	.fws-dot {
		width: 8px;
		height: 8px;
	}

	.fws-dot.fws-active {
		width: 22px;
	}
}

/* ---------- 尊重系统「减少动态效果」 ---------- */
@media ( prefers-reduced-motion: reduce ) {
	.fws-slide,
	.fws-viewport,
	.fws-arrow,
	.fws-dot,
	.fws-dots {
		transition: none !important;
	}
}
