/* ==========================================================================
   tw-news —— 最新消息列表頁（/news/ 與文章分類頁）  twn:news-css

   數值全部從設計稿抄：techez-backups/events-ux-design-20260920/NewsList.dc.html（1440）
   與 NewsListMobile.dc.html（390）。class 一律 .twn-*。
   .twn-wrap / .twn-eyebrow / .twn-title 沿用 tw-homepage base.css 的 .tz-wrap / .tz-eyebrow / .tz-section-title
   命名習慣與數值，但**不依賴** tw-homepage 載入（需要的規則自己帶）。

   ⚠️ 不得使用 vw / vh 單位。改完一定要跑 python3 tools/csscheck.py
   ========================================================================== */

/* --- 基底（把佈景主題在 a / h1 / p 上的預設拿掉，只在 .twn 裡） --- */

.twn,
.twn *,
.twn *::before,
.twn *::after {
	box-sizing: border-box;
}

.twn {
	font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
	color: #1c1e21;
	background: #ffffff;
	-webkit-font-smoothing: antialiased;
}

.twn a {
	color: inherit;
	text-decoration: none;
}

.twn h1,
.twn h2,
.twn h3,
.twn p {
	margin: 0;
	padding: 0;
}

.twn svg {
	flex-shrink: 0;
	display: block;
}

.twn img {
	display: block;
	max-width: 100%;
}

.twn-wrap {
	max-width: 1320px;
	margin: 0 auto;
	padding: 56px 40px 80px;
}

.twn-clamp2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- 抬頭 --- */

.twn-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.twn-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: #7d6536;
}

.twn-eyebrow::before {
	content: "";
	width: 28px;
	height: 1px;
	background: #7d6536;
	display: block;
}

.twn-title {
	font-size: 40px;
	font-weight: 500;
	letter-spacing: 1px;
	line-height: 1.4;
	color: #1c1e21;
}

.twn-lead {
	font-size: 16px;
	line-height: 1.8;
	color: #5a5f66;
}

/* --- 篩選 chip 列 --- */

.twn-filters {
	margin-top: 32px;
	padding-bottom: 24px;
	border-bottom: 1px solid #e4e6e9;
	display: flex;
	align-items: center;
	gap: 24px;
}

.twn-filters__scroll {
	min-width: 0;
}

.twn-filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.twn-filter {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 16px;
	border: 1px solid #d8dbdf;
	background: #ffffff;
	font-size: 14px;
	line-height: 1;
	color: #1c1e21;
	white-space: nowrap;
}

.twn-filter:hover {
	border-color: #d3b574;
	color: #1c1e21;
}

.twn-filter.is-on {
	background: #d3b574;
	border-color: #d3b574;
	color: #1c1e21;
	font-weight: 500;
}

.twn-count {
	margin-left: auto;
	font-size: 13px;
	color: #686d74;
	white-space: nowrap;
}

/* --- 共用元件：chip、日期、徽章、閱讀全文 --- */

.twn-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 10px;
	font-size: 14px;
	line-height: 1.5;
	color: #5a5f66;
}

.twn-chip {
	display: inline-block;
	font-size: 11px;
	letter-spacing: 1px;
	line-height: 1.65;
	padding: 3px 9px;
	background: #f1ece0;
	color: #765f2e;
	white-space: nowrap;
}

.twn-date {
	font-family: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
	font-size: 13px;
	color: #686d74;
	font-variant-numeric: tabular-nums;
}

.twn-badge {
	display: inline-block;
	padding: 3px 10px;
	font-size: 13px;
	line-height: 1.6;
	white-space: nowrap;
}

.twn-badge--good { background: #e6f4ea; color: #14532d; }
.twn-badge--blue { background: #eef4ff; color: #123f8f; }
.twn-badge--mute { background: #eceef1; color: #3a4f66; }
.twn-badge--gold { background: #fdf7e8; color: #7d6019; }

.twn-badge--latest {
	margin-left: auto;
	font-size: 12px;
}

.twn-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	padding-bottom: 6px;
	border-bottom: 1px solid #1c1e21;
	font-size: 15px;
	color: #1c1e21;
	white-space: nowrap;
}

.twn-more:hover {
	color: #7d6536;
	border-bottom-color: #7d6536;
}

/* --- 卡片共用 --- */

.twn-card {
	border: 1px solid #e4e6e9;
	background: #ffffff;
	position: relative;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.twn-card:hover {
	border-color: #d3b574;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .07);
}

/* --- 主打一篇 --- */

.twn-featured {
	margin-top: 40px;
	display: flex;
	flex-direction: row;
}

.twn-featured__media {
	flex: 0 0 56.8%;
	max-width: 56.8%;
	min-width: 0;
}

.twn-featured__thumb {
	aspect-ratio: 16 / 9;
	width: 100%;
	overflow: hidden;
	background: #f2f3f5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b9995a;
}

.twn-featured__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.twn-featured__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 32px;
}

.twn-featured__title {
	font-size: 28px;
	line-height: 1.45;
	font-weight: 500;
	color: #1c1e21;
}

.twn-featured__title a:hover {
	color: #7d6536;
}

.twn-featured__ex {
	font-size: 15px;
	line-height: 1.8;
	color: #5a5f66;
}

.twn-featured__foot {
	margin-top: auto;
}

.twn-evnote {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fdf7e8;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: #1c1e21;
}

.twn-evnote svg {
	color: #7d6536;
}

.twn-evnote__text {
	min-width: 0;
}

.twn-evnote b {
	font-weight: 600;
}

.twn-evnote .twn-badge {
	margin-left: auto;
}

/* --- 三欄卡片 --- */

.twn-grid {
	margin-top: 48px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
}

.twn-ncard {
	display: flex;
	flex-direction: column;
}

.twn-ncard__link {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.twn-ncard__thumb {
	height: 220px;
	overflow: hidden;
	background: #f2f3f5;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b9995a;
}

.twn-ncard__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.twn-ncard__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px 22px 26px;
}

.twn-ncard__title {
	font-size: 17px;
	line-height: 1.6;
	font-weight: 500;
	color: #1c1e21;
	height: 54px;
}

.twn-ncard__link:hover .twn-ncard__title {
	color: #7d6536;
}

.twn-ncard__ex {
	font-size: 14px;
	line-height: 1.7;
	color: #5a5f66;
	height: 48px;
}

/* --- 分頁 --- */

.twn-pagination {
	margin-top: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.twn-pg {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #d8dbdf;
	font-family: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #1c1e21;
	gap: 6px;
}

a.twn-pg:hover {
	border-color: #1c1e21;
}

.twn-pg.is-cur {
	background: #1c1e21;
	border-color: #1c1e21;
	color: #ffffff;
}

.twn-pg.is-off {
	color: #8b9097;
}

.twn-pg--gap {
	border-color: transparent;
	min-width: 24px;
	padding: 0;
}

/* --- 空狀態（設計稿沒畫；照它的語言延伸） --- */

.twn-empty {
	margin-top: 40px;
	padding: 64px 24px;
	border: 1px solid #e4e6e9;
	background: #f2f3f5;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	color: #b9995a;
	text-align: center;
}

.twn-empty p {
	font-size: 15px;
	line-height: 1.8;
	color: #5a5f66;
}

.twn-empty .twn-more {
	align-self: center;
}

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

@media (max-width: 1024px) {
	.twn-wrap { padding: 48px 28px 64px; }
	.twn-featured { flex-direction: column; }
	.twn-featured__media { flex-basis: auto; max-width: none; }
	.twn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 767px) {
	.twn-wrap { padding: 40px 20px 48px; }
	.twn-head { gap: 8px; }
	.twn-title { font-size: 30px; }
	.twn-lead { font-size: 15px; line-height: 1.7; }

	/* chip 列：整排橫向捲動、不換行、捲軸藏起來；下面補一條線（設計稿：線在 chip 列下方 20px） */
	.twn-filters { margin: 24px -20px 0; padding: 0 0 20px; border-bottom: 0; display: block; }
	.twn-filters__scroll { overflow-x: auto; overflow-y: hidden; padding: 0 20px; scrollbar-width: none; -ms-overflow-style: none; }
	.twn-filters__scroll::-webkit-scrollbar { display: none; }
	.twn-filters__list { flex-wrap: nowrap; gap: 8px; width: max-content; padding-right: 20px; }
	.twn-count { display: none; }
	.twn-filters::after { content: ""; display: block; margin: 20px 20px 0; border-top: 1px solid #e4e6e9; }

	.twn-featured { margin-top: 24px; flex-direction: column; }
	.twn-featured__media { flex-basis: auto; max-width: none; }
	.twn-featured__thumb { aspect-ratio: auto; height: 196px; }
	.twn-featured__body { gap: 12px; padding: 20px 18px 20px; }
	.twn-featured__title { font-size: 22px; }
	.twn-featured__title.twn-clamp2 { display: block; -webkit-line-clamp: unset; }
	.twn-featured__ex { font-size: 14px; line-height: 1.7; }
	.twn-featured__foot { margin-top: 4px; }

	.twn-grid { margin-top: 32px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.twn-ncard__thumb { height: 196px; }
	.twn-ncard__body { padding: 20px 18px 22px; }

	.twn-pagination { margin-top: 40px; }
	.twn-pg__text { display: none; }
}
