/* 相關文章／延伸閱讀統一模板（2026-12-01）
 *
 * 問題：全站有 4 種「相關文章」寫法
 *   A. <div class="hub-quick-nav related-articles"> + hub-nav-card（專區頁）
 *   B. <div class="related-links"><h3>…</h3><ul><li><a>（文章頁，較正式）
 *   C. <div class="related-links"><h3>…</h3><a>（文章頁，直接 a，無 li）
 *   D. <div style="..."> + inline style 的 h3 + a（無 class，最亂）
 *
 * 處理：統一為 A（卡片式，專區頁與文章頁都用）＋保留 B 的語意 class，
 *      所有 inline style 抽到本檔案，版面由 CSS 控制。
 *
 * 設計：卡片式（圖示 + 標題 + 摘要 + 箭頭）比純文字清單更好讀，
 *      也讓「延伸閱讀」在視覺上與其他區塊一致。
 */

/* ── 容器 ── */
.related-articles {
  display: grid;
  /* ⚠️ minmax 下限不可硬編碼 260px：窄視窗（320px）時容器可用寬度
     只有 256px，欄寬 260px 會造成 4px 水平溢出。
     用 min(260px, 100%) 讓欄寬永不超過容器寬度。 */
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
  margin: 2rem 0;
  /* 專屬 CSS 可能對本容器加 padding；border-box 確保 padding 計入寬度 */
  box-sizing: border-box;
  max-width: 100%;
}

/* ── 卡片 ── */
.related-articles .hub-nav-card,
.related-links .hub-nav-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1.5px solid #e8eaf2;
  border-radius: 12px;
  transition: all 0.25s;
}

.related-articles .hub-nav-card:hover,
.related-links .hub-nav-card:hover {
  border-color: #1B2952;
  box-shadow: 0 4px 16px rgba(27, 41, 82, 0.08);
  transform: translateY(-2px);
}

.related-articles .hub-nav-icon,
.related-links .hub-nav-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.related-articles .hub-nav-text,
.related-links .hub-nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.related-articles .hub-nav-text strong,
.related-links .hub-nav-text strong {
  color: #1B2952;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

/* 卡片標題內的連結：不可變色、不要下劃線底線以外的裝飾 */
.related-articles .hub-nav-text strong a,
.related-links .hub-nav-text strong a {
  color: inherit;
  text-decoration: none;
}

.related-articles .hub-nav-text strong a:hover,
.related-links .hub-nav-text strong a:hover {
  text-decoration: underline;
}

.related-articles .hub-nav-text em,
.related-links .hub-nav-text em {
  color: #5a6a8a;
  font-size: 0.85rem;
  font-style: normal;
  line-height: 1.5;
}

/* ── 相容舊的 related-links（純文字清單）── */
.related-links {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--off-white, #f7f8fb);
  border-radius: 12px;
}

.related-links h3 {
  color: #1a2744;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.related-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-links li {
  margin-bottom: 0.4rem;
}

.related-links li a,
.related-links > a {
  display: block;
  color: #1a2744;
  padding: 0.4rem 0;
  text-decoration: none;
  line-height: 1.6;
}

.related-links li a:hover,
.related-links > a:hover {
  color: var(--navy, #1B2952);
  text-decoration: underline;
}
