/*
Theme Name: Astra Child - FDScene
Template: astra
Version: 1.0.0
Text Domain: astra-child
Description: FDScene｜飛閱現場 Phase 1 專用 Astra 子佈景主題，僅承載 Footage 素材必要模板，不做額外裝飾樣式。
*/

/* Footage 單篇頁：Preview 影片響應式容器，避免手機版跑版或空白播放器 */
.footage-single__preview-embed iframe,
.footage-single__preview-embed embed,
.footage-single__preview-embed object {
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
}

.footage-single__meta,
.footage-single__specs {
	list-style: none;
	margin: 1.5em 0;
	padding: 0;
}

.footage-single__meta li,
.footage-single__specs li {
	margin-bottom: 0.5em;
}

.footage-single__preview-label {
	font-weight: bold;
	margin-bottom: 0.5em;
}

.footage-single__cta {
	margin: 2em 0;
}

.footage-single__line-btn {
	display: inline-block;
	padding: 0.75em 1.5em;
	font-weight: bold;
	text-decoration: none;
}

.footage-single__line-note {
	margin-top: 0.5em;
	font-size: 0.9em;
	opacity: 0.75;
}

.footage-single__license-types {
	margin: 1.5em 0;
}

.footage-single__license-types ul {
	list-style: none;
	margin: 0.5em 0 0;
	padding: 0;
}

.footage-single__license-types li {
	margin-bottom: 0.4em;
}

.footage-single__sold {
	margin: 1.5em 0;
	padding: 0.75em 1em;
	font-weight: bold;
	font-size: 1.1em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	display: inline-block;
}

/* Footage 列表／分類頁：卡片格線 */
.footage-archive__header {
	margin: 1.5em 0;
}

.footage-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5em;
	margin: 1.5em 0;
}

/* Footage 卡片：影音平台式版型，16:9 縮圖為主視覺 */
.footage-card {
	border: 1px solid rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.footage-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.footage-card__thumb {
	aspect-ratio: 16 / 9;
	background: #e3e3e3;
	overflow: hidden;
}

.footage-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.footage-card__thumb-placeholder {
	width: 100%;
	height: 100%;
	background: #e3e3e3;
}

.footage-card__body {
	padding: 0.75em;
}

.footage-card__title {
	font-size: 1em;
	line-height: 1.3;
	margin: 0 0 0.4em;
}

.footage-card__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.85em;
	line-height: 1.6;
	color: rgba(0, 0, 0, 0.65);
}

.footage-card__id {
	font-weight: bold;
	color: inherit;
}

.footage-card__license {
	font-weight: bold;
}

.footage-card__price {
	font-weight: bold;
}

/*
 * Astra 4.x 對 .site-content 內的 .ast-container 套用動態產生的
 * `display: flex; flex-direction: column;`（用來做區塊間距），
 * 這會讓每個 Footage 模板裡的內容（chips／地圖／Grid／單篇欄位…）變成
 * flex item 而非一般區塊，因為 align-items 沒有 stretch，內容會被壓成
 * 貼齊一邊的極窄直條。這裡用比 Astra 規則更高的選擇器優先度（多一層
 * 模板自己的 class）蓋回一般區塊排版，不需要 !important。
 */
.site-content .ast-container.front-page,
.site-content .ast-container.footage-archive,
.site-content .ast-container.footage-single,
.site-content .ast-container.footage-search {
	display: block;
}

/* 首頁：事件分類 chips 列，仿影音平台 topic chips，窄畫面可水平捲動 */
.chips-nav {
	margin: 1.5em 0;
}

.chips-list {
	display: flex;
	gap: 0.5em;
	list-style: none;
	margin: 0;
	padding: 0.25em 0;
	overflow-x: auto;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch;
}

.chip {
	display: inline-block;
	padding: 0.5em 1.1em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	text-decoration: none;
	font-size: 0.9em;
	white-space: nowrap;
}

.chip:hover {
	background: rgba(0, 0, 0, 0.12);
}

.chip--all {
	font-weight: bold;
}

/* 首頁：Footage 卡片 Grid，1920/1366/768/390 對應 4/3/2/1 欄 */
.footage-grid--home {
	grid-template-columns: 1fr;
	margin: 1.5em 0 2.5em;
}

@media (min-width: 768px) {
	.footage-grid--home {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.footage-grid--home {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1600px) {
	.footage-grid--home {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* 首頁：素材地圖（Leaflet） */
.footage-map {
	margin: 1.5em 0 2.5em;
	/* Leaflet's internal panes/controls use position:absolute with hard
	   z-index values up to 1000. Without a stacking context of its own,
	   those values compare directly against the site header's z-index
	   (99) and win, covering the mobile menu when it's open. Isolating
	   this wrapper contains Leaflet's z-index scale inside it. */
	isolation: isolate;
}

.footage-map__empty {
	margin: 0 0 0.75em;
	font-size: 0.9em;
	opacity: 0.8;
}

.footage-map__canvas {
	width: 100%;
	height: 450px;
}

@media (max-width: 767px) {
	.footage-map__canvas {
		height: 300px;
	}
}

/* 篩選素材頁：搜尋表單 */
.footage-search__header {
	margin: 1.5em 0;
}

.footage-search-form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1em;
	margin: 0 0 1.5em;
	max-width: 100%;
}

.footage-search-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	min-width: 0;
}

.footage-search-form__field select,
.footage-search-form__field input[type="date"] {
	max-width: 100%;
}

.footage-search-form__actions {
	display: flex;
	align-items: center;
	gap: 1em;
}

.footage-search-summary {
	font-size: 0.9em;
	opacity: 0.8;
	margin: 0 0 1em;
}

.footage-search-empty {
	margin: 2em 0;
	font-weight: bold;
}

@media (max-width: 767px) {
	.footage-search-form {
		flex-direction: column;
		align-items: stretch;
	}

	.footage-search-form__field select,
	.footage-search-form__field input[type="date"] {
		width: 100%;
	}
}
