﻿@charset "UTF-8";
/* ==========================================================================
   Home.css  -  Home/ 前台網站的樣式修正
   --------------------------------------------------------------------------
   Home/ 使用 Bootstrap 5.2.3（Start Bootstrap - Modern Business 樣板），
   本檔只放必要的修正，載入順序在 styles.css 之後。

   刻意不直接修改 CSS/styles.css —— 那是樣板與 Bootstrap 的合併輸出，
   改了之後將來要更新上游版本會產生衝突。
   ========================================================================== */


/* ==========================================================================
   1. 導覽列在 992–1199px 之間會逐字折行
   --------------------------------------------------------------------------
   問題:
     導覽列用的是 navbar-expand-lg，992px 以上就展開成橫排。但這個區間
     Bootstrap 的 .container 最大寬只有 960px，扣掉 px-5 的左右內距後
     可用寬度不足，八個中文選項就被折成兩行（最新消/息、公司簡/介 …）。

     根本原因是中文「每個字之間都是可斷行點」—— 英文選單不會有這個問題。

   量測:
     品牌 212px + 八個連結 640px = 852px，容器內部可用約 864px。
     其實放得下，只是被允許在字與字之間斷行。

   處理:
     (1) nav-link 不折行 —— 只能在項目之間換行，不能在字中間斷
     (2) 992–1199px 這個區間收斂容器與項目的內距、字級略縮，讓八個項目
         排得進同一列。實測 992 / 1100 / 1199 / 1200 / 1440 全部單行單列。
   ========================================================================== */
.navbar-nav
{
	flex-wrap:			wrap;		/* 真的放不下時，於「項目之間」換行 */
}

.navbar-nav .nav-link
{
	white-space:		nowrap;		/* 但絕不在文字中間斷行 */
}

@media (min-width: 992px) and (max-width: 1199.98px)
{
	.navbar .container
	{
		padding-left:	1rem !important;	/* 原為 px-5 = 3rem */
		padding-right:	1rem !important;
	}

	.navbar-nav .nav-link
	{
		padding-left:	.5rem !important;
		padding-right:	.5rem !important;
		font-size:		.95rem;
	}
}


/* ==========================================================================
   2. 資料表格在手機上溢出
   --------------------------------------------------------------------------
   Bootstrap 的 .table 只設 width:100%，並不處理溢出 —— 欄位一多仍會把
   整頁撐開。全站 8 張表格原本都沒有 .table-responsive 包裝。

   Home/Document.aspx 的聘僱清單欄位數由資料庫決定（code-behind 以
   Rd.GetName(i) 產生），實測 11 欄時在 390px 螢幕下寬 567px，整頁溢出。

   已在該頁為兩張表格加上 .table-responsive 包裝; 這裡再補一道保險，
   讓其他直接寫在 markup 裡的 .table 也不會撐破頁面。
   ========================================================================== */
.table-responsive
{
	-webkit-overflow-scrolling: touch;
}

/* 表格內的儲存格不因為中文而逐字折行，維持可讀的欄寬 */
.table > :not(caption) > * > *
{
	word-break:			keep-all;
}


/* ==========================================================================
   3. 即時新聞改成橫列卡片
   --------------------------------------------------------------------------
   Home/Default.aspx.cs 為每則新聞輸出:

       <div class="mb-3">
         <div class="small text-muted" aria-label="2026年08月18日">
           <strong class="NewsDay">18</strong><span class="NewsYm">2026.08</span>
         </div>
         <a class="link-dark" href="NewsDetail.aspx?ID=1"><h3>標題</h3></a>
       </div>

   版面: 一則一列的白底卡片，左邊是日期徽章（大字日 + 小字年月），
         中間標題，右邊指示箭頭，整張卡片可點。

   ⚠ 日期徽章的兩個元素以前是一支前端腳本（Script/NewsCards.js）在執行期
     拆出來的，現在改由 code-behind 直接輸出 —— 版面完全不依賴 JS，
     第一次繪製就是最終樣子（原本會先閃一下 2026/08/18 再變成兩行）。
     那支 JS 已隨這次改版刪除。
   ========================================================================== */
.NewsCards
{
	display:			flex;
	flex-direction:		column;
	gap:				.75rem;
}

/* 卡片本體 —— 直接對 code-behind 產生的那層 <div class="mb-3"> 下手 */
.NewsCards > div
{
	position:			relative;	/* 給整卡連結與箭頭當定位基準 */
	display:			flex;
	align-items:		center;
	gap:				1rem;
	min-width:			0;
	padding:			.875rem 3rem .875rem .875rem;	/* 右邊留給箭頭 */
	margin-bottom:		0 !important;	/* 蓋掉 .mb-3，間距改由 gap 統一 */
	background-color:	#fff;
	border:				1px solid rgba(0, 0, 0, .06);
	border-radius:		.75rem;
	box-shadow:			0 1px 3px rgba(0, 0, 0, .06);
	transition:			box-shadow .15s ease-in-out, transform .15s ease-in-out;
}

.NewsCards > div:hover,
.NewsCards > div:focus-within
{
	box-shadow:			0 .5rem 1rem rgba(0, 0, 0, .1);
	transform:			translateY(-1px);
}

/* 日期徽章 ----------------------------------------------------------------
   .text-muted 的 color 帶 !important（Bootstrap 5 的 utility 都是），
   所以這裡也要 !important 才蓋得掉。 */
.NewsCards > div > .small
{
	flex:				0 0 auto;
	display:			flex;
	flex-direction:		column;
	align-items:		center;
	justify-content:	center;
	width:				4.25rem;
	min-height:			4.25rem;
	padding:			.35rem;
	margin-bottom:		0;
	border-radius:		.625rem;
	background-color:	#EEF3E0;
	color:				#6E8B3D !important;
	line-height:		1.15;
	text-align:			center;
}

.NewsCards .NewsDay
{
	font-size:			1.6rem;
	font-weight:		700;
	color:				#5C7A2B;
}

.NewsCards .NewsYm
{
	/* 不低於 12px —— 再小在手機上難以辨識 */
	font-size:			.78rem;
	color:				#8AA359;
}

/* 標題 --------------------------------------------------------------------
   min-width:0 不能省 —— flex 項目的最小尺寸預設是內容寬度，
   長標題會把卡片撐破。 */
.NewsCards > div > a
{
	flex:				1 1 auto;
	min-width:			0;
	text-decoration:	none;
}

.NewsCards h3
{
	margin:				0;
	font-size:			1rem;
	line-height:		1.55;
	font-weight:		700;
	color:				#212529;
}

.NewsCards a:hover h3,
.NewsCards a:focus-visible h3
{
	color:				#5C7A2B;
}

/* 整張卡片可點 —— 連結原本只包住 <h3>，用一層覆蓋把感應範圍放大到整張卡。
   這是 Bootstrap .stretched-link 的做法，但 class 由 code-behind 決定，
   所以在這裡自己實作。 */
.NewsCards > div > a::after
{
	content:			"";
	position:			absolute;
	top:				0;
	right:				0;
	bottom:				0;
	left:				0;
}

/* 右側箭頭 —— 用邊框轉 45 度畫出來，不需要圖檔或字型圖示 */
.NewsCards > div::after
{
	content:			"";
	position:			absolute;
	top:				50%;
	right:				1.25rem;
	width:				.5rem;
	height:				.5rem;
	border-top:			2px solid #C2C8D0;
	border-right:		2px solid #C2C8D0;
	transform:			translateY(-50%) rotate(45deg);
	transition:			border-color .15s ease-in-out;
}

.NewsCards > div:hover::after
{
	border-color:		#5C7A2B;
}

/* 偏好減少動態效果的使用者不做位移 */
@media (prefers-reduced-motion: reduce)
{
	.NewsCards > div
	{
		transition:		none;
	}

	.NewsCards > div:hover,
	.NewsCards > div:focus-within
	{
		transform:		none;
	}
}


/* ==========================================================================
   4. 重點提示卡片
   --------------------------------------------------------------------------
   Home/Default.aspx.cs 為每則提示輸出:

       <div class="PromptCard">
         <span class="PromptIcon" aria-hidden="true"><i class="bi bi-lightbulb-fill"></i></span>
         <p class="PromptText">提示內容…</p>
       </div>

   改版前是一整塊 Bootstrap .card，裡面每則提示包在 <h3> 且置中對齊。
   實際內容是 50~60 字的法規說明（資料庫實測 56 / 63 字），用 h3 的
   1.75rem 置中排出來會變成一大團，是這次要改掉的主因:

     置中 -> 靠左  中文長句置中時每一行的起點都不一樣，很難連著讀
     h3   -> p     它是內文不是標題，字級降到 .95rem、行高拉到 1.85
     一塊 -> 一則一卡  多則提示原本黏在一起，分不出哪裡是一則的結尾

   配色與左欄的新聞卡片成對: 同樣是白底圓角卡 + 左側彩色徽章，
   新聞用綠色（日期），提示用暖琥珀色（燈泡），兩欄並排時能一眼分辨，
   又不會和導覽列的品牌色 #34B7A7 打架。

   卡片不可點，所以刻意不做 hover 位移與陰影變化 —— 會讓人以為點得下去。
   ========================================================================== */
.PromptCards
{
	display:			flex;
	flex-direction:		column;
	gap:				.75rem;
}

.PromptCard
{
	display:			flex;
	align-items:		flex-start;		/* 圖示對齊第一行，不隨內容長度浮動 */
	gap:				.875rem;
	padding:			1rem 1.125rem;
	background-color:	#fff;
	border:				1px solid rgba(0, 0, 0, .06);
	border-left:		4px solid #E0A93B;
	border-radius:		.75rem;
	box-shadow:			0 1px 3px rgba(0, 0, 0, .06);
}

.PromptIcon
{
	flex:				0 0 auto;
	display:			inline-flex;
	align-items:		center;
	justify-content:	center;
	width:				2.25rem;
	height:				2.25rem;
	margin-top:			.1rem;			/* 與內文第一行的視覺中線對齊 */
	border-radius:		50%;
	background-color:	#FDF3DC;
	color:				#B4801F;
	font-size:			1.05rem;
	line-height:		1;
}

/* min-width:0 不能省 —— flex 項目的最小尺寸預設是內容寬度，
   沒有空格可斷的長句會把卡片撐破（與第 3 節的標題同一個道理）。 */
.PromptText
{
	flex:				1 1 auto;
	min-width:			0;
	margin:				0;
	font-size:			.95rem;
	line-height:		1.85;			/* 中文長句需要比預設 1.5 更鬆 */
	color:				#3F4650;
	overflow-wrap:		anywhere;
}


/* ==========================================================================
   5. 觸控裝置的可點範圍
   --------------------------------------------------------------------------
   條件用 pointer:coarse 而不是螢幕寬度 —— 判斷依據是「用手指點」而不是
   「螢幕小」，滑鼠使用者把視窗縮窄時版面不會變鬆。

   新聞卡片與「開始檢測」那類卡片不在此列 —— 它們的連結有覆蓋整塊的
   ::after，實際可點範圍就是整張卡片。
   ========================================================================== */
@media (pointer: coarse)
{
	/* 分類標籤（NewsDetail 的 News）實測 46x20 */
	a.badge
	{
		padding:		.5em .75em;
	}

	/* SelectDetail 的「編輯履歷表」是一般的 <a>，實測 80x21。
	   這是條件顯示的動作連結（SelectDetail.aspx.cs 依權限決定 Visible）。

	   用結尾比對而不是 #EditLink —— Home/ 的頁面都套 MasterPage，
	   伺服器控制項的 id 會被加上命名容器前綴（ctl00_..._EditLink）。 */
	a[id$="EditLink"]
	{
		display:		inline-block;
		padding:		.35rem .5rem;
	}
}
