/*
 * 青年高中佈景主題樣式
 *
 * 顏色、字級、間距的數值都在 theme.json，這裡用 var(--wp--preset--...) 取用，不寫死色碼。
 * 手機優先：沒有 @media 的規則是 390px 手機版；只有兩個斷點：
 *   768px  平板（卡片變兩欄以上）
 *   1024px 桌機（選單展開、單位內導覽移到左側）
 *
 * 目錄
 *   1. 基礎：焦點框、跳到主要內容、報讀器文字、觸控尺寸
 *   2. 頁首與主選單
 *   3. 頁面骨架、麵包屑、單位內導覽
 *   4. 區塊元件：按鈕、卡片、公告列表、標籤、跳轉列
 *   5. 首頁
 *   6. 頁尾
 *   7. 外語專區（/vi/、/my/、/en/、/id/）
 */

/* ---------- 1. 基礎 ---------- */

:root {
	--youth-header-height: 64px;
	--youth-target: 44px;
	--youth-radius: 8px;
	--youth-focus: var(--wp--preset--color--link);
}

html {
	/* 固定頁首不會蓋住錨點與焦點 */
	scroll-padding-top: calc(var(--youth-header-height) + 1rem);
}

body {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* 所有焦點：3px 藍框、距元件 2px。不得改成 outline: none。 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--youth-focus);
	outline-offset: 2px;
	box-shadow: none;
}

/* WordPress 自動加入的「跳到主要內容」連結：Tab 第一個出現 */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--link);
	font-size: 1.0625rem;
	padding: 0.75rem 1rem;
	z-index: 100000;
	clip: auto !important;
	clip-path: none;
	height: auto;
	width: auto;
	left: 0.5rem;
	top: 0.5rem;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

img {
	max-width: 100%;
	height: auto;
}

/* 內文連結：行高 1.75 已拉開上下距離，加粗底線讓連結更好辨認 */
.wp-block-post-content a:where(:not(.wp-element-button)) {
	text-underline-offset: 0.2em;
}

/* 減少動態效果的使用者 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- 2. 頁首與主選單 ---------- */

.youth-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.admin-bar .youth-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

.youth-header__inner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: var(--youth-header-height);
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: 0 var(--wp--style--root--padding-right, 1rem) 0 var(--wp--style--root--padding-left, 1rem);
}

/* 校徽＋校名 */
.youth-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 48px;
	margin-right: auto;
	flex-shrink: 0;
	white-space: nowrap;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	text-decoration: none;
}

.youth-brand__logo {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

/* 頁首的「搜尋」按鈕（只在手機出現；桌機用主選單裡的搜尋框） */
.youth-header-search .wp-block-search__button,
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close,
.wp-block-navigation-overlay-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-width: 48px;
	min-height: 48px;
	padding: 0 0.5rem;
	margin: 0;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
}

/* 「選單」按鈕：三條線圖示＋文字 */
.wp-block-navigation__responsive-container-open::before {
	content: "";
	width: 20px;
	height: 20px;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16v2H4zM4 11h16v2H4zM4 16h16v2H4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.youth-header-search .wp-block-search__button::before {
	content: "";
	width: 20px;
	height: 20px;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 0 1 5.6 11.2l5.1 5.1-1.4 1.4-5.1-5.1A7 7 0 1 1 10 3zm0 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 頁首搜尋展開時，輸入框放在頁首下方整列 */
.youth-header-search {
	position: static;
}

.youth-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	display: flex;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

/* 搜尋框 */
.wp-block-search__input {
	min-height: 48px;
	padding: 0 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
	font-size: 1.0625rem;
	color: var(--wp--preset--color--text);
}

.wp-block-search__button:not(.youth-header-search .wp-block-search__button) {
	min-height: 48px;
	white-space: nowrap;
	border: 0;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--text);
	font-weight: 500;
}

/* 主選單：所有選單項目至少 44px 高 */
.youth-main-nav .wp-block-navigation-item__content,
.youth-main-nav .wp-block-navigation-submenu__toggle {
	display: flex;
	align-items: center;
	min-height: var(--youth-target);
	font-size: 1.0625rem;
	font-weight: 500;
	text-decoration: none;
	color: var(--wp--preset--color--text);
}

.youth-main-nav .current-menu-item > .wp-block-navigation-item__content,
.youth-main-nav [aria-current="page"] {
	color: var(--wp--preset--color--brand-text);
	font-weight: 700;
}

/* 外連圖示（inc/render.php 加上的） */
.youth-external {
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-left: 0.25em;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3h7v7h-2V6.4l-9.3 9.3-1.4-1.4L17.6 5H14V3zM5 5h6v2H5v12h12v-6h2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	vertical-align: -0.05em;
}

/* --- 手機全螢幕選單（< 1024px） --- */

.youth-main-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
}

.youth-main-nav .is-menu-open .wp-block-navigation__responsive-container-close {
	position: absolute;
	top: 0.5rem;
	right: 1rem;
}

.youth-main-nav .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 4.5rem;
	gap: 0;
	align-items: stretch;
}

.youth-main-nav .is-menu-open .wp-block-navigation__container,
.youth-main-nav .is-menu-open .wp-block-navigation__submenu-container {
	flex-direction: column;
	align-items: stretch !important;
	gap: 0 !important;
	width: 100%;
}

.youth-main-nav .is-menu-open .wp-block-navigation-item {
	width: 100%;
	align-items: stretch !important;
}

.youth-main-nav .is-menu-open .wp-block-navigation-item__content {
	justify-content: flex-start;
	text-align: left;
	width: 100%;
}

/* 主選單項：每列 56px，整列都是展開鈕 */
.youth-main-nav .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-main-nav .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle,
.youth-main-nav .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	width: 100%;
	min-height: 56px;
	justify-content: space-between;
	padding: 0 0.25rem;
}

/* 手機選單的下一層：WordPress 內建是全部展開；assets/js/theme.js 改成手風琴，
   一次只展開按下的那一項（沒有 JS 時維持全部展開，一樣能用）。 */
.youth-main-nav .is-menu-open .wp-block-navigation__submenu-container {
	position: static !important;
	width: 100% !important;
	min-width: 0 !important;
	padding: 0 0 0.5rem 1rem !important;
	border: 0 !important;
}

.youth-main-nav .is-menu-open .youth-collapsed > .wp-block-navigation__submenu-container {
	display: none !important;
}

.youth-main-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	min-height: 48px;
	padding: 0 0.25rem;
	font-weight: 400;
}

.youth-main-nav .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	position: relative;
}

/* 展開圖示疊在整列按鈕的右側，點到圖示也是點到按鈕 */
.youth-main-nav .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-icon {
	display: inline-flex !important;
	position: absolute;
	top: 22px;
	right: 0.5rem;
	width: 12px;
	height: 12px;
	margin: 0;
	pointer-events: none;
}

.youth-main-nav .is-menu-open .wp-block-navigation-item:not(.youth-collapsed) > .wp-block-navigation__submenu-icon {
	transform: rotate(180deg);
}

/* 手機選單裡「招生資訊」由兩個大按鈕代替 */
.youth-main-nav .is-menu-open .is-admissions {
	display: none !important;
}

/* 手機選單最上方的搜尋框 */
.youth-main-nav .youth-nav-search {
	width: 100%;
	margin-bottom: 1rem;
}

.youth-main-nav .youth-nav-search .wp-block-search__inside-wrapper {
	gap: 0.5rem;
}

/* 兩個校徽橙大按鈕：招生網、僑生網 */
.youth-main-nav .youth-nav-cta {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
	margin: 1rem 0;
}

.youth-main-nav .youth-nav-cta .wp-block-button,
.youth-main-nav .youth-nav-cta .wp-block-button__link {
	width: 100%;
}

.youth-main-nav .youth-nav-cta .wp-block-button__link {
	min-height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* 工具列連結（手機排在最下方） */
.youth-main-nav .is-menu-open .is-utility .wp-block-navigation-item__content {
	min-height: var(--youth-target);
	font-weight: 400;
}

/* 選單按鈕在桌機隱藏時不佔位 */
.youth-main-nav:not(:has(.is-menu-open)) .youth-nav-cta {
	display: none;
}

/* ---------- 2b. 桌機選單（≥ 1024px） ---------- */

@media (min-width: 1024px) {
	.youth-header-search {
		display: none;
	}

	.youth-main-nav .wp-block-navigation__responsive-container-content {
		flex-wrap: wrap;
		justify-content: flex-end;
		row-gap: 0;
		column-gap: 1.25rem;
	}

	/* 工具列連結排到最上方一列 */
	.youth-main-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container:has(.is-utility) {
		order: -2;
		flex-basis: 100%;
		justify-content: flex-end;
		gap: 1rem;
	}

	.youth-main-nav .is-utility .wp-block-navigation-item__content {
		font-size: 0.9375rem;
		font-weight: 400;
		color: var(--wp--preset--color--text-muted);
	}

	.youth-main-nav .youth-nav-search {
		order: 10;
		width: 14rem;
		margin: 0;
	}

	/* 下拉選單：點擊展開，白底、邊框 */
	.youth-main-nav .wp-block-navigation__submenu-container {
		border: 1px solid var(--wp--preset--color--border) !important;
		border-radius: var(--youth-radius);
		padding: 0.5rem !important;
		background: var(--wp--preset--color--white) !important;
		min-width: 14rem !important;
	}

	.youth-main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 0 0.75rem;
		width: 100%;
	}

	/* 「行政處室」「群科介紹」大選單：一次看到全部 */
	.youth-main-nav .is-mega > .wp-block-navigation__submenu-container {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(10rem, 1fr));
		column-gap: 1rem;
	}

	.youth-main-nav .is-mega:has(> .wp-block-navigation__submenu-container > li:nth-child(11)) > .wp-block-navigation__submenu-container {
		grid-template-columns: repeat(3, minmax(10rem, 1fr));
	}
}

/* ---------- 3. 頁面骨架、麵包屑、單位內導覽 ---------- */

.youth-main {
	padding-top: 1rem;
	padding-bottom: 3rem;
}

.youth-main--home {
	padding-top: 0;
}

.youth-page > * + * {
	margin-top: 1rem;
}

.youth-page .wp-block-post-title {
	margin-top: 0.5rem;
}

/* 麵包屑：手機只留上一層「‹ 學務處」 */
.youth-breadcrumbs {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
}

.youth-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-breadcrumbs a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--youth-target);
	min-width: var(--youth-target);
}

@media (max-width: 1023.98px) {
	.youth-breadcrumbs li {
		display: none;
	}

	.youth-breadcrumbs li:nth-last-child(2) {
		display: inline-flex;
	}

	/* WordPress 用 li::after 畫分隔符號 */
	.youth-breadcrumbs li::after,
	.youth-breadcrumbs li::before {
		display: none !important;
		content: none !important;
	}

	.youth-breadcrumbs li:nth-last-child(2) a::before {
		content: "‹";
		margin-right: 0.25rem;
		font-size: 1.25em;
		line-height: 1;
	}
}

/* 單位內導覽：手機是 48px 高的收合鈕，桌機固定在左側 260px */
.youth-unit-nav__details {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
}

.youth-unit-nav__toggle {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 1rem;
	font-weight: 500;
	cursor: pointer;
}

.youth-unit-nav__list,
.youth-unit-nav__list ul {
	margin: 0;
	padding: 0 0.5rem 0.5rem;
	list-style: none;
}

.youth-unit-nav__list ul {
	padding: 0 0 0 1rem;
}

.youth-unit-nav a {
	display: flex;
	align-items: center;
	min-height: var(--youth-target);
	padding: 0 0.5rem;
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.youth-unit-nav a:hover {
	text-decoration: underline;
}

.youth-unit-nav a[aria-current="page"] {
	color: var(--wp--preset--color--brand-text);
	font-weight: 700;
	box-shadow: inset 4px 0 0 var(--wp--preset--color--brand-text);
}

.youth-unit-layout__content > * + * {
	margin-top: 1.5rem;
}

@media (min-width: 1024px) {
	.youth-unit-layout:has(.youth-unit-nav) {
		display: grid;
		grid-template-columns: 260px minmax(0, 1fr);
		gap: 2.5rem;
		align-items: start;
	}

	.youth-unit-nav {
		position: sticky;
		top: calc(var(--youth-header-height) + 1rem);
	}

	.youth-unit-nav__details {
		border: 0;
	}

	.youth-unit-nav__toggle {
		padding: 0 0.5rem;
		color: var(--wp--preset--color--text-muted);
		font-size: var(--wp--preset--font-size--small);
	}
}

/* 內文欄最寬 720px（約 40 個中文字） */
.youth-unit-layout__content {
	max-width: var(--wp--style--global--content-size);
}

.youth-page-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin-top: 3rem !important;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--emblem-grey);
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* 公告單篇的「發布｜更新｜單位」 */
.youth-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

.youth-post-meta__published::before {
	content: "發布 ";
}

.youth-post-meta__modified::before {
	content: "更新 ";
}

/* ---------- 4. 區塊元件 ---------- */

/* 按鈕：至少 44px 高、相鄰間距 8px */
.wp-element-button,
.wp-block-button__link,
.youth-button-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--youth-target);
	text-align: center;
}

.wp-block-buttons {
	gap: 0.5rem;
}

.wp-block-button__link:active {
	background: var(--wp--preset--color--brand-text);
	color: var(--wp--preset--color--white);
}

/* 次要按鈕：深橙底白字 */
.wp-block-button.is-style-secondary .wp-block-button__link {
	background: var(--wp--preset--color--brand-text);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-secondary .wp-block-button__link:hover,
.wp-block-button.is-style-secondary .wp-block-button__link:focus,
.wp-block-button.is-style-secondary .wp-block-button__link:active {
	background: var(--wp--preset--color--brand-pressed);
	color: var(--wp--preset--color--white);
}

.youth-button-large .wp-block-button__link {
	min-height: 56px;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	font-size: var(--wp--preset--font-size--large);
}

/* 「看全部」連結：外框按鈕 */
.youth-button-link {
	padding: 0.5rem 1.25rem;
	border: 2px solid var(--wp--preset--color--brand-text);
	border-radius: var(--youth-radius);
	color: var(--wp--preset--color--brand-text);
	font-weight: 500;
	text-decoration: none;
}

.youth-button-link:hover {
	background: var(--wp--preset--color--brand-tint);
}

/* 區塊與區塊標題 */
.youth-section {
	margin-top: 2.5rem;
}

.youth-section > h2:first-child {
	margin-top: 0;
	margin-bottom: 1rem;
}

.youth-section__body > * + * {
	margin-top: 1rem;
}

.youth-intro {
	font-size: var(--wp--preset--font-size--large);
}

/* 卡片 */
.youth-cards {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-card {
	margin: 0 !important;
	padding: 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--white);
}

.youth-card > * {
	margin: 0;
}

.youth-card > * + * {
	margin-top: 0.5rem;
}

.youth-card__title {
	font-size: var(--wp--preset--font-size--large);
}

.youth-card__title a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
}

.youth-card__meta,
.youth-card__phone {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

.youth-card__phone a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
	min-width: var(--youth-target);
}

@media (min-width: 768px) {
	.youth-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.youth-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* 公告列表：每則一整列可點，最少 72px 高 */
.youth-news__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-news__item {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 72px;
	margin: 0 !important;
	padding: 0.75rem 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-news__item:hover {
	background: var(--wp--preset--color--surface);
}

.youth-news__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.75rem;
	margin: 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}

.youth-news__meta .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

.youth-news__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	line-height: 1.5;
}

.youth-news__title a {
	display: flex;
	align-items: center;
	min-height: var(--youth-target);
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

/* 標題連結延伸到整列：整列都可以點 */
.youth-news__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.youth-news__title a:hover {
	text-decoration: underline;
}

.youth-news__title a:focus-visible {
	outline: none;
}

.youth-news__title a:focus-visible::after {
	outline: 3px solid var(--youth-focus);
	outline-offset: -1px;
}

/* 公告列表裡的分類連結要能單獨點，放在延伸連結上面 */
.youth-news__meta a {
	position: relative;
	z-index: 1;
}

.youth-news__more {
	margin-top: 1rem;
}

/* 有照片的版本（校園動態） */
.youth-news.has-images .youth-news__list {
	display: grid;
	gap: 1rem;
	border: 0;
}

.youth-news.has-images .youth-news__item {
	justify-content: flex-start;
	padding: 0;
	border: 0;
}

.youth-news__image {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--youth-radius);
	margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
	.youth-news.has-images .youth-news__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* 篩選標籤：手機左右滑動，每個 44px 高 */
.youth-filters ul {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1rem;
	padding: 0 0 0.25rem;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: thin;
}

.youth-filters a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
	padding: 0 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--text);
	white-space: nowrap;
	text-decoration: none;
}

.youth-filters a:hover {
	border-color: var(--wp--preset--color--brand-text);
	color: var(--wp--preset--color--brand-text);
}

/* 標籤（班別） */
.wp-block-list.is-style-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	list-style: none;
}

.wp-block-list.is-style-tags li {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 0.875rem;
	border-radius: 999px;
	background: var(--wp--preset--color--brand-tint);
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

/* 頁內跳轉列：手機橫向滑動，每項 44px */
.youth-jump-nav {
	position: sticky;
	top: var(--youth-header-height);
	z-index: 10;
	margin: 1.5rem calc(-1 * var(--wp--style--root--padding-left, 1rem)) 0;
	padding: 0 var(--wp--style--root--padding-left, 1rem);
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.admin-bar .youth-jump-nav {
	top: calc(var(--youth-header-height) + var(--wp-admin--admin-bar--height, 0px));
}

.youth-jump-nav ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
}

.youth-jump-nav a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
	padding: 0 0.75rem;
	color: var(--wp--preset--color--text);
	white-space: nowrap;
	text-decoration: none;
}

.youth-jump-nav a:hover {
	color: var(--wp--preset--color--brand-text);
	text-decoration: underline;
}

@media (min-width: 1024px) {
	.youth-jump-nav {
		margin-left: 0;
		margin-right: 0;
		padding: 0;
	}
}

/* 科別卡片：照片＋科名，手機兩欄 */
.youth-dept-cards__group {
	margin: 1.5rem 0 0.75rem;
}

.youth-dept-cards__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-dept-card a {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: 100%;
	padding-bottom: 0.5rem;
	color: var(--wp--preset--color--text);
	font-weight: 500;
	text-decoration: none;
}

.youth-dept-card a:hover .youth-dept-card__name {
	text-decoration: underline;
}

.youth-dept-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--surface);
}

@media (min-width: 1024px) {
	.youth-dept-cards__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* 處室首頁「我要…」按鈕：手機每個整列 */
.youth-tasks {
	flex-direction: column;
	align-items: stretch;
}

@media (min-width: 768px) {
	.youth-tasks {
		flex-direction: row;
	}
}

/* 圖片說明 */
.wp-element-caption {
	margin-top: 0.5rem;
}

/* 表格：窄螢幕可以左右滑動，不撐開頁面 */
.wp-block-table {
	overflow-x: auto;
}

.wp-block-table table {
	border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
}

/* ---------- 5. 首頁（版面 A「校刊頭版」，2026-10-24 選定） ---------- */

/*
 * 像報紙頭版：不用卡片、框、陰影與漸層，只用線分隔。
 *   粗線 3px 內文色、細線 1px 校徽灰、欄目標題下 2px、三欄區上方雙線。
 * 刊頭與頭條標題用系統明體（theme.json 的 system-serif），不載入網路字型。
 * 手機（< 768px）全部變成一欄，線照樣保留；頁首在 < 1024px 是精簡版。
 */

:root {
	--youth-serif: var(--wp--preset--font-family--system-serif);
	--youth-hair: 1px solid var(--wp--preset--color--emblem-grey);
	--youth-ink: var(--wp--preset--color--text);
}

/* 對象專頁的說明區塊 */
.youth-audience {
	margin-top: 1.5rem !important;
}

/* --- 首頁頁首：手機是一行明體校名＋「搜尋」「選單」，下方 3px 粗線 --- */

.youth-header--paper {
	border-bottom: 3px solid var(--youth-ink);
}

.youth-masthead {
	margin-right: auto;
}

.youth-masthead__name {
	margin: 0;
	font-family: var(--youth-serif);
	font-size: 1.5rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	line-height: 1.2;
}

.youth-masthead__tag,
.youth-topline {
	display: none;
}

@media (min-width: 1024px) {
	.youth-header--paper {
		position: static;
		border-bottom: 0;
	}

	/* 頂端細列：日期在左，搜尋、工具列連結、外語專區在右 */
	.youth-topline {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0 1.25rem;
		max-width: var(--wp--style--global--wide-size);
		margin: 0 auto;
		padding: 0 var(--wp--style--root--padding-right, 1rem) 0 var(--wp--style--root--padding-left, 1rem);
		border-bottom: var(--youth-hair);
		color: var(--wp--preset--color--text-muted);
		font-size: var(--wp--preset--font-size--small);
	}

	.youth-topline__date {
		margin: 0 auto 0 0;
		font-variant-numeric: tabular-nums;
	}

	.youth-topline ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0 1rem;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.youth-topline a {
		display: inline-flex;
		align-items: center;
		min-height: var(--youth-target);
		color: var(--wp--preset--color--text-muted);
	}

	.youth-topline a:hover {
		color: var(--wp--preset--color--brand-text);
	}

	.youth-topline__search {
		display: flex;
		gap: 0.25rem;
	}

	.youth-topline__search input,
	.youth-topline__search button {
		min-height: var(--youth-target);
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 4px;
		font: inherit;
	}

	.youth-topline__search input {
		width: 10rem;
		padding: 0 0.5rem;
	}

	.youth-topline__search button {
		padding: 0 0.75rem;
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--text);
		cursor: pointer;
	}

	/* 刊頭置中，選單列夾在 3px 粗線與 1px 線之間 */
	.youth-paper-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.youth-masthead {
		margin: 0;
		padding: 1.75rem 0 1.25rem;
		text-align: center;
	}

	.youth-masthead__name {
		font-size: 4rem;
		letter-spacing: 0.18em;
		line-height: 1.1;
		/* 字距會加在最後一個字後面，左邊補回來才會置中 */
		padding-left: 0.18em;
	}

	.youth-masthead__tag {
		display: block;
		margin: 0.375rem 0 0;
		color: var(--wp--preset--color--text-muted);
		letter-spacing: 0.1em;
	}

	/* WordPress 會把 youth-main-nav 也加在裡面的 ul 上，所以限定 nav */
	.youth-paper-bar nav.youth-main-nav {
		border-top: 3px solid var(--youth-ink);
		border-bottom: 1px solid var(--youth-ink);
	}

	.youth-paper-bar .youth-main-nav .wp-block-navigation__responsive-container-content {
		justify-content: center;
		column-gap: 0;
	}

	/* 搜尋與工具列連結已經在頂端細列 */
	.youth-paper-bar .youth-main-nav .wp-block-navigation__container:has(.is-utility),
	.youth-paper-bar .youth-main-nav .youth-nav-search {
		display: none !important;
	}

	.youth-paper-bar .youth-main-nav .wp-block-navigation__container {
		gap: 0 !important;
	}

	.youth-paper-bar .youth-main-nav .wp-block-navigation__container > .wp-block-navigation-item {
		padding: 0 1.25rem;
	}

	.youth-paper-bar .youth-main-nav .wp-block-navigation__container > .wp-block-navigation-item + .wp-block-navigation-item {
		border-left: var(--youth-hair);
	}
}

/* --- 頭版：頭條（左 2/3）與最新公告（右 1/3） --- */

.youth-paper > * + * {
	margin-top: 0;
}

.youth-paper .youth-section {
	margin-top: 0;
}

.youth-paper__heading {
	margin: 0 0 0.375rem;
	color: var(--youth-ink);
	padding-bottom: 0.25rem;
	border-bottom: 2px solid var(--youth-ink);
	font-size: var(--wp--preset--font-size--medium);
	letter-spacing: 0.14em;
}

.youth-paper__front {
	margin-top: 1rem;
}

.youth-lead__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.youth-lead__kicker {
	margin: 0.875rem 0 0;
	color: var(--wp--preset--color--brand-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.12em;
}

.youth-lead__title {
	margin: 0.375rem 0 0.75rem;
	font-family: var(--youth-serif);
	font-size: 1.625rem;
	font-weight: 900;
	line-height: 1.3;
	text-wrap: balance;
}

.youth-lead__title a {
	display: block;
	min-height: var(--youth-target);
	color: var(--youth-ink);
	text-decoration: none;
}

.youth-lead__title a:hover {
	text-decoration: underline;
}

.youth-lead__by {
	margin: 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
}

.youth-lead__excerpt {
	margin: 0.875rem 0 0;
}

.youth-paper__side {
	margin-top: 1.75rem !important;
}

/* 最新公告：明體標題在上，單位與日期在下，細線分隔 */
.youth-news.is-style-headlines .youth-news__list {
	border-top: 0;
}

.youth-news.is-style-headlines .youth-news__item {
	min-height: 0;
	padding: 0.625rem 0;
}

.youth-news.is-style-headlines .youth-news__item:hover {
	background: none;
}

.youth-news.is-style-headlines .youth-news__meta {
	order: 2;
}

.youth-news.is-style-headlines .youth-news__title {
	order: 1;
	font-family: var(--youth-serif);
	font-size: 1.0625rem;
	font-weight: 700;
}

/* 「全部公告」「完整行事曆」：深橙文字連結，不是按鈕 */
.youth-paper .youth-button-link {
	padding: 0;
	border: 0;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.youth-paper .youth-button-link:hover {
	background: none;
}

.youth-paper .youth-button-link::after {
	content: "→";
	margin-left: 0.25em;
	text-decoration: none;
}

.youth-paper .youth-news__more {
	margin-top: 0.5rem;
}

/* --- 雙線下的三欄：近期行事、群科、我是 --- */

.youth-paper__cols {
	display: grid;
	gap: 1.75rem;
	margin-top: 1.75rem !important;
	padding-top: 1.125rem;
	border-top: 3px double var(--youth-ink);
}

.youth-paper__col ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-paper__col li,
.youth-paper .youth-calendar__item {
	margin: 0;
	padding: 0.25rem 0;
	border-bottom: 1px dotted var(--wp--preset--color--emblem-grey);
}

.youth-paper__col li a {
	display: inline-flex;
	align-items: center;
	gap: 0.25em;
	min-width: var(--youth-target);
	min-height: var(--youth-target);
	color: var(--youth-ink);
}

.youth-paper .youth-calendar__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.75rem;
	min-height: var(--youth-target);
}

.youth-paper .youth-calendar__item p {
	margin: 0;
}

.youth-paper .youth-calendar__date {
	min-width: 4.5em;
	color: var(--wp--preset--color--brand-text);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.youth-paper .youth-calendar__location {
	flex-basis: 100%;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* 訂閱與 Google 日曆連結在 /calendar/，首頁只留「完整行事曆」 */
.youth-paper .youth-calendar__links a:not(:first-child) {
	display: none;
}

@media (min-width: 768px) {
	.youth-paper__front {
		display: grid;
		grid-template-columns: 2fr 1fr;
		margin-top: 1.75rem;
	}

	.youth-lead {
		padding-right: 2rem;
		border-right: var(--youth-hair);
	}

	.youth-lead__image {
		aspect-ratio: 12 / 5;
	}

	.youth-lead__title {
		font-size: 2.375rem;
	}

	.youth-lead__excerpt {
		column-count: 2;
		column-gap: 1.75rem;
	}

	.youth-paper__side {
		margin-top: 0 !important;
		padding-left: 1.75rem;
	}

	/* 沒有頭條時，最新公告佔滿整列 */
	.youth-paper__front:not(:has(.youth-lead)) {
		grid-template-columns: 1fr;
	}

	.youth-paper__front:not(:has(.youth-lead)) .youth-paper__side {
		padding-left: 0;
	}

	.youth-paper__cols {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0;
		margin-top: 2.25rem !important;
	}

	.youth-paper__col {
		padding: 0 1.5rem;
	}

	.youth-paper__col:first-child {
		padding-left: 0;
	}

	.youth-paper__col:last-child {
		padding-right: 0;
	}

	.youth-paper__col + .youth-paper__col {
		border-left: var(--youth-hair);
	}
}

/* 待核定內容的草案提示（例如隱私權政策），核定後刪掉那一段 */
.youth-draft-note {
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--wp--preset--color--alert);
	background: var(--wp--preset--color--surface);
}

/* 網站導覽：桌機兩欄，清單項目至少 44px 高 */
.youth-sitemap__section {
	margin-top: 2rem;
	break-inside: avoid;
}

.youth-sitemap ul {
	margin: 0;
	padding-left: 1.25rem;
}

.youth-sitemap > .youth-sitemap__section > ul {
	padding-left: 0;
	list-style: none;
}

.youth-sitemap a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
	min-width: var(--youth-target);
}

.youth-sitemap h2 {
	margin: 0;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

@media (min-width: 1024px) {
	.youth-sitemap {
		column-count: 2;
		column-gap: 3rem;
	}

	.youth-sitemap__section:first-child {
		margin-top: 0;
	}
}

/* ---------- 6. 頁尾 ---------- */

.youth-footer {
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--small);
}

.youth-footer__inner {
	display: grid;
	gap: 1.5rem;
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: 2rem var(--wp--style--root--padding-right, 1rem) 2.5rem var(--wp--style--root--padding-left, 1rem);
}

/* 深底上的連結用校徽橙（5.74:1），焦點框改白色才看得到 */
.youth-footer a {
	color: var(--wp--preset--color--brand);
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
}

.youth-footer :where(a, button, summary):focus-visible {
	outline-color: var(--wp--preset--color--white);
}

.youth-footer p {
	margin: 0;
}

.youth-contact__name,
.youth-footer__heading {
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	margin: 0 0 0.5rem;
}

.youth-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-footer .wp-block-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
}

.youth-unit-links details {
	border-top: 1px solid var(--wp--preset--color--text-muted);
}

.youth-unit-links details:last-child {
	border-bottom: 1px solid var(--wp--preset--color--text-muted);
}

.youth-unit-links summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	font-weight: 700;
	cursor: pointer;
}

.youth-unit-links ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 1rem;
	padding-bottom: 0.5rem;
}

/* 社群圖示：各 48×48，含文字名稱 */
.youth-social {
	margin-top: 1rem;
	gap: 0.5rem 1rem;
}

.youth-footer .youth-social .wp-social-link {
	background: none !important;
	color: var(--wp--preset--color--brand) !important;
}

.youth-footer .youth-social .wp-block-social-link-anchor {
	min-height: 48px;
	min-width: 48px;
	gap: 0.25rem;
	padding: 0 0.25rem;
}

.youth-footer .youth-social .wp-block-social-link-label {
	clip-path: none;
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
}

@media (min-width: 1024px) {
	.youth-footer__inner {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		align-items: start;
	}

	.youth-unit-links {
		grid-column: span 2;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem;
	}

	.youth-unit-links details,
	.youth-unit-links details:last-child {
		border: 0;
	}

	.youth-unit-links ul {
		grid-template-columns: 1fr;
	}

	.youth-footer__legal {
		grid-column: 1 / -1;
		padding-top: 1rem;
		border-top: 1px solid var(--wp--preset--color--text-muted);
	}
}

/* 常見問題（處室內頁）：每題一個可展開的 <details> */
.youth-faq {
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-faq summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	font-weight: 500;
	cursor: pointer;
}

/* ---------- 5. 布告欄、文件庫、行事曆 ---------- */

/* 標記：置頂（校徽橙底深色字 5.74:1）、已截止（灰） */
.youth-badge {
	display: inline-flex;
	align-items: center;
	padding: 0 0.5rem;
	border-radius: 4px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.6;
}

.youth-badge.is-pinned {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--text);
}

.youth-badge.is-expired {
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text-muted);
}

.youth-news__item.is-expired .youth-news__title a {
	color: var(--wp--preset--color--text-muted);
}

.youth-news__deadline {
	color: var(--wp--preset--color--brand-text);
	font-weight: 500;
}

/* 單篇公告：截止日醒目框 */
.youth-post-details .youth-post-meta {
	margin: 0;
}

.youth-post-meta a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
}

.youth-deadline {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--wp--preset--color--brand-text);
	background: var(--wp--preset--color--brand-tint);
	font-weight: 700;
}

.youth-deadline.is-expired {
	border-left-color: var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text-muted);
}

/* 篩選表單：手機每欄整列，桌機排成一列 */
.youth-filter-form {
	display: grid;
	gap: 0.75rem;
	margin: 1rem 0;
	padding: 1rem;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--surface);
}

.youth-field {
	display: grid;
	gap: 0.25rem;
	margin: 0;
}

.youth-field label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.youth-field select,
.youth-field input {
	width: 100%;
	min-height: var(--youth-target);
	padding: 0 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	font: inherit;
}

.youth-filter-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
}

.youth-filter-form__actions .wp-element-button {
	min-width: 6rem;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
}

@media (min-width: 768px) {
	.youth-filter-form {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		align-items: end;
	}

	.youth-field--wide {
		grid-column: span 3;
	}
}

.youth-news-board__count {
	margin: 1rem 0 0.5rem;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* 數字分頁：每個 44×44 */
.youth-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem;
	margin: 1.5rem 0;
	padding: 0;
	list-style: none;
}

.youth-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--youth-target);
	min-height: var(--youth-target);
	padding: 0 0.5rem;
	border-radius: var(--youth-radius);
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.youth-pagination a.page-numbers {
	border: 1px solid var(--wp--preset--color--border);
}

.youth-pagination a.page-numbers:hover {
	border-color: var(--wp--preset--color--brand-text);
	color: var(--wp--preset--color--brand-text);
}

.youth-pagination .page-numbers.current {
	background: var(--wp--preset--color--brand-text);
	color: var(--wp--preset--color--white);
	font-weight: 700;
}

/* RSS 訂閱 */
.youth-feed-link a {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: var(--youth-target);
}

.youth-feed-link a::before {
	content: "";
	width: 1em;
	height: 1em;
	border-radius: 3px;
	background: var(--wp--preset--color--brand);
}

/* 檔案格式與大小 */
.youth-file-meta {
	color: var(--wp--preset--color--text-muted);
	font-size: 0.875em;
	font-weight: 400;
	white-space: nowrap;
}

/* 文件列表：每份一列，標題連結 44px 高 */
.youth-docs__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-docs__item {
	margin: 0 !important;
	padding: 0.5rem 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-docs__link {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.25rem;
	min-height: var(--youth-target);
	font-weight: 500;
}

.youth-docs__meta {
	margin: 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* 行事曆：日期在左（手機在上），活動名稱在右 */
.youth-calendar__month {
	margin: 2rem 0 0.75rem;
}

.youth-calendar__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-calendar__item {
	display: grid;
	gap: 0 1rem;
	margin: 0 !important;
	padding: 0.75rem 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--emblem-grey);
}

.youth-calendar__item p {
	margin: 0;
}

.youth-calendar__date {
	color: var(--wp--preset--color--brand-text);
	font-weight: 700;
}

.youth-calendar__title {
	font-weight: 500;
}

.youth-calendar__location {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

@media (min-width: 768px) {
	.youth-calendar__item {
		grid-template-columns: 12rem 1fr;
	}

	.youth-calendar__location {
		grid-column: 2;
	}
}

.youth-calendar__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* 篩選表單外層：預設展開（沒有 JavaScript 也能用），手機由 assets/js/theme.js 收合成一個 48px 的按鈕 */
.youth-filter-details {
	margin: 1rem 0;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--surface);
}

.youth-filter-details > summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 1rem;
	font-weight: 700;
	cursor: pointer;
}

.youth-filter-details .youth-filter-form {
	margin: 0;
	padding-top: 0;
}

@media (min-width: 1024px) {
	.youth-filter-details > summary {
		display: none;
	}

	.youth-filter-details .youth-filter-form {
		padding-top: 1rem;
	}
}

.youth-filter-details > summary::after {
	content: "展開";
	margin-left: auto;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.youth-filter-details[open] > summary::after {
	content: "收合";
}

/* ---------- 6. YouTube 點了才載入（inc/embeds.php） ---------- */
.youth-video .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--text);
}

.youth-video__link,
.youth-video__player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.youth-video__link {
	display: block;
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.youth-video__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 播放鈕：72×72，校徽橙底深色三角形 */
.youth-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
	border-radius: 50%;
	background: var(--wp--preset--color--brand);
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.4);
}

.youth-video__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -14px 0 0 -9px;
	border-style: solid;
	border-width: 14px 0 14px 24px;
	border-color: transparent transparent transparent var(--wp--preset--color--text);
}

.youth-video__link:hover .youth-video__play {
	background: var(--wp--preset--color--brand-hover);
}

/* 影片標題：深色底白字，放在縮圖下緣 */
.youth-video__label {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 0.5rem 0.75rem;
	background: rgb(0 0 0 / 0.75);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.youth-video__link:focus-visible {
	outline: 3px solid var(--youth-focus);
	/* 外層 overflow: hidden，焦點框畫在內側才看得到 */
	outline-offset: -3px;
}

/* ---------- 7. 外語專區 ---------- */

/*
 * 各語言用系統字型，不載入網路字型（多語系規劃「字型與無障礙」）。
 * 越南文、印尼文比中文長很多，按鈕與選單都不固定寬度，可以換行。
 */
:lang(en),
:lang(vi),
:lang(id) {
	font-family: "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, system-ui, sans-serif;
}

:lang(th) {
	font-family: "Leelawadee UI", "Noto Sans Thai", Thonburi, system-ui, sans-serif;
}

:lang(my) {
	font-family: "Myanmar Text", "Noto Sans Myanmar", Padauk, system-ui, sans-serif;
}

:lang(km) {
	font-family: "Khmer UI", "Leelawadee UI", "Noto Sans Khmer", system-ui, sans-serif;
}

/* 行高設在整頁，靠繼承；緬甸文、高棉文上下有疊字，標題也要拉高 */
html:is(:lang(en), :lang(vi), :lang(id)) body {
	line-height: 1.6;
}

html:lang(th) body {
	line-height: 1.9;
}

html:is(:lang(my), :lang(km)) body {
	line-height: 2;
}

html:is(:lang(th), :lang(my), :lang(km)) :is(h1, h2, h3, h4, h5, h6) {
	line-height: 1.6;
}

/* 外語頁裡的中文（地址、「中文」切換鈕）仍用中文字型 */
:lang(zh-Hant-TW) {
	font-family: var(--wp--preset--font-family--system-cjk);
}

/* 外語頁首不固定在上方：選單與切換鈕會換行，固定的話手機上會蓋住太多內容 */
.youth-header--lang {
	position: static;
}

.youth-lang-header {
	flex-wrap: wrap;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.youth-lang-header .youth-brand {
	flex-shrink: 1;
	min-width: 0;
	white-space: normal;
}

/* 語言切換：每個語言用自己的名稱，至少 44px 高 */
.youth-lang-switcher ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-lang-switcher a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
	min-width: var(--youth-target);
	padding: 0 0.5rem;
	color: var(--wp--preset--color--link);
}

.youth-lang-switcher a[aria-current="page"] {
	color: var(--wp--preset--color--text);
	font-weight: 700;
	text-decoration: none;
	box-shadow: inset 0 -3px 0 var(--wp--preset--color--brand-text);
}

.youth-lang-switcher-block {
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* 僑生頁的外語專區按鈕：至少 56px 高，上面該語言名稱、下面中文名稱 */
.youth-lang-corners ul {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-lang-corners a {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 56px;
	padding: 0.5rem 1rem;
	border: 2px solid var(--wp--preset--color--brand-text);
	border-radius: var(--youth-radius);
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.youth-lang-corners a:hover {
	background: var(--wp--preset--color--surface);
}

.youth-lang-corners__native {
	font-size: 1.125rem;
	font-weight: 700;
}

.youth-lang-corners__zh {
	font-size: 0.875rem;
	color: var(--wp--preset--color--text-muted);
}

/* 該語言的頁面選單：手機收合，桌機橫排 */
.youth-lang-nav {
	flex-basis: 100%;
}

.youth-lang-nav__details {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--youth-radius);
}

.youth-lang-nav__toggle {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 1rem;
	font-weight: 500;
	cursor: pointer;
}

.youth-lang-nav__list {
	margin: 0;
	padding: 0 0.5rem 0.5rem;
	list-style: none;
}

.youth-lang-nav a {
	display: flex;
	align-items: center;
	min-height: var(--youth-target);
	padding: 0 0.5rem;
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

.youth-lang-nav a:hover {
	text-decoration: underline;
}

.youth-lang-nav a[aria-current] {
	color: var(--wp--preset--color--brand-text);
	font-weight: 700;
	box-shadow: inset 4px 0 0 var(--wp--preset--color--brand-text);
}

@media (min-width: 1024px) {
	.youth-lang-nav__details {
		border: 0;
	}

	.youth-lang-nav__toggle {
		display: none;
	}

	.youth-lang-nav__list {
		display: flex;
		flex-wrap: wrap;
		gap: 0 0.25rem;
		padding: 0;
	}

	.youth-lang-nav a[aria-current] {
		box-shadow: inset 0 -3px 0 var(--wp--preset--color--brand-text);
	}
}

/* 機器翻譯提示：灰底，中文版更新後加橙色左框 */
.youth-lang-notice {
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border-radius: var(--youth-radius);
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
}

.youth-lang-notice.is-stale {
	box-shadow: inset 4px 0 0 var(--wp--preset--color--brand-text);
}

.youth-lang-notice p {
	margin: 0 0 0.25rem;
}

.youth-lang-notice__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.youth-lang-notice__links a {
	display: inline-flex;
	align-items: center;
	min-height: var(--youth-target);
}

.youth-lang-date {
	color: var(--wp--preset--color--text-muted);
}

.youth-lang-footer__translated {
	color: var(--wp--preset--color--white);
}

.youth-lang-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
}
