/* 週刊 信オン通信（/tsushin/）。ページの骨組みは既存の読み物ページ（資料庫・公開記録）の部品をそのまま使う:
   editorial-page / records-page、search-hero + section-eyebrow + h2、records-illustration、detail-card records-section、
   records-sources、library-grid / library-item、inline-link（assets/styles.css）。
   ここには既存の部品で表せないものだけを置く: パンくず、題字入り表紙を切り抜かない大きさ、目次の段組み、記録カードの表紙サムネイル、
   本文の段落の余白、取り込んだ本文の wk-* クラス（scripts/import_weekly_tsushin_issue.py が WordPress の style から写したもの）。
   色は共通トークンだけを使い、連載専用の配色・グラデーション・8pxを超える角丸は持たない（DESIGN.md）。
   本文の囲み・紹介・合戦の数字は入れ子になることがあるため、背景つきの箱にせず罫線だけで区切る（カード内カードを作らない）。 */
.wk-crumbs { margin: 0 0 14px; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.wk-crumbs a { color: var(--accent-2); }
.wk-byline { margin-top: .45rem !important; color: var(--muted); font-size: .85rem; }

/* 表紙: 題字が入った 1200x630 なので切り抜かず、records-illustration と同じ高さ（PC 16rem・390px 約8rem）に収める */
.records-illustration.wk-cover-figure { width: min(100%, 30.5rem); }
.records-illustration.wk-cover-figure img { height: auto; aspect-ratio: 1200 / 630; object-fit: contain; }
/* 号のページの表紙は、タイトル入りの横長ヒーロー画像として本文の列の幅いっぱいに出す（スマホでも同じ。縦横比は保ち、切り抜かない） */
.records-illustration.wk-cover-figure.wk-cover-full { width: 100%; }
.wk-thumb-empty {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1200 / 630;
  background: var(--bg); color: var(--muted); font-weight: 800;
}

.wk-toc ol { margin: 0; padding-left: 1.8em; line-height: 1.8; }
.wk-toc li { break-inside: avoid; }

/* 号カード（library-item）の表紙サムネイルと2行の抜粋 */
.wk-record-thumb { display: block; min-width: 0; }
.wk-record-thumb img, .wk-record-thumb .wk-thumb-empty { display: block; width: 100%; height: auto; aspect-ratio: 600 / 315; object-fit: cover; border: 1px solid var(--line); }
.library-item .wk-record-excerpt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-pager .library-grid, .wk-backnumbers .library-grid { padding: 0; list-style: none; }
/* 前後の号は1〜2件なので、在る件数ぶんの列だけを作る（空の列や全幅の大きな表紙にしない） */
.wk-pager .library-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 24rem); width: fit-content; max-width: 100%; }

/* 本文: detail-section の段落は余白0なので、読み物として段落と章の間をあける */
.wk-body { line-height: 1.9; overflow-wrap: anywhere; }
.wk-body p, .wk-body ul, .wk-body ol { margin: 0 0 14px; }
.wk-body ul, .wk-body ol { padding-left: 1.3em; }
.wk-body li { margin: 0 0 8px; }
.wk-body a { color: var(--accent-2); }
.editorial-page .wk-body h2 { margin-top: 2.2rem; scroll-margin-top: 16px; }
.editorial-page .wk-body > :first-child h2:first-child, .editorial-page .wk-body > h2:first-child { margin-top: 0; }
.wk-emoji { margin-right: .35em; }

/* 取り込んだ本文の部品（wk-*）。どれも罫線だけで区切る */
.wk-cover { margin: 0 0 8px; }
.wk-kicker { margin: 0 0 6px !important; color: var(--accent-2); font-weight: 700; font-size: .88rem; }
.wk-box { margin: 18px 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent-2); }
.wk-box > :last-child { margin-bottom: 0; }
.wk-strong { font-weight: 700; }
.wk-sub, .wk-muted, .wk-caption, .wk-figure figcaption { color: var(--muted); }
.wk-caption, .wk-figure figcaption { margin-top: 6px; font-size: .85rem; }
.wk-label { display: block; margin-bottom: 4px; color: var(--accent-2); font-size: .8em; font-weight: 700; line-height: 1.5; }
.wk-nowrap { white-space: nowrap; }
.wk-crest { display: inline-block; width: 18px; height: 18px; margin-right: 4px; vertical-align: -3px; }
.wk-cards { display: grid; margin: 14px 0; border-bottom: 1px solid var(--line); }
.wk-card { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.wk-card > div, .wk-thumb { min-width: 0; }
.wk-card p { margin: 0 0 6px; }
.wk-thumb { display: block; position: relative; }
.wk-thumbimg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); }
.wk-video .wk-thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 32px; margin: -16px 0 0 -23px; border-radius: 6px;
  background: rgb(0 0 0 / 62%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.wk-ext { margin-left: 6px; text-decoration: none; }
.wk-figure:not(.wk-card) { margin: 16px 0; }
.wk-figure:not(.wk-card) img { display: block; width: 100%; height: auto; }
.wk-quote, .wk-body blockquote { margin: 16px 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); }
.wk-grid { display: grid; gap: 0 24px; margin: 16px 0; }
.wk-panel { min-width: 0; margin-bottom: -1px; padding: 12px 0; border-block: 1px solid var(--line); }
.wk-panel-title { margin: 0 0 8px !important; font-weight: 800; }
.wk-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.wk-vs > div { min-width: 0; }
.wk-vs-mark { color: var(--muted); }
.wk-right { text-align: right; }
.wk-num { display: block; margin-top: 4px; font-size: 1.08em; font-variant-numeric: tabular-nums; }
.wk-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.wk-up { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.wk-down { color: var(--accent); font-weight: 700; white-space: nowrap; }
.wk-table { margin: 12px 0; min-width: 0; }
/* 共通の table は比較表用に min-width: 920px を持つため、本文の小さな表では外し、表の中だけを横スクロールにする */
.wk-body table { display: block; width: auto; min-width: 0; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 12px 0; }
.wk-body th, .wk-body td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; }

@media (min-width: 640px) {
  .wk-toc ol { columns: 2; column-gap: 2.5em; }
  .wk-card { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 16px; }
  .wk-card.wk-video { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
  .wk-card:not(.wk-video):not(.wk-figure) { grid-template-columns: 1fr; }
  .wk-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .records-illustration.wk-cover-figure { width: min(100%, 15.5rem); }
  .wk-pager .library-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); width: auto; }
}
@media (min-width: 960px) {
  .wk-latest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30.5rem); gap: 0 2rem; align-items: center; }
  .wk-latest .wk-cover-figure { margin: 0; }
  .wk-latest.wk-latest-nocover { grid-template-columns: minmax(0, 1fr); }
}
