/**
 * 鑿花匠 ZAOHUAJIANG - 百葉切片入口頁專屬樣式 (Home Slits Stylesheet)
 *
 * @package Zaohuajiang_Child
 */

body.home {
	overflow: hidden;
}

#view-slits {
	background: var(--zhj-bg, #F9F8F6);
	color: var(--zhj-text-primary, #1C1C1A);
	position: relative;
	height: calc(100vh - var(--zhj-header-height, 80px));
	min-height: 540px;
	overflow: hidden;
}

@media (max-width: 768px) {
	#view-slits {
		height: calc(100vh - 64px);
	}
}

.slits-stage-inner {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	padding: 0 5vw;
	position: relative;
	overflow-x: auto;
	scrollbar-width: none;
}

.slits-stage-inner::-webkit-scrollbar {
	display: none;
}

.slits-deck {
	display: flex;
	min-width: max-content;
	height: 68vh;
	align-items: center;
	gap: 20px;
	position: relative;
	z-index: 10;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.slits-deck.is-dragging,
.slits-deck.is-dragging .slit-blade {
	cursor: grabbing;
}

@media (max-width: 768px) {
	.slits-deck {
		height: 58vh;
	}
}

.slit-blade {
	width: 20px;
	flex: 0 0 auto;
	height: 100%;
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	background: var(--zhj-bg-subtle, #F0EFEA);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	transition: width 0.75s cubic-bezier(0.25, 1, 0.5, 1);
	border: 1px solid rgba(28, 28, 26, 0.08);
}

.slit-blade.is-active {
	border-color: rgba(28, 28, 26, 0.14);
	max-width: min(72vw, 960px);
	will-change: width;
}

.slit-blade:hover {
	border-color: rgba(122, 92, 36, 0.3);
}

.slit-blade img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

/* 黑色半透明遮罩層 (25% 沉靜暗色，硬體零負擔) */
.slit-blade::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.25);
	pointer-events: none;
	transition: opacity 0.4s ease;
	border-radius: inherit;
}

/* 當前展開作品：遮罩消失，呈現 100% 原始鮮明風采 */
.slit-blade.is-active::after {
	opacity: 0;
}

/* 懸停時稍微亮起 */
.slit-blade:hover::after {
	opacity: 0.1;
}

/* -------------------------------------------------------------
   Slits Footer: 作品名稱正下方獨立資訊區 + 環狀倒數條
------------------------------------------------------------- */
.slits-stage-footer {
	position: absolute;
	bottom: 3vh;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 9px;
	z-index: 30;
	pointer-events: auto;
	width: max-content;
	max-width: min(90vw, 800px);
	box-sizing: border-box;
	transition: opacity 0.35s ease;
}

.slits-caption {
	white-space: nowrap;
	cursor: pointer;
	text-align: center;
	max-width: 100%;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.slits-caption-text {
	font-family: var(--zhj-font-serif);
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--zhj-text-primary, #1C1C1A);
	letter-spacing: 0.12em;
	transition: color 0.25s ease, text-shadow 0.25s ease;
}

@media (max-width: 768px) {
	.slits-stage-footer {
		max-width: min(82vw, calc(100vw - 84px));
		bottom: max(2.5vh, env(safe-area-inset-bottom, 16px));
	}
	.slits-caption {
		white-space: normal;
		text-wrap: balance;
		word-break: break-word;
		width: 100%;
	}
	.slits-caption-text {
		font-size: clamp(1rem, 4.2vw, 1.15rem);
		line-height: 1.38;
		display: inline-block;
	}
}

.slits-countdown-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 28px;
	height: 28px;
	cursor: pointer;
}

.slits-countdown-svg {
	width: 28px;
	height: 28px;
	display: block;
}

.countdown-track {
	stroke: var(--zhj-border, rgba(28, 28, 26, 0.1));
	stroke-width: 2;
	fill: none;
}

.countdown-bar {
	stroke: var(--zhj-wood-gold, #7A5C24);
	stroke-width: 2.2;
	fill: none;
	stroke-dasharray: 69.115;
	stroke-dashoffset: 0;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.08s linear;
}

.slits-scroll-hint {
	position: fixed;
	bottom: 1.8rem;
	left: 3vw;
	z-index: 40;
	font-family: var(--zhj-font-mono);
	font-size: 0.7rem;
	color: var(--zhj-text-muted);
	letter-spacing: 0.12em;
	pointer-events: none;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.slits-scroll-hint::before {
	content: '⇄';
	font-size: 0.9rem;
	color: var(--zhj-wood-gold);
}
