/* 介面尺寸標準（所有地區共用；base.html 最後載入，蓋過 vendor 與各功能樣式）。
 * 標準：頁邊 24／20／16px（桌機／平板／手機）、按鈕高 36px（小按鈕 30px）、標籤 22px、
 * 相鄰按鈕與標籤間距至少 6px（換行後上下排也是，用 gap 不用 margin）、有底色或框線的容器內容離每邊至少 8px。
 * 檢查工具：python3 tools/ui_spacing_check.py（說明在檔案開頭）。
 * vendor/portal.css 是島引馬祖的複本，不直接改；要修的寫在這裡。
 * 有些頁的功能樣式寫在 body 裡（比這份晚載入），所以個別頁的規則前面加 html 提高優先順序。 */

/* ---------- 頁邊 ---------- */
.shell { --shell-pad: 24px; }
.sitefoot__in { padding-inline: 24px; }
@media (max-width: 1024px) {
  .shell { --shell-pad: 20px; }
  .sitefoot__in { padding-inline: 20px; }
}
@media (max-width: 640px) {
  .shell { --shell-pad: 16px; }
  .sitefoot__in { padding-inline: 16px; }
}
/* 頁邊加大後，頁首（站名、入口、工具列）在 390px 仍要排在同一列：項目間距 8px 改 6px */
@media (max-width: 430px) {
  .masthead .shell { column-gap: 6px; }
}

/* ---------- 個別頁：被 .shell 的 margin: 0 auto 蓋掉的上下距離（功能樣式比 vendor 先載入） ---------- */
html .shell.tf-tabs { margin-top: 14px; margin-bottom: 12px; }   /* 停車、現場：縣市列與鄉鎮列 */
html .shell.tf-towns { margin-bottom: 12px; }
html .shell.tf-note { margin-top: 10px; }
html .shell.tf-ask { margin-top: 16px; }

/* ---------- 相鄰按鈕至少 6px ---------- */
html .tf-pt__go { gap: 6px; }   /* 停車：導航、電話 */
html .cd-otg__cells { gap: 6px; }   /* 老物件：年代格 */
html .cdk__tags { gap: max(6px, 1.2cqw); }   /* 生物誌卡牌：卡上的標籤 */

/* ---------- 標籤至少 22px ---------- */
html .gd-tag { height: 22px; }   /* 季節行事曆：進行中、約 */

/* ---------- 有底色或框線的容器：內容離邊至少 8px ---------- */
html .pt-time { padding: 8px 10px; }   /* 交通船、班次的時刻方塊 */
html .ax-leg.is-cut > div { padding: 8px; }   /* 無障礙路線：斷線的一段 */
html .gd-cell { padding: 8px; }   /* 季節行事曆：月曆格 */
html .kd-grid__r { padding: 8px; }   /* 親子：各區設施表的列（選中的列有底色） */
html .li-tbl__n, html .li-tbl__n small { gap: 6px; }   /* 生活資訊表格：名稱旁的標籤 */

/* ---------- 不超出畫面：好幾支電話寫在一起時電話鈕換行 ---------- */
html .li-tel, html .li-nav { max-width: 100%; height: auto; min-height: 30px; padding-block: 4px; border-radius: 15px; white-space: normal; overflow-wrap: anywhere; }

/* ---------- 標題的子句：塞得下時整句不斷開，比一行還長時才在句內換行（原本會超出頁邊） ---------- */
@media (max-width: 640px) {
  .dl-title__cl { display: inline-block; max-width: 100%; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }   /* 先在空白處換行，真的放不下才斷字 */
}

/* ---------- 可點的人物標籤當小按鈕：至少 30px ---------- */
html .hr-chip { height: 30px; }   /* 歷史大事：事件裡的人物 */
