/*
 * 記事ページの下の「関連記事」（2026-11-29、案 A・4 本）。部品は inc/related-posts.php。記事ページ（is_singular('post')）だけ読み込む。
 * PC は 2 列（画像は 1200:630 で切らない・ラベルはテーマと県の 2 つ・公開日・題は 3 行まで）、幅 640px 以下は 1 列で画像を左に置く。
 * ラベルと公開日の行は幅が足りないと折り返す（スマホでテーマ名が長いと公開日が右で切れていた。staging 2026-11-29）。
 * 2 列の幅は minmax(0,1fr) で同じにする（幅 820px で長いラベルの行が片方の列を広げていた。同じ日）。
 * single.css の「main > .white_wrap + .white_wrap ul / li」より強い指定にしてある（.hb-rel と .hb-rel-list を足す）。
 */
main > .white_wrap.hb-rel .bg_blue small{font-size:12px;font-weight:400;margin-left:8px;opacity:.9}
main > .white_wrap.hb-rel ul.hb-rel-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 20px;list-style:none;margin:0;padding:0 20px 24px}
main > .white_wrap.hb-rel ul.hb-rel-list > li{width:auto;padding:0;margin:0;list-style:none}
.hb-rel-card{display:flex;flex-direction:column;height:100%;color:#222;text-decoration:none}
.hb-rel-card:hover .hb-rel-title{color:#2b7fb0}
.hb-rel-card:focus-visible{outline:2px solid #2b7fb0;outline-offset:2px}
.hb-rel-img{display:block;aspect-ratio:1200/630;overflow:hidden;border-radius:4px;background:#eef3f7}
main > .white_wrap.hb-rel .hb-rel-img img{display:block;width:100%;max-width:none;height:100%;object-fit:cover;margin:0}
.hb-rel-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin:10px 0 6px;font-size:11px;line-height:1.4}
.hb-rel-meta > *{white-space:nowrap}
.hb-rel-cat{background:#e2e2e2;color:#333;padding:3px 8px;border-radius:2px}
.hb-rel-pref{background:#58AEDD;color:#fff;padding:3px 8px;border-radius:2px}
.hb-rel-meta time{color:#888;margin-left:2px}
.hb-rel-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;font-size:15px;line-height:1.55;font-weight:600}
@media screen and (max-width:640px){
  main > .white_wrap.hb-rel ul.hb-rel-list{grid-template-columns:1fr;gap:0;margin:0;padding:0 15px 8px}
  main > .white_wrap.hb-rel ul.hb-rel-list > li{width:auto;padding:12px 0;border-top:1px solid #eee}
  main > .white_wrap.hb-rel ul.hb-rel-list > li:first-child{border-top:0}
  .hb-rel-card{display:grid;grid-template-columns:128px 1fr;grid-template-rows:auto 1fr;column-gap:12px}
  .hb-rel-img{grid-row:1 / span 2;align-self:start}
  .hb-rel-meta{margin:0 0 4px;font-size:10px;gap:4px}
  .hb-rel-cat,.hb-rel-pref{padding:2px 6px}
  .hb-rel-title{font-size:14px;font-weight:500;-webkit-line-clamp:4;line-clamp:4}
}

/* ダーク表示（hb-dark.css と同じ色。p.category・p.prefectures のダークと同じ組み合わせ） */
html[data-hb-theme="dark"] .hb-rel-card{color:var(--d-text)}
html[data-hb-theme="dark"] .hb-rel-card:hover .hb-rel-title{color:var(--d-link)}
html[data-hb-theme="dark"] .hb-rel-img{background:var(--d-surface2)}
html[data-hb-theme="dark"] .hb-rel-cat{background:#2a3341;color:#d5dbe4}
html[data-hb-theme="dark"] .hb-rel-pref{background:var(--d-accent);color:#fff}
html[data-hb-theme="dark"] .hb-rel-meta time{color:var(--d-muted)}
html[data-hb-theme="dark"] main > .white_wrap.hb-rel ul.hb-rel-list > li{border-color:var(--d-border)}
