/* ==========================================================================
   tw-events —— 首頁「近期活動」區段（tw-homepage 的外部型別 events-upcoming）
   --------------------------------------------------------------------------
   只有首頁放了這一段時才載入（tw-homepage 依 css_url 載入）。
   版面照設計稿 techez-backups/events-home-design-20260916/style.css（議程清單，2026-09-16 業主選定）：
   字級、顏色、間距、按鈕、徽章、日期方塊的數字都從那一支搬過來，改版面只改這一支。
   區段標題沿用 tw-homepage base.css 的 .tz-wrap / .tz-eyebrow / .tz-section-title / .tz-section-more（不在這裡重複定義）。

   結構（includes/home-section.php）：
     .twev-home__inner   grid：桌機左欄（head + links）／右欄 list；≤1024 單欄 head → list → links
       .twev-home__head    小標、標題、說明文字
       .twev-home__list    <ol>，一場一列 .twev-home__row（date｜thumb｜main｜side），1～2 場時最後多一列 .twev-home__foot
       .twev-home__links   看全部活動、訂閱行事曆
   響應式斷點：1024（單欄）、767（手機：小圖隱藏、日期方塊縮小、狀態與按鈕橫排）。

   全部收在 .twev-home 底下（selftest F3）。不得用 vw/vh。⚠️ 改完一定要跑 python3 tools/csscheck.py
   ========================================================================== */

.twev-home {
	padding: 96px 0;
	background: #f6f7f8;
	color: #1c1e21;
	font-family: var(--tz-font, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif);
	-webkit-font-smoothing: antialiased;
}

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

.twev-home h2,
.twev-home h3,
.twev-home p,
.twev-home ol,
.twev-home li {
	margin: 0;
	padding: 0;
}

.twev-home ol {
	list-style: none;
}

.twev-home a {
	color: #1c1e21;
	text-decoration: none;
}

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

/* --- 兩欄 --- */

.twev-home__inner {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	grid-template-areas:
		"head list"
		"links list";
	column-gap: 64px;
	align-items: start;
}

.twev-home__head {
	grid-area: head;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.twev-home__lead {
	margin-top: 6px;
	font-size: 15px;
	line-height: 1.8;
	color: #5a5f66;
}

.twev-home__links {
	grid-area: links;
	margin-top: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 28px;
	align-self: start;
}

/* --- 清單 --- */

.twev-home__list {
	grid-area: list;
	background: #ffffff;
	border: 1px solid #e4e6e9;
}

.twev-home__row {
	display: grid;
	grid-template-columns: 84px 84px minmax(0, 1fr) 210px;
	gap: 24px;
	align-items: center;
	padding: 24px 28px;
}

.twev-home__row + .twev-home__row,
.twev-home__foot {
	border-top: 1px solid #e4e6e9;
}

.twev-home__row:hover {
	background: #fcfbf8;
}

.twev-home__row:hover .twev-home__title a {
	color: #1559ed;
}

/* 日期方塊 */

.twev-home__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 84px;
	padding: 10px 0 12px;
	background: #ffffff;
	border: 1px solid #e4e6e9;
	border-top: 3px solid #d3b574;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.twev-home__mon,
.twev-home__wd {
	font-size: 13px;
	color: #5a5f66;
}

.twev-home__day {
	margin: 4px 0 3px;
	font-family: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
	font-size: 34px;
	font-weight: 600;
	color: #1c1e21;
}

/* 小圖 */

.twev-home__thumb {
	width: 84px;
	height: 105px;
	overflow: hidden;
	background: #f2f3f5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b9995a;
}

.twev-home__thumb img,
.twev-home .twev-home__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
	display: block;
}

.twev-home img.twev-pos-top { object-position: 50% 0; }
.twev-home img.twev-pos-center { object-position: 50% 50%; }
.twev-home img.twev-pos-bottom { object-position: 50% 100%; }

/* 中間：關鍵字、標題、時間地點 */

.twev-home__main {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

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

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

.twev-home__mode {
	font-size: 13px;
	color: #1c1e21;
}

.twev-home__sep {
	width: 1px;
	height: 12px;
	background: #d8dbdf;
}

.twev-home__title {
	font-size: 19px;
	font-weight: 500;
	line-height: 1.5;
	color: #1c1e21;
}

.twev-home__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	font-size: 15px;
	line-height: 1.6;
	color: #5a5f66;
}

.twev-home__fact {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.twev-home__fact svg {
	color: #8b9097;
}

.twev-home__fact--strong {
	font-weight: 600;
	color: #1c1e21;
	font-variant-numeric: tabular-nums;
}

.twev-home__count {
	margin-left: 6px;
	font-weight: 400;
	font-size: 13px;
	color: #7d6536;
}

/* 右側：狀態與按鈕 */

.twev-home__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	text-align: right;
}

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

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

.twev-home__cta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.twev-home .twev-home__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

.twev-home .twev-home__btn--solid {
	background: #d3b574;
	border-color: #d3b574;
	color: #1c1e21;
}

.twev-home .twev-home__btn--solid:hover {
	background: #c4a35c;
	border-color: #c4a35c;
	color: #1c1e21;
}

.twev-home .twev-home__btn--line {
	background: transparent;
	border-color: #1c1e21;
	color: #1c1e21;
}

.twev-home .twev-home__btn--line:hover {
	background: #1c1e21;
	color: #ffffff;
}

.twev-home__hint {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.5;
	color: #686d74;
	white-space: nowrap;
}

.twev-home .twev-home__textlink {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	color: #1c1e21;
	white-space: nowrap;
}

.twev-home .twev-home__textlink:hover {
	color: #7d6536;
}

/* 已截止但還沒舉行：淡化 */

.twev-home .is-dim .twev-home__date { border-top-color: #d8dbdf; }
.twev-home .is-dim .twev-home__day { color: #686d74; }
.twev-home .is-dim .twev-home__title { color: #3a3f46; }
.twev-home .is-dim .twev-home__title a { color: #3a3f46; }
.twev-home .is-dim .twev-home__thumb { opacity: 0.7; }

/* 只有 1～2 場：清單底下的訂閱提示 */

.twev-home__foot {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 20px;
	padding: 18px 28px;
	background: #fcfbf8;
	font-size: 14px;
	color: #5a5f66;
}

.twev-home__foot-note {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.twev-home__foot-note svg {
	color: #7d6536;
}

.twev-home__foot .twev-home__textlink {
	font-size: 14px;
	margin-left: auto;
}

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

@media (max-width: 1024px) {
	.twev-home {
		padding: 72px 0;
	}

	.twev-home__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto auto;
		grid-template-areas:
			"head"
			"list"
			"links";
	}

	.twev-home__head {
		margin-bottom: 28px;
	}

	.twev-home__links {
		margin-top: 24px;
		gap: 14px 24px;
	}

	.twev-home__row {
		grid-template-columns: 84px 84px minmax(0, 1fr) 190px;
		gap: 20px;
		padding: 22px 24px;
	}
}

@media (max-width: 767px) {
	.twev-home {
		padding: 56px 0;
	}

	.twev-home .tz-section-title {
		font-size: 28px;
	}

	.twev-home__head {
		gap: 10px;
	}

	.twev-home__lead {
		margin-top: 2px;
	}

	.twev-home__row {
		grid-template-columns: 60px minmax(0, 1fr);
		grid-template-rows: auto auto;
		gap: 12px 16px;
		padding: 18px 16px;
		align-items: start;
	}

	.twev-home__date {
		width: 60px;
		padding: 7px 0 8px;
		border-top-width: 2px;
	}

	.twev-home__day {
		font-size: 24px;
		margin: 2px 0;
	}

	.twev-home__mon,
	.twev-home__wd {
		font-size: 12px;
	}

	.twev-home__thumb {
		display: none;
	}

	.twev-home__title {
		font-size: 17px;
	}

	.twev-home__facts {
		gap: 2px 14px;
		font-size: 14px;
	}

	.twev-home__side {
		grid-column: 2;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px 14px;
		text-align: left;
	}

	.twev-home__cta {
		align-items: flex-start;
	}

	.twev-home__hint {
		white-space: normal;
	}

	.twev-home__foot {
		padding: 16px;
	}

	.twev-home__foot-note {
		align-items: flex-start;
	}

	.twev-home__foot-note svg {
		margin-top: 3px;
	}

	.twev-home__foot .twev-home__textlink {
		margin-left: 0;
	}
}
