/*
 * NewsBuffet — Editorial Typography & Interaction System
 * Aotter / 2026
 *
 * 設計方向：紙本新聞稿／報紙的閱讀節奏，但字體走全黑體（無襯線），
 * 報紙感改由「層級對比 + 字距節奏 + 留白」建立，而不是靠襯線與大量線條。
 * 沿用 NewsBuffet 既有配色（深藍 #164573 / 金 #CEA877 / 橘 #FF8049）。
 *
 * 字族配對（本站自有，不與參考站相同）：
 *   Inter        — 拉丁文與數字（日期、數據、英文品牌名），字面乾淨、數字等寬
 *   Noto Sans TC — 中文
 *   iCook 走圓體、vocus 走襯線，我們走這組幾何感黑體，辨識度是自己的。
 *
 * 本檔是 typography + 互動效果的單一事實來源，
 * 載入順序須在 style.css / custom.css 之後。
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  /* --- 品牌色（沿用既有配色，未更動） --- */
  --nb-navy:        #164573;
  --nb-navy-deep:   #0F3255;
  --nb-gold:        #CEA877;
  --nb-orange:      #FF8049;

  /* --- 墨色階（僅為提升閱讀對比） --- */
  --nb-ink:         #3F4854;   /* 內文：不用全黑，長文比較不刺眼（參考 iCook 的做法） */
  --nb-ink-soft:    #5C6675;   /* 摘要 */
  --nb-ink-muted:   #939BA8;   /* meta、日期 */
  --nb-title:       #2B3E55;   /* 標題：帶品牌藍調的深灰，比原本的 #0F3255 輕 */
  --nb-rule:        #E8EBEF;
  --nb-tint:        #F5F7F9;
  --nb-card:        #FFFFFF;

  /* --- 字族：全黑體 --- */
  --nb-font-headline: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
                      "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --nb-font-body:     "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
                      "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --nb-font-ui:       "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
                      "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;

  /* --- 流動級距（clamp：手機 → 桌機 連續縮放） --- */
  --nb-fs-masthead:   clamp(1.80rem,  1.38rem + 1.75vw, 2.60rem);  /* 28.8 → 41.6 */
  --nb-fs-headline:   clamp(1.55rem,  1.24rem + 1.30vw, 2.20rem);  /* 24.8 → 35.2 */
  --nb-fs-title:      clamp(1.12rem,  1.02rem + 0.42vw, 1.36rem);  /* 17.9 → 21.8 */
  --nb-fs-section:    clamp(1.06rem,  1.00rem + 0.28vw, 1.24rem);  /* 17   → 19.8 */
  --nb-fs-lead:       clamp(1.00rem,  0.96rem + 0.20vw, 1.12rem);  /* 16   → 17.9 */
  --nb-fs-body:       clamp(1.00rem,  0.96rem + 0.26vw, 1.15rem);  /* 16   → 18.4 */
  --nb-fs-summary:    clamp(0.91rem,  0.89rem + 0.14vw, 1.00rem);  /* 14.6 → 16   */
  --nb-fs-ui:         clamp(0.90rem,  0.88rem + 0.12vw, 0.97rem);  /* 14.4 → 15.5 */
  --nb-fs-meta:       clamp(0.81rem,  0.79rem + 0.11vw, 0.88rem);  /* 13   → 14.1 */
  --nb-fs-kicker:     clamp(0.75rem,  0.74rem + 0.07vw, 0.80rem);  /* 12   → 12.8 */

  /* --- 行高：黑體 CJK 長文需要較鬆的行距 --- */
  --nb-lh-tight:  1.34;
  --nb-lh-title:  1.50;
  --nb-lh-body:   1.92;
  --nb-lh-lead:   1.80;
  --nb-lh-ui:     1.68;

  /* --- 字距：標題收緊、內文放鬆 --- */
  --nb-ls-headline:  0.005em;
  --nb-ls-title:     0.02em;
  --nb-ls-body:      0.055em;
  --nb-ls-summary:   0.045em;
  --nb-ls-ui:        0.05em;
  --nb-ls-kicker:    0.14em;

  --nb-para-gap:  1.3em;
  --nb-measure:   44em;

  /* --- 圓角與陰影：統一的一組，避免各處各寫 --- */
  --nb-radius-sm:  6px;
  --nb-radius-md:  10px;
  --nb-radius-pill: 999px;
  --nb-shadow-1: 0 1px 2px rgba(15, 50, 85, 0.06), 0 2px 8px rgba(15, 50, 85, 0.06);
  --nb-shadow-2: 0 4px 10px rgba(15, 50, 85, 0.10), 0 12px 28px rgba(15, 50, 85, 0.12);
  --nb-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 根字級：主題原本壓到 88%（手機 81.25%），是「字太小」的根源。改回 100%。 */
html { font-size: 100%; }
@media all and (max-width: 768px) { html { font-size: 100%; } }

/* ==========================================================================
   2. 基礎
   ========================================================================== */

body {
  font-family: var(--nb-font-ui) !important;
  font-size: var(--nb-fs-ui);
  line-height: var(--nb-lh-ui);
  letter-spacing: var(--nb-ls-ui);
  color: var(--nb-ink);
  /* 主題原本設 antialiased，在淺底上會讓中文變細、邊緣發虛。
     改回 subpixel 讓筆畫實一點；optimizeLegibility 對 CJK 沒好處也一併拿掉。 */
  -webkit-font-smoothing: subpixel-antialiased !important;
  -moz-osx-font-smoothing: auto !important;
  text-rendering: optimizeSpeed;
  font-feature-settings: "kern" 1, "tnum" 1;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--nb-font-headline);
  color: var(--nb-title);
  letter-spacing: var(--nb-ls-title);
  line-height: var(--nb-lh-title);
  font-weight: 500;   /* 只用已載入的 400/500/700，避免合成假粗體 */
}

/* ==========================================================================
   3. 報頭 / Hero
   （原本上下的金色細線已移除 — 線條過多）
   ========================================================================== */

#page-title .page-title > h1,
.page-title h1 {
  font-family: var(--nb-font-headline) !important;
  font-size: var(--nb-fs-masthead) !important;
  line-height: var(--nb-lh-tight);
  letter-spacing: 0.1em;
  font-weight: 700;
}

#page-title .page-title > p,
#page-title p {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-lead);
  line-height: var(--nb-lh-lead);
  letter-spacing: 0.05em;
  opacity: 0.94;
}

/* ==========================================================================
   4. 欄目標題
   （原本的 3px 雙線改為單一細線，減少畫面上的線條密度）
   ========================================================================== */

.page-title h4,
.widget > h4,
.sidebar .widget-title,
#blog .page-title h4 {
  font-family: var(--nb-font-headline);
  font-size: var(--nb-fs-section);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--nb-navy-deep);
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--nb-rule);
}

.page-title #pageResult {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  color: var(--nb-ink-muted);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   5. 列表卡片 — 版式對齊
   ========================================================================== */

/* 列表卡片版式
   ─ 大家上傳的都是橫向圖，所以圖片一律用 16:9 的橫向框，不再撐滿欄高、
     不做接近正方形的裁切（那會把橫圖切掉兩側，等於毀掉構圖）。
   ─ 圖佔 38%，文字欄 62%，摘要限 2 行，讓圖與文的高度自然接近，
     不必靠 stretch 硬拉齊。
   只作用在列表（.post-thumbnails），不影響單篇文章與側欄。 */
@media (min-width: 768px) {
  .post-thumbnails .post-item .post-item-wrap {
    display: flex;
    align-items: flex-start;   /* 上緣對齊；不拉伸圖片 */
    gap: 1.75rem;
  }

  .post-thumbnails .post-item .post-image,
  .post-thumbnails .post-item .index.post-image {
    float: none;
    flex: 0 0 38%;
    max-width: 38%;
    width: 38% !important;
    margin: 0;
  }

  .post-thumbnails .post-item .post-item-description,
  .post-thumbnails .post-item .index.post-item-description {
    float: none;
    flex: 1 1 auto;
    width: auto !important;
    max-width: none;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  /* 摘要限 2 行，讓每張卡的文字高度可預期，與 16:9 的圖高度相近 */
  .post-thumbnails .post-item .post-item-description > p.force-line-break {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
  }

  .post-thumbnails .post-item .post-item-description > .btn,
  .post-thumbnails .post-item .post-item-description > a.btn {
    margin-top: auto;
    align-self: flex-start;
  }
}

/* 圖片一律 16:9 橫向框（桌機與手機共用），完整呈現橫向構圖 */
.post-thumbnails .post-item .post-image > a,
.post-thumbnails .post-item .post-image > a > img {
  display: block;
  width: 100%;
}

.post-thumbnails .post-item .post-image > a > img {
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: center;
}

/* 卡片之間拉開距離，減少擁擠感 */
.post-thumbnails .post-item {
  margin-bottom: 2.5rem;
}

.post-thumbnails .post-item .post-item-description > h2 {
  margin-bottom: 0.55em;
}

.post-thumbnails .post-item .post-item-description > .post-meta-date,
.post-thumbnails .post-item .post-item-description > .post-meta-category {
  margin-bottom: 0.35em;
}

/* 圖片圓角：與按鈕、標籤共用同一組圓角語彙 */
.post-item .post-image img,
.post-item .post-image > a > img,
.widget .post-thumbnail img,
.sidebar .post-item img {
  border-radius: var(--nb-radius-md);
}

/* 卡片 hover：整張輕微浮起 */
.post-thumbnails .post-item .post-item-wrap {
  border-radius: var(--nb-radius-md);
  transition: transform 0.25s var(--nb-ease), box-shadow 0.25s var(--nb-ease);
}

.post-thumbnails .post-item .post-item-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--nb-shadow-2);
}

.post-item .post-image img {
  transition: transform 0.45s var(--nb-ease);
}

.post-thumbnails .post-item .post-item-wrap:hover .post-image img {
  transform: scale(1.03);
}

.post-item .post-image {
  overflow: hidden;
  border-radius: var(--nb-radius-md);
}

/* 標題 */
.post-item .post-item-description > h2,
.post-item .post-item-description > h2 > a {
  font-family: var(--nb-font-headline);
  font-size: var(--nb-fs-title);
  line-height: var(--nb-lh-title);
  letter-spacing: var(--nb-ls-title);
  font-weight: 700;
  color: var(--nb-navy-deep);
  transition: color 0.2s var(--nb-ease);
}

.post-item .post-item-description > h2 > a:hover { color: var(--nb-orange); }

/* 摘要 */
.post-item .post-item-description > p,
.post-item .post-item-description > p.force-line-break {
  font-family: var(--nb-font-body);
  font-size: var(--nb-fs-summary);
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--nb-ink-soft);
}

/* meta */
.post-meta-date,
.post-meta-category,
.post-meta-status,
.post-meta-comments,
.post-meta-category a,
.post-meta-date a {
  font-family: var(--nb-font-ui) !important;
  font-size: var(--nb-fs-meta) !important;
  letter-spacing: 0.04em;
  color: var(--nb-ink-muted);
  line-height: 1.7;
}

.post-meta-category .text-bold,
.post-meta-category .text-bold[style] {
  font-size: var(--nb-fs-meta) !important;
  letter-spacing: 0.04em;
}

.post-meta-status {
  color: var(--nb-orange) !important;
  font-weight: 500;
  letter-spacing: var(--nb-ls-kicker);
}

/* 圖片上的分類角標：改為半透明深藍膠囊，貼齊圓角 */
.post-meta-category.category-show {
  border-radius: var(--nb-radius-pill);
  overflow: hidden;
}

.post-meta-category.category-show a {
  font-family: var(--nb-font-ui) !important;
  font-size: var(--nb-fs-kicker) !important;
  letter-spacing: var(--nb-ls-kicker);
  font-weight: 500;
  background: rgba(15, 50, 85, 0.88);
  color: #fff;
  padding: 0.35em 0.9em;
  border-radius: var(--nb-radius-pill);
  backdrop-filter: saturate(140%) blur(2px);
  transition: background 0.2s var(--nb-ease);
}

.post-meta-category.category-show a:hover { background: var(--nb-orange); }

/* ==========================================================================
   6. 單篇文章
   （原本 meta 列的上下框線已移除，改用留白分隔）
   ========================================================================== */

.single-post .post-item .post-item-description > h2,
.single-post .post-item .post-item-description > h2 > a {
  font-family: var(--nb-font-headline);
  font-size: var(--nb-fs-headline);
  line-height: var(--nb-lh-tight);
  letter-spacing: var(--nb-ls-headline);
  font-weight: 700;
  color: var(--nb-navy-deep);
}

.single-post .post-image img { border-radius: var(--nb-radius-md); }

/* 內文本體。元件內原本寫死 14px !important，此處以較高特異性覆蓋 */
.single-post .content-area,
#blog.single-post .content-area {
  font-family: var(--nb-font-body) !important;
  font-size: var(--nb-fs-body) !important;
  line-height: var(--nb-lh-body) !important;
  letter-spacing: var(--nb-ls-body);
  color: var(--nb-ink);
  max-width: var(--nb-measure);
}

.single-post .content-area p,
#blog.single-post .content-area p {
  font-family: var(--nb-font-body) !important;
  font-size: var(--nb-fs-body) !important;
  line-height: var(--nb-lh-body) !important;
  letter-spacing: var(--nb-ls-body);
  color: var(--nb-ink);
  margin-bottom: var(--nb-para-gap);
}

.single-post .content-area span,
#blog.single-post .content-area span {
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit;
}

.single-post .content-area li {
  font-size: var(--nb-fs-body);
  line-height: var(--nb-lh-body);
  letter-spacing: var(--nb-ls-body);
  margin-bottom: 0.5em;
}

.single-post .content-area img { border-radius: var(--nb-radius-md); }

.single-post .content-area h2,
.single-post .content-area h3,
.single-post .content-area h4 {
  font-family: var(--nb-font-headline);
  color: var(--nb-navy-deep);
  letter-spacing: -0.005em;
  line-height: 1.5;
  margin-top: 1.8em;
  margin-bottom: 0.7em;
}

.single-post .content-area h2 { font-size: calc(var(--nb-fs-body) * 1.45); }
.single-post .content-area h3 { font-size: calc(var(--nb-fs-body) * 1.25); }
.single-post .content-area h4 { font-size: calc(var(--nb-fs-body) * 1.10); }

/* 引言：唯一保留的線，換成金色短邊條 */
.single-post .content-area blockquote {
  font-size: calc(var(--nb-fs-body) * 1.05);
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--nb-navy);
  background: var(--nb-tint);
  border-left: 3px solid var(--nb-gold);
  border-radius: 0 var(--nb-radius-sm) var(--nb-radius-sm) 0;
  padding: 0.9em 1.2em;
  margin: 1.6em 0;
}

/* 文章 meta 列：去掉上下框線，改以留白與垂直置中對齊 */
.single-post .post-meta {
  font-family: var(--nb-font-ui);
  padding: 0.2em 0 1.1em;
  margin-bottom: 1.4em;
}

.single-post .post-meta > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;   /* 推廣按鈕與日期／分類在同一條中線上 */
  gap: 0.5rem 0.85rem;
}

.single-post .post-meta .btn { margin-right: 0 !important; }

.post-user-info,
.post-user-info p,
.post-user-info span {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  line-height: 1.9;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   7. 標籤
   ========================================================================== */

.tagcloud a,
.widget .tag-item,
.post-tags a,
a[href*="/tag"] {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  letter-spacing: 0.04em;
}

.tagcloud a,
.widget .tag-item,
.post-tags a {
  display: inline-block;
  padding: 0.34em 0.85em;
  margin: 0 0.35em 0.5em 0;
  background: var(--nb-tint);
  color: var(--nb-navy);
  border: 1px solid transparent;
  border-radius: var(--nb-radius-pill);
  line-height: 1.6;
  transition: background 0.2s var(--nb-ease), color 0.2s var(--nb-ease),
              transform 0.2s var(--nb-ease), box-shadow 0.2s var(--nb-ease);
}

.tagcloud a:hover,
.widget .tag-item:hover,
.post-tags a:hover {
  background: var(--nb-navy);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--nb-shadow-1);
}

/* ==========================================================================
   8. 導覽 / 按鈕 / 表單
   ========================================================================== */

#mainMenu nav > ul > li > a {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-ui);
  letter-spacing: 0.03em;
  font-weight: 500;
  border-radius: var(--nb-radius-sm);
  transition: color 0.2s var(--nb-ease), transform 0.2s var(--nb-ease),
              box-shadow 0.2s var(--nb-ease), background 0.2s var(--nb-ease);
}

/* 選單 hover：輕微浮起 + 陰影 */
#mainMenu nav > ul > li > a:hover {
  color: var(--nb-orange);
  transform: translateY(-2px);
}

#mainMenu nav > ul > li.current > a,
#mainMenu nav > ul > li > a:hover {
  background: rgba(22, 69, 115, 0.05);
  box-shadow: var(--nb-shadow-1);
}

.btn, .btn-sm, .btn-xs, button {
  font-family: var(--nb-font-ui);
  letter-spacing: 0.04em;
}

.btn {
  font-size: var(--nb-fs-ui);
  border-radius: var(--nb-radius-sm);
  transition: transform 0.2s var(--nb-ease), box-shadow 0.2s var(--nb-ease),
              background 0.2s var(--nb-ease), color 0.2s var(--nb-ease);
}

.btn-sm { font-size: var(--nb-fs-meta); }
.btn-xs { font-size: var(--nb-fs-kicker); }
.btn-rounded, .btn-pill { border-radius: var(--nb-radius-pill); }

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--nb-shadow-2);
}

.btn:active { transform: translateY(0); box-shadow: var(--nb-shadow-1); }

input, select, textarea, .form-control {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-ui);
  border-radius: var(--nb-radius-sm);
}

.pagination .page-link {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  letter-spacing: 0.03em;
  border-radius: var(--nb-radius-sm);
  transition: background 0.2s var(--nb-ease), color 0.2s var(--nb-ease);
}

/* ==========================================================================
   9. 側欄
   ========================================================================== */

.sidebar .list-group-item,
.sidebar .nav-link,
.widget .list-group-item {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-ui);
  letter-spacing: 0.02em;
  line-height: 1.8;
  transition: background 0.2s var(--nb-ease), color 0.2s var(--nb-ease),
              padding-left 0.2s var(--nb-ease);
}

.sidebar .list-group-item:hover,
.widget .list-group-item:hover {
  background: var(--nb-tint);
  color: var(--nb-navy);
  padding-left: calc(1.25rem + 4px);
}

.sidebar .post-item-description h3,
.sidebar .post-item-description h3 > a,
.widget .post-thumbnail-content h3,
.widget .post-thumbnail-content h3 > a {
  font-family: var(--nb-font-headline);
  font-size: var(--nb-fs-summary);
  line-height: 1.6;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--nb-navy-deep);
}

/* ==========================================================================
   10. 頁尾
   ========================================================================== */

#footer, #footer p, #footer a, #footer li {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  line-height: 1.9;
  letter-spacing: 0.02em;
}

#footer h4, #footer .widget-title {
  font-family: var(--nb-font-headline);
  font-size: var(--nb-fs-summary);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   11. 小螢幕微調
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --nb-lh-body: 1.85;
    --nb-para-gap: 1.2em;
    --nb-measure: 100%;
  }

  /* 手機是上下堆疊，圖片改用固定比例避免忽高忽低 */
  .post-thumbnails .post-item .post-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .post-item .post-item-description { padding-top: 0.9rem; }

  /* 觸控裝置不需要浮起效果 */
  .post-thumbnails .post-item .post-item-wrap:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (hover: none) {
  .btn:hover,
  .tagcloud a:hover,
  #mainMenu nav > ul > li > a:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ==========================================================================
   12. 按鈕尺寸修正
   主題用 `.btn:not(.close):not(.mfp-close).btn-sm`（0,4,0）把按鈕鎖成
   font-size:11px / height:30px，比內文小一半以上，且固定高度無法配合流動字級。
   以同級選擇器改為 min-height + padding，讓按鈕隨字級長高。
   ========================================================================== */

button.btn,
.btn:not(.close):not(.mfp-close),
a.btn:not([href]):not([tabindex]) {
  font-size: var(--nb-fs-ui);
  height: auto;
  min-height: 42px;
  line-height: 1.5;
  padding: 0.6em 1.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nb-radius-sm);
}

button.btn.btn-xs,
.btn:not(.close):not(.mfp-close).btn-xs,
a.btn:not([href]):not([tabindex]).btn-xs {
  font-size: var(--nb-fs-kicker);
  height: auto;
  min-height: 30px;
  line-height: 1.5;
  padding: 0.32em 0.85em;
}

button.btn.btn-sm,
.btn:not(.close):not(.mfp-close).btn-sm,
a.btn:not([href]):not([tabindex]).btn-sm {
  font-size: var(--nb-fs-meta);
  height: auto;
  min-height: 36px;
  line-height: 1.5;
  padding: 0.45em 1.15em;
}

button.btn.btn-lg,
.btn:not(.close):not(.mfp-close).btn-lg,
a.btn:not([href]):not([tabindex]).btn-lg,
button.btn.btn-xl,
.btn:not(.close):not(.mfp-close).btn-xl,
a.btn:not([href]):not([tabindex]).btn-xl {
  font-size: var(--nb-fs-lead);
  height: auto;
  min-height: 54px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  padding: 0.7em 2em;
}

button.btn.btn-rounded,
.btn:not(.close):not(.mfp-close).btn-rounded,
a.btn:not([href]):not([tabindex]).btn-rounded {
  border-radius: var(--nb-radius-pill);
}

/* 主題的 hover 會把所有按鈕變成 #0333e8（非品牌藍）。改回 NewsBuffet 深藍。 */
button.btn:hover,
.btn:not(.close):not(.mfp-close):hover,
a.btn:not([href]):not([tabindex]):hover,
button.btn:focus,
.btn:not(.close):not(.mfp-close):focus,
a.btn:not([href]):not([tabindex]):focus {
  background-color: var(--nb-navy);
  border-color: var(--nb-navy);
  color: #fff;
}

/* 淺色按鈕（hero 上的「立即註冊 / 立即了解」）hover 用金色，維持在深藍底上的對比 */
button.btn.btn-light:hover,
.btn:not(.close):not(.mfp-close).btn-light:hover,
a.btn:not([href]):not([tabindex]).btn-light:hover {
  background-color: var(--nb-gold);
  border-color: var(--nb-gold);
  color: var(--nb-navy-deep);
}

/* 按鈕內的圖示與文字垂直置中（原本 icon 用 margin-top 硬推） */
.btn > i,
.btn > img.icon-megaphone {
  margin-top: 0 !important;
  vertical-align: middle;
}

/* ==========================================================================
   13. 斷字
   元件用 word-break: break-all，會把英文單字從中間切開
   （例："SEO des / cription"）。改為只在必要時斷行，CJK 不受影響。
   ========================================================================== */

.force-line-break,
.post-item .post-item-description > p.force-line-break,
.single-post .content-area.force-line-break {
  word-break: normal !important;
  overflow-wrap: anywhere;
  line-break: strict;
}

/* ==========================================================================
   14. 細節收尾
   ========================================================================== */

/* --- 標籤：主題把 .post-tags a 鎖成 12px / 4px 圓角，這裡以較高特異性覆蓋 --- */
div.post-tags a,
div.post-tags a.mr-1,
.single-post .post-tags a {
  display: inline-flex;
  align-items: center;
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta) !important;
  letter-spacing: 0.03em;
  padding: 0.38em 0.95em !important;
  margin: 0 0.4em 0.55em 0 !important;
  background: var(--nb-tint);
  color: var(--nb-navy);
  border: 1px solid transparent;
  border-radius: var(--nb-radius-pill) !important;
  line-height: 1.6;
  transition: background 0.2s var(--nb-ease), color 0.2s var(--nb-ease),
              transform 0.2s var(--nb-ease), box-shadow 0.2s var(--nb-ease);
}

div.post-tags a::before,
.single-post .post-tags a::before {
  content: "#";
  opacity: 0.45;
  margin-right: 0.25em;
  font-weight: 500;
}

div.post-tags a:hover,
.single-post .post-tags a:hover {
  background: var(--nb-navy);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--nb-shadow-1);
}

div.post-tags a:hover::before { opacity: 0.7; }

/* --- 線條瘦身：把 <hr> 換成留白，畫面上少兩條橫線 --- */
#blog hr,
.single-post hr,
.post-thumbnails hr {
  border: 0;
  height: 0;
  margin: 1.8rem 0;
}

/* 發佈單位資訊卡內的分隔線保留，但改為極淺 */
.post-user-info hr {
  border: 0;
  border-top: 1px solid var(--nb-rule);
  margin: 0.9rem 0;
  height: 0;
}

/* 上一篇／下一篇：去掉外框線，改用底色區塊 */
.post-navigation {
  border: 0 !important;
  background: var(--nb-tint);
  border-radius: var(--nb-radius-md);
  padding: 0.4rem 0.6rem;
}

.post-navigation > div,
.post-navigation > a {
  border: 0 !important;
}

.post-navigation a {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  letter-spacing: 0.02em;
  color: var(--nb-ink-soft);
  transition: color 0.2s var(--nb-ease);
}

.post-navigation a:hover { color: var(--nb-navy); }

/* --- 贊助標記：改為膠囊，與其他標記語彙一致 --- */
.post-meta-status,
span.post-meta-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: rgba(255, 128, 73, 0.12);
  color: var(--nb-orange) !important;
  padding: 0.28em 0.8em;
  border-radius: var(--nb-radius-pill);
  font-size: var(--nb-fs-kicker) !important;
  font-weight: 500;
  letter-spacing: var(--nb-ls-kicker);
}

/* --- 側欄頁籤：字級縮到 meta，避免「最新新聞稿」被擠到第二行 --- */
.nav-tabs .nav-link,
.sidebar .nav-tabs .nav-link {
  font-family: var(--nb-font-ui);
  font-size: var(--nb-fs-meta);
  letter-spacing: 0.02em;
  padding: 0.5em 0.75em;
  white-space: nowrap;
  border-radius: var(--nb-radius-sm) var(--nb-radius-sm) 0 0;
  transition: color 0.2s var(--nb-ease), background 0.2s var(--nb-ease);
}

.sidebar .nav-tabs { flex-wrap: nowrap; }

.nav-tabs .nav-link:hover { background: var(--nb-tint); }

/* --- 側欄縮圖也給圓角 --- */
.sidebar img,
.widget img,
.sidebar .post-item .post-image img {
  border-radius: var(--nb-radius-sm);
}

/* --- 分享鈕：維持圓形，hover 浮起 --- */
.post-meta-share .btn {
  min-height: 34px;
  padding: 0.35em 0.7em;
}

/* 文章 meta 列底下最後一條主題細線也移除，改由留白分隔 */
.single-post .post-meta,
#blog.single-post .post-meta {
  border-bottom: 0 !important;
}

/* 列表頁「最新新聞稿」上方那條 <hr> 與欄目標題的線重複，一併收掉 */
.container hr,
section hr {
  border: 0;
  height: 0;
  margin: 1.6rem 0;
}

/* .post-item-description 改成 column flex 後，子元素預設 stretch，
   會把「贊助」膠囊拉成整列寬。這裡讓它縮回內容寬度。 */
.post-thumbnails .post-item .post-item-description > .post-meta-status,
.post-thumbnails .post-item .post-item-description > span.post-meta-status {
  align-self: flex-start;
}

/* ==========================================================================
   15. 卡片內距、字重與贊助標記（第三輪修正）
   ========================================================================== */

/* --- 卡片：白底 + 內距。原本圖片與文字直接貼齊卡片邊緣，看起來很擠 --- */
.post-thumbnails .post-item .post-item-wrap {
  position: relative;
  background: var(--nb-card);
  padding: 1.25rem;
  border-radius: var(--nb-radius-md);
  box-shadow: 0 1px 2px rgba(15, 50, 85, 0.05), 0 1px 6px rgba(15, 50, 85, 0.05);
  overflow: hidden;   /* 讓右上角標籤跟著卡片圓角切邊 */
}

@media (min-width: 768px) {
  .post-thumbnails .post-item .post-item-wrap { padding: 1.5rem; }
}

/* 卡片間距可以收一點，因為卡片自己有內距了 */
.post-thumbnails .post-item { margin-bottom: 1.75rem; }

/* --- 贊助：改成卡片右上角的 label，不再自己佔一行 --- */
.post-thumbnails .post-item .post-item-description > .post-meta-status,
.post-thumbnails .post-item .post-item-description > span.post-meta-status {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 0.42em 1.05em 0.42em 1.15em;
  background: var(--nb-orange);
  color: #fff !important;
  border-radius: 0 var(--nb-radius-md) 0 var(--nb-radius-md);
  font-size: var(--nb-fs-kicker) !important;
  font-weight: 500;
  letter-spacing: var(--nb-ls-kicker);
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(255, 128, 73, 0.35);
}

/* 星號在 label 裡是多餘的視覺噪音 */
.post-thumbnails .post-item .post-meta-status > i { display: none; }

/* 標籤在右上角，桌機的 meta 列與它同一列，右側要留空間避免撞到。
   手機是上下堆疊、meta 在圖片下方，不需要這個留白，否則日期與分類之間會出現大空隙。 */
@media (min-width: 768px) {
  .post-thumbnails .post-item .post-item-description > .post-meta-date,
  .post-thumbnails .post-item .post-item-description > .post-meta-category {
    padding-right: 5.5rem;
  }
}

/* --- 字重與顏色微調：黑體用 400／細節用 500，避免整片過粗 --- */
.post-item .post-item-description > h2,
.post-item .post-item-description > h2 > a {
  font-weight: 500;
  color: var(--nb-title);
  letter-spacing: var(--nb-ls-title);
}

.post-item .post-item-description > p,
.post-item .post-item-description > p.force-line-break {
  font-weight: 400;
  letter-spacing: var(--nb-ls-summary);
  color: var(--nb-ink-soft);
}

.post-meta-date,
.post-meta-category,
.post-meta-category a,
.post-meta-date a {
  font-weight: 400;
  letter-spacing: var(--nb-ls-ui);
  color: var(--nb-ink-muted);
}

.page-title h4,
.widget > h4,
.sidebar .widget-title,
#blog .page-title h4 {
  font-weight: 500;
  color: var(--nb-title);
}

/* 文章大標維持 700 — 這是全頁唯一需要重量的地方 */
.single-post .post-item .post-item-description > h2,
.single-post .post-item .post-item-description > h2 > a {
  font-weight: 700;
  color: var(--nb-title);
  letter-spacing: var(--nb-ls-headline);
}

/* 內文：字距讓開，顏色不用全黑 */
.single-post .content-area,
#blog.single-post .content-area,
.single-post .content-area p,
#blog.single-post .content-area p {
  letter-spacing: var(--nb-ls-body);
  color: var(--nb-ink);
  font-weight: 400;
}

.single-post .content-area h2,
.single-post .content-area h3,
.single-post .content-area h4 {
  font-weight: 500;
  color: var(--nb-title);
}

/* 報頭在深藍底上，細字會糊，維持 500 但不要更粗 */
#page-title .page-title > h1,
.page-title h1 {
  font-weight: 500;
}

/* 側欄與頁尾 */
.sidebar .list-group-item,
.widget .list-group-item,
#footer, #footer p, #footer a, #footer li {
  font-weight: 400;
  letter-spacing: var(--nb-ls-ui);
}

/* 文章頁的贊助標記比照列表，改成右上角 label（原本也是自己佔一行） */
.single-post .post-item .post-item-wrap {
  position: relative;
}

.single-post .post-item .post-item-description > .post-meta-status,
.single-post .post-item .post-item-description > span.post-meta-status {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  padding: 0.45em 1.1em;
  background: var(--nb-orange);
  color: #fff !important;
  border-radius: 0 var(--nb-radius-md) 0 var(--nb-radius-md);
  font-size: var(--nb-fs-kicker) !important;
  font-weight: 500;
  letter-spacing: var(--nb-ls-kicker);
  line-height: 1.5;
  box-shadow: 0 1px 6px rgba(255, 128, 73, 0.4);
}

.single-post .post-meta-status > i { display: none; }
