/* ==========================================================================
   首頁 Hero Banner（可從後台編輯）
   版型定案：選項 A —— 2.4:1 寬幅、左側文字鎖定區。
   標記由 inc/hero-slider.php 的 [techez_hero] 短碼輸出。
   命名空間刻意用 tz-hero，與舊的 techez-hero-slider 完全分開，
   兩者可並存，方便用 ?techez_hero=1 逐一比對後再切換。
   ========================================================================== */

.tz-hero {
	--tz-hero-focus: center;
	--tz-hero-accent: #d3b574;

	position: relative;
	width: 100%;
	/* 2.4:1；1440 寬時正好 600px，並限制極端視窗下的高度 */
	height: clamp(440px, 41.6667vw, 820px);
	overflow: hidden;
	background: #0f1114;
	/* 讓內部可用 cqw / cqh 做影片的等比覆蓋裁切 */
	container-type: size;
}

.tz-hero__track {
	position: absolute;
	inset: 0;
}

.tz-hero__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity .8s ease;
}

.tz-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

/* --- 背景 --- */

.tz-hero__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.tz-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--tz-hero-focus);
	display: block;
}

/* 影片：object-fit 對 iframe 無效，YouTube 會自己補黑邊。
   改用容器查詢單位算出「等比覆蓋」所需的尺寸，把黑邊擠到可視範圍外。
   不支援 cq 單位的瀏覽器會忽略這兩行 max()，退回上面的 100% / 100%。 */
.tz-hero__yt {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%) scale(1.06);
	border: 0;
	/* 播放器介面不接受滑鼠事件，否則暫停鍵、標題列、更多影片會冒出來 */
	pointer-events: none;
}

@supports (width: 1cqw) {
	.tz-hero__yt {
		width: max(100%, calc(100cqh * 16 / 9));
		height: max(100%, calc(100cqw * 9 / 16));
	}
}

/* 再蓋一層，確保任何情況下都收不到點擊 */
.tz-hero__shield {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
}

.tz-hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 3;
	background: linear-gradient(90deg,
		rgba(10, 12, 14, .86) 0%,
		rgba(10, 12, 14, .62) 42%,
		rgba(10, 12, 14, 0) 72%);
}

/* --- 文字層 --- */

.tz-hero__inner {
	position: relative;
	z-index: 4;
	height: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 40px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 24px;
	pointer-events: none;
}

.tz-hero__inner > * { pointer-events: auto; }

.tz-hero__kicker {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: var(--tz-hero-accent);
}

.tz-hero__kicker i {
	width: 28px;
	height: 1px;
	background: var(--tz-hero-accent);
	display: block;
}

.tz-hero__title {
	max-width: 780px;
	margin: 0;
	font-size: clamp(30px, 3.7vw, 52px);
	line-height: 1.28;
	font-weight: 500;
	letter-spacing: .5px;
	color: #ffffff;
}

.tz-hero__desc {
	max-width: 500px;
	margin: 0;
	font-size: clamp(15px, 1.25vw, 18px);
	line-height: 1.85;
	font-weight: 300;
	color: rgba(255, 255, 255, .85);
}

.tz-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 38px;
	padding: 0 18px;
	border-radius: 19px;
	border: 1px solid rgba(255, 255, 255, .35);
	background: rgba(255, 255, 255, .08);
	font-size: 15px;
	color: #ffffff;
}

.tz-hero__badge i {
	font-style: normal;
	font-size: 13px;
	color: rgba(255, 255, 255, .62);
}

.tz-hero__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 6px;
	flex-wrap: wrap;
}

.tz-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 30px;
	background: var(--tz-hero-accent);
	color: #1c1e21;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: .5px;
	text-decoration: none;
	border-radius: 0;
	transition: background-color .2s ease, color .2s ease;
}

.tz-hero__cta:hover,
.tz-hero__cta:focus-visible {
	background: #e5cd97;
	color: #1c1e21;
}

.tz-hero__cta--ghost {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .38);
	color: #ffffff;
	font-weight: 400;
}

.tz-hero__cta--ghost:hover,
.tz-hero__cta--ghost:focus-visible {
	background: rgba(255, 255, 255, .12);
	border-color: rgba(255, 255, 255, .7);
	color: #ffffff;
}

/* 沒有按鈕時，整張可點 */
.tz-hero__link {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: block;
}

/* --- 左右箭頭 --- */

.tz-hero__arrow {
	position: absolute;
	top: 50%;
	z-index: 6;
	width: 48px;
	height: 48px;
	margin: -24px 0 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .32);
	border-radius: 0;
	background: rgba(0, 0, 0, .18);
	cursor: pointer;
	opacity: 0;
	transition: opacity .25s ease, background-color .2s ease;
}

.tz-hero:hover .tz-hero__arrow,
.tz-hero__arrow:focus-visible { opacity: 1; }

.tz-hero__arrow:hover { background: rgba(0, 0, 0, .42); }

.tz-hero__arrow::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 11px;
	border-top: 2px solid #ffffff;
	border-right: 2px solid #ffffff;
}

.tz-hero__arrow--prev { left: 28px; }
.tz-hero__arrow--next { right: 28px; }

.tz-hero__arrow--prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.tz-hero__arrow--next::before { transform: translate(-70%, -50%) rotate(45deg); }

/* --- 圓點 --- */

.tz-hero__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 30px;
	z-index: 6;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.tz-hero__dot {
	width: 10px;
	height: 3px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(255, 255, 255, .45);
	cursor: pointer;
	transition: width .3s ease, background-color .3s ease;
}

.tz-hero__dot.is-active {
	width: 30px;
	background: var(--tz-hero-accent);
}

/* --- 響應式 --- */

@media (max-width: 1024px) {
	.tz-hero__inner { padding: 0 28px; gap: 20px; }
	.tz-hero__arrow--prev { left: 16px; }
	.tz-hero__arrow--next { right: 16px; }
}

@media (max-width: 767px) {
	.tz-hero {
		/* 手機直向：文字需要空間，改用較高的版面 */
		height: 480px;
	}

	.tz-hero__scrim {
		/* 橫向漸層在窄螢幕蓋不住文字，改由下往上 */
		background: linear-gradient(180deg,
			rgba(10, 12, 14, .30) 0%,
			rgba(10, 12, 14, .58) 42%,
			rgba(10, 12, 14, .92) 100%);
	}

	.tz-hero__inner {
		justify-content: flex-end;
		padding: 0 20px 62px;
		gap: 16px;
	}

	.tz-hero__title { max-width: none; }
	.tz-hero__desc  { max-width: none; }

	.tz-hero__actions { gap: 12px; }
	.tz-hero__cta { height: 48px; padding: 0 24px; font-size: 15px; }

	/* 觸控裝置沒有 hover，箭頭常駐顯示 */
	.tz-hero__arrow { opacity: 1; width: 42px; height: 42px; margin-top: -21px; }
	.tz-hero__dots { bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.tz-hero__slide { transition: none; }
	.tz-hero__dot   { transition: none; }
}

/* ==========================================================================
   新舊 Hero 的切換
   ==========================================================================
   這裡原本有一條 body.tz-new-hero .techez-hero-slider { display:none }，
   用來在新 Hero 出現時把舊輪播藏起來。2026-09-03 舊輪播的標記、CSS 與 JS
   都已刪除（見 style.css 末段與 techez-backups/phaseE2-deadcode/），
   沒有東西要藏了，故一併移除。
   關掉 TECHEZ_NEW_HERO 現在只會讓 Hero 不輸出，不會退回舊輪播。
   ========================================================================== */

/* Hero 與下方 NEWS 的間距，交給 .tz-news 自己的 padding-top 負責。
   這裡刻意 margin-bottom: 0 ——
   舊 Hero 時代這條是 95px（手機 48px），但 .tz-news 已經有
   padding-top: 96px 且底色是白的，兩者相加會在深色 Hero 下方
   先擠出一條 95px 的頁面底色（灰）再接白色留白，
   看起來像一個空掉的區塊。2026-09-03 移除。 */
body.tz-new-hero .tz-hero {
	margin-bottom: 0;
}
