/**
 * blog-ingest-blocks.css
 *
 * Article Ingest API（JSON入稿API）で生成された Gutenberg ブロックの描画スタイル。
 * single-post.jsx の `.hb-article` 配下に流し込まれる content_html 用。
 *
 * 設計指針:
 * - 親スコープは `.hb-article`（React mount 配下の <article>）
 * - note風の余白・行間・文字間 + 既存テーマの cream/paper/serif 言語と調和
 * - スマホ (≤768px) で読みやすい余白圧縮を担保
 * - CSSネスティング禁止、フラットセレクタ
 */

/* ========================================
 * 本文タイポグラフィ（note風）
 * ======================================== */
.hb-ingest-v1 .hb-article {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.92;
  letter-spacing: 0.04em;
  color: #2c2c2c;
  font-feature-settings: "palt";
  word-break: break-word;
}
.hb-ingest-v1 .hb-article p {
  font-size: 16px !important;
  line-height: 1.92 !important;
  letter-spacing: 0.04em !important;
  color: #2c2c2c !important;
  margin: 0 0 1.6rem !important;
}

/* 見出し */
.hb-ingest-v1 .hb-article h2.wp-block-heading {
  font-size: 1.55rem !important;
  line-height: 1.5 !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin: 3rem 0 1.25rem !important;
  padding-bottom: 0.55rem !important;
  border-bottom: 1px solid #e6e1d4 !important;
  letter-spacing: 0.02em !important;
}
.hb-ingest-v1 .hb-article h3.wp-block-heading {
  font-size: 1.2rem !important;
  line-height: 1.55 !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin: 2.4rem 0 0.85rem !important;
  padding-left: 0.75rem !important;
  border-left: 3px solid #b8a98a !important;
  letter-spacing: 0.02em !important;
}
.hb-ingest-v1 .hb-article h4.wp-block-heading {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #2a2a2a !important;
  margin: 2rem 0 0.75rem !important;
}

/* インライン */
.hb-ingest-v1 .hb-article a {
  color: #2a5772 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.hb-ingest-v1 .hb-article a:hover { color: #4a7c9a !important; }
.hb-ingest-v1 .hb-article strong { font-weight: 700 !important; color: #1a1a1a; }
.hb-ingest-v1 .hb-article em { font-style: italic; color: #3a3a3a; }
.hb-ingest-v1 .hb-article code {
  background: #f3efe5;
  border: 1px solid #e6e1d4;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #b03a3a;
  letter-spacing: 0;
}

/* リスト */
.hb-ingest-v1 .hb-article ul.wp-block-list,
.hb-ingest-v1 .hb-article ol.wp-block-list {
  margin: 0 0 1.6rem !important;
  padding-left: 1.6em !important;
}
.hb-ingest-v1 .hb-article ul.wp-block-list li,
.hb-ingest-v1 .hb-article ol.wp-block-list li {
  margin-bottom: 0.55rem !important;
  line-height: 1.85 !important;
  letter-spacing: 0.04em !important;
}
.hb-ingest-v1 .hb-article ul.wp-block-list li::marker { color: #b8a98a; }
.hb-ingest-v1 .hb-article ol.wp-block-list li::marker { color: #6a6a6a; font-weight: 600; }

/* 画像 */
.hb-ingest-v1 .hb-article figure.wp-block-image {
  margin: 2.25rem 0 !important;
  text-align: center;
}
.hb-ingest-v1 .hb-article figure.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0 auto;
}
.hb-ingest-v1 .hb-article figure.wp-block-image figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: #777;
  line-height: 1.65;
  text-align: center;
}

/* テーブル */
.hb-ingest-v1 .hb-article figure.wp-block-table {
  margin: 2rem 0 !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hb-ingest-v1 .hb-article figure.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.7;
}
.hb-ingest-v1 .hb-article figure.wp-block-table th,
.hb-ingest-v1 .hb-article figure.wp-block-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e6e1d4;
  letter-spacing: 0.02em;
  vertical-align: top;
}
.hb-ingest-v1 .hb-article figure.wp-block-table thead th {
  background: #f8f6ef;
  font-weight: 700;
  color: #1a1a1a;
  border-bottom: 2px solid #b8a98a;
}

/* 引用 */
.hb-ingest-v1 .hb-article blockquote.wp-block-quote {
  margin: 2rem 0 !important;
  padding: 0.5rem 0 0.5rem 1.5rem !important;
  border-left: 3px solid #b8a98a !important;
  background: transparent !important;
  color: #4a4a4a !important;
  font-style: normal;
}
.hb-ingest-v1 .hb-article blockquote.wp-block-quote p {
  color: #4a4a4a !important;
  margin-bottom: 0.5rem !important;
}
.hb-ingest-v1 .hb-article blockquote.wp-block-quote cite {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #888;
  font-style: normal;
}
.hb-ingest-v1 .hb-article blockquote.wp-block-quote cite::before { content: "— "; }

/* ========================================
 * Callout（4 variant + cta）
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-callout {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  border-left: 4px solid;
}
.hb-ingest-v1 .hb-article .hb-callout p {
  font-size: 0.94rem !important;
  line-height: 1.85 !important;
  margin-bottom: 0.7rem !important;
}
.hb-ingest-v1 .hb-article .hb-callout p:last-child { margin-bottom: 0 !important; }
.hb-ingest-v1 .hb-article .hb-callout__title {
  font-size: 0.92rem !important;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem !important;
}

.hb-ingest-v1 .hb-article .hb-callout--info {
  background: #f0f5fa;
  border-left-color: #4a7c9a;
}
.hb-ingest-v1 .hb-article .hb-callout--info .hb-callout__title strong { color: #2a5772; }
.hb-ingest-v1 .hb-article .hb-callout--warning {
  background: #fdf6e7;
  border-left-color: #d4a843;
}
.hb-ingest-v1 .hb-article .hb-callout--warning .hb-callout__title strong { color: #8a6a1a; }
.hb-ingest-v1 .hb-article .hb-callout--success {
  background: #eff5ec;
  border-left-color: #6a9a4a;
}
.hb-ingest-v1 .hb-article .hb-callout--success .hb-callout__title strong { color: #3a6a2a; }
.hb-ingest-v1 .hb-article .hb-callout--note {
  background: #f8f6ef;
  border-left-color: #b8a98a;
}
.hb-ingest-v1 .hb-article .hb-callout--note .hb-callout__title strong { color: #5a4a2a; }

/* CTA variant — 既存 .cta-box デザイン踏襲（navy + gold） */
.hb-ingest-v1 .hb-article .hb-callout--cta {
  background: #2A5772 !important;
  border: none !important;
  border-left: none !important;
  border-radius: 8px !important;
  padding: 2rem 1.75rem 1.6rem !important;
  margin: 2.5rem 0 !important;
  text-align: center;
}
.hb-ingest-v1 .hb-article .hb-callout--cta .hb-callout__title {
  font-size: 1.25rem !important;
  margin-bottom: 0.7rem !important;
  color: #fff !important;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif !important;
  letter-spacing: 0.06em;
}
.hb-ingest-v1 .hb-article .hb-callout--cta .hb-callout__title strong {
  color: #fff !important;
  font-weight: 600 !important;
}
.hb-ingest-v1 .hb-article .hb-callout--cta p {
  color: #f0e8d8 !important;
  font-size: 0.95rem !important;
  line-height: 1.85 !important;
  margin-bottom: 1.3rem !important;
  letter-spacing: 0.04em;
}
.hb-ingest-v1 .hb-article .hb-callout--cta p:last-child { margin-bottom: 0 !important; }
.hb-ingest-v1 .hb-article .hb-callout--cta a { color: #ffd96b !important; }
.hb-ingest-v1 .hb-article .hb-callout__cta {
  margin: 0 !important;
  text-align: center;
}
.hb-ingest-v1 .hb-article .hb-callout__button {
  display: inline-block !important;
  background-color: #f0b90b !important;
  color: #2A5772 !important;
  padding: 0.85rem 2.4rem !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.hb-ingest-v1 .hb-article .hb-callout__button:hover {
  background-color: #ffd24a !important;
  color: #1a3a4f !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* ========================================
 * Byline（執筆/編集/監修）
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-byline {
  margin: 0 0 1.75rem !important;
  padding: 1rem 0 !important;
  border-top: 1px solid #e6e1d4 !important;
  border-bottom: 1px solid #e6e1d4 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.85rem 1.75rem;
  align-items: center;
}
.hb-ingest-v1 .hb-article .hb-byline-writer,
.hb-ingest-v1 .hb-article .hb-byline-editor,
.hb-ingest-v1 .hb-article .hb-byline-reviewer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
}
.hb-ingest-v1 .hb-article .hb-byline-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.hb-ingest-v1 .hb-article .hb-byline-label {
  font-size: 0.66rem;
  color: #8a7a4a;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.hb-ingest-v1 .hb-article .hb-byline-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a1a;
}
.hb-ingest-v1 .hb-article .hb-byline-role {
  font-size: 0.78rem;
  color: #6a6a6a;
}
.hb-ingest-v1 .hb-article .hb-byline-reviewer {
  background: #f0f5fa;
  padding: 0.4rem 0.85rem;
  border-radius: 3px;
  border: 1px solid #d6e3ee;
}
.hb-ingest-v1 .hb-article .hb-byline-badge {
  background: #4a7c9a;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.hb-ingest-v1 .hb-article .hb-byline-credentials {
  font-size: 0.72rem;
  color: #888;
  margin-left: 0.3rem;
}

/* ========================================
 * 文中インライン関連記事 — editorial inline list
 * （AI生成 card grid を辞めて、Bloomberg / Economist 流の inline reference に統一）
 *
 * 設計意図:
 *   - 文中に「→ 関連: タイトル」を控えめに置くだけ。サムネイル・カードは持たない
 *   - 記事のタイポグラフィ流れを邪魔しない（AI 風の浮いた card にならない）
 *   - サムネイル付きカードは記事末尾の「あわせて読みたい」ブロック専用に格下げ
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-related-articles {
  margin: 1.75rem 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-left: 3px solid #d8d2c5 !important;
  padding-left: 1rem !important;
  border-radius: 0 !important;
}
.hb-ingest-v1 .hb-article .hb-related-articles__label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #8a7a4a;
  letter-spacing: 0.16em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
  font-family: "JetBrains Mono", "SF Mono", monospace;
}
.hb-ingest-v1 .hb-article .hb-related-articles__list {
  display: flex !important;
  flex-direction: column;
  gap: 0.45rem;
  grid-template-columns: none !important;
}

/* 4+ 件: 横スクロール chip 形式（PC/モバイル共通でこの ruleset が当たる） */
.hb-ingest-v1 .hb-article .hb-related-articles--4 .hb-related-articles__list,
.hb-ingest-v1 .hb-article .hb-related-articles--5 .hb-related-articles__list,
.hb-ingest-v1 .hb-article .hb-related-articles--6 .hb-related-articles__list,
.hb-ingest-v1 .hb-article .hb-related-articles--7 .hb-related-articles__list,
.hb-ingest-v1 .hb-article .hb-related-articles--8 .hb-related-articles__list {
  flex-direction: row !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  gap: 0.85rem;
  padding-bottom: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: #b8a98a transparent;
}
.hb-ingest-v1 .hb-article .hb-related-articles--4 .hb-related-articles__list::-webkit-scrollbar,
.hb-ingest-v1 .hb-article .hb-related-articles--5 .hb-related-articles__list::-webkit-scrollbar,
.hb-ingest-v1 .hb-article .hb-related-articles--6 .hb-related-articles__list::-webkit-scrollbar,
.hb-ingest-v1 .hb-article .hb-related-articles--7 .hb-related-articles__list::-webkit-scrollbar,
.hb-ingest-v1 .hb-article .hb-related-articles--8 .hb-related-articles__list::-webkit-scrollbar {
  height: 6px;
}
.hb-ingest-v1 .hb-article .hb-related-articles--4 .hb-related-articles__list::-webkit-scrollbar-thumb,
.hb-ingest-v1 .hb-article .hb-related-articles--5 .hb-related-articles__list::-webkit-scrollbar-thumb,
.hb-ingest-v1 .hb-article .hb-related-articles--6 .hb-related-articles__list::-webkit-scrollbar-thumb,
.hb-ingest-v1 .hb-article .hb-related-articles--7 .hb-related-articles__list::-webkit-scrollbar-thumb,
.hb-ingest-v1 .hb-article .hb-related-articles--8 .hb-related-articles__list::-webkit-scrollbar-thumb {
  background-color: #b8a98a;
  border-radius: 3px;
}
/* 4+ 件モード: 各 link を chip 化（min/max-width で固定 → 横並びでスクロール） */
.hb-ingest-v1 .hb-article .hb-related-articles--4 .hb-related-card,
.hb-ingest-v1 .hb-article .hb-related-articles--5 .hb-related-card,
.hb-ingest-v1 .hb-article .hb-related-articles--6 .hb-related-card,
.hb-ingest-v1 .hb-article .hb-related-articles--7 .hb-related-card,
.hb-ingest-v1 .hb-article .hb-related-articles--8 .hb-related-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 18rem !important;
  max-width: 70vw;
  padding: 0.55rem 0.8rem !important;
  border-left: 2px solid #d8d2c5 !important;
}
.hb-ingest-v1 .hb-article .hb-related-articles--4 .hb-related-card .hb-related-card__title,
.hb-ingest-v1 .hb-article .hb-related-articles--5 .hb-related-card .hb-related-card__title,
.hb-ingest-v1 .hb-article .hb-related-articles--6 .hb-related-card .hb-related-card__title,
.hb-ingest-v1 .hb-article .hb-related-articles--7 .hb-related-card .hb-related-card__title,
.hb-ingest-v1 .hb-article .hb-related-articles--8 .hb-related-card .hb-related-card__title {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 0.86rem !important;
  line-height: 1.5 !important;
}

/* card → 1行リンク（thumbnail / excerpt は CSS で隠す） */
.hb-ingest-v1 .hb-article .hb-related-card {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  padding: 0.15rem 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  text-decoration: none !important;
  color: #2c2c2c !important;
  transition: color 0.15s !important;
  box-shadow: none !important;
  transform: none !important;
}
.hb-ingest-v1 .hb-article .hb-related-card:hover {
  color: #2a5772 !important;
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
.hb-ingest-v1 .hb-article .hb-related-card:hover .hb-related-card__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hb-ingest-v1 .hb-article .hb-related-card__thumb {
  display: none !important;
}
.hb-ingest-v1 .hb-article .hb-related-card__excerpt {
  display: none !important;
}
.hb-ingest-v1 .hb-article .hb-related-card__body {
  display: block !important;
  min-width: 0;
}
.hb-ingest-v1 .hb-article .hb-related-card__label {
  display: none !important;
}
.hb-ingest-v1 .hb-article .hb-related-card__title {
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
  color: #2c2c2c !important;
  letter-spacing: 0.02em !important;
  margin: 0 !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  overflow: visible !important;
}
.hb-ingest-v1 .hb-article .hb-related-card__title::before {
  content: "→ ";
  color: #b8a98a;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-weight: 400;
  margin-right: 0.3em;
}

/* ========================================
 * 参考文献
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-references {
  margin: 3rem 0 0 !important;
  padding: 1.5rem 0 0 !important;
  border-top: 2px solid #d8d2c5 !important;
}
.hb-ingest-v1 .hb-article .hb-references__heading {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  border: none !important;
  letter-spacing: 0.04em;
}
.hb-ingest-v1 .hb-article .hb-references__list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.hb-ingest-v1 .hb-article .hb-references__list li {
  position: relative;
  padding-left: 2.5rem !important;
  margin-bottom: 0.85rem !important;
  font-size: 0.85rem !important;
  line-height: 1.65 !important;
  color: #4a4a4a !important;
}
.hb-ingest-v1 .hb-article .hb-references__list li::marker { content: none !important; }
.hb-ingest-v1 .hb-article .hb-ref-num {
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-weight: 700;
  color: #8a7a4a;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
}
.hb-ingest-v1 .hb-article .hb-ref-publisher,
.hb-ingest-v1 .hb-article .hb-ref-accessed {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.15rem;
}
.hb-ingest-v1 .hb-article .hb-references__list a {
  color: #2a5772 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

/* ========================================
 * 連載シリーズ目次（記事冒頭・自動挿入）
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-series-toc {
  margin: 0 0 2.25rem !important;
  padding: 1.4rem 1.6rem !important;
  background: #faf8f0 !important;
  border: 1px solid #e6e1d4 !important;
  border-left: 4px solid #b8a98a !important;
  border-radius: 0 6px 6px 0;
}
.hb-ingest-v1 .hb-article .hb-series-toc__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #e6e1d4;
}
.hb-ingest-v1 .hb-article .hb-series-toc__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.04em;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
.hb-ingest-v1 .hb-article .hb-series-toc__progress {
  font-size: 0.7rem;
  color: #8a7a4a;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  white-space: nowrap;
}
.hb-ingest-v1 .hb-article .hb-series-toc__list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item {
  margin-bottom: 0.35rem !important;
  padding: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.55 !important;
  letter-spacing: 0.02em !important;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item:last-child {
  margin-bottom: 0 !important;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item::marker {
  content: none !important;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item a {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: #2c2c2c !important;
  text-decoration: none !important;
  padding: 0.45rem 0.65rem;
  border-radius: 3px;
  transition: background 0.18s, color 0.18s;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item a:hover {
  background: #fff;
  color: #2a5772 !important;
}
.hb-ingest-v1 .hb-article .hb-series-toc__vol {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a7a4a;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 3.4em;
}
.hb-ingest-v1 .hb-article .hb-series-toc__title {
  flex-grow: 1;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item--current {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  background: #2A5772;
  color: #fff;
  border-radius: 3px;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item--current .hb-series-toc__vol {
  color: #ffd96b;
}
.hb-ingest-v1 .hb-article .hb-series-toc__item--current .hb-series-toc__title {
  color: #fff;
  font-weight: 600;
}
.hb-ingest-v1 .hb-article .hb-series-toc__badge {
  background: #f0b90b;
  color: #2A5772;
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  font-weight: 700;
  flex-shrink: 0;
  align-self: center;
}

/* ========================================
 * 連載シリーズ前後ナビゲーション（記事末尾・自動挿入）
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-series-nav {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.5rem 0 0 !important;
  padding: 1.5rem 0 0 !important;
  border-top: 1px solid #e6e1d4 !important;
}
.hb-ingest-v1 .hb-article .hb-series-nav__prev,
.hb-ingest-v1 .hb-article .hb-series-nav__next {
  display: flex !important;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.2rem;
  background: #faf8f0;
  border: 1px solid #e6e1d4;
  border-radius: 4px;
  text-decoration: none !important;
  color: #2c2c2c !important;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.hb-ingest-v1 .hb-article .hb-series-nav__next {
  text-align: right;
}
.hb-ingest-v1 .hb-article .hb-series-nav__prev:hover,
.hb-ingest-v1 .hb-article .hb-series-nav__next:hover {
  border-color: #b8a98a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.hb-ingest-v1 .hb-article .hb-series-nav__direction {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a7a4a;
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", "SF Mono", monospace;
}
.hb-ingest-v1 .hb-article .hb-series-nav__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.45;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hb-ingest-v1 .hb-article .hb-series-nav__placeholder {
  /* 空セル（前 or 後ろが無い場合のグリッド埋め）*/
}

/* ========================================
 * モバイル（≤768px）
 * ======================================== */
@media (max-width: 768px) {
  .hb-ingest-v1 .hb-article p {
    font-size: 15.5px !important;
    line-height: 1.85 !important;
    margin-bottom: 1.4rem !important;
  }
  .hb-ingest-v1 .hb-article h2.wp-block-heading {
    font-size: 1.3rem !important;
    margin: 2.5rem 0 1rem !important;
    padding-bottom: 0.5rem !important;
  }
  .hb-ingest-v1 .hb-article h3.wp-block-heading {
    font-size: 1.1rem !important;
    margin: 2rem 0 0.75rem !important;
  }
  .hb-ingest-v1 .hb-article h4.wp-block-heading {
    font-size: 1rem !important;
  }
  .hb-ingest-v1 .hb-article ul.wp-block-list,
  .hb-ingest-v1 .hb-article ol.wp-block-list {
    padding-left: 1.4em !important;
  }

  /* 関連記事 (モバイル) — editorial inline list はそのまま、件数 4+ は横スクロール継続 */
  .hb-ingest-v1 .hb-article .hb-related-articles {
    padding: 0 0 0 0.85rem !important;
    margin: 1.5rem 0 !important;
  }

  /* モバイルでは「タイトルが枠をはみ出す」可能性を考慮し、すべての件数で
     横スクロールに切り替える。指で swipe して読みやすくする運用方針。 */
  .hb-ingest-v1 .hb-article .hb-related-articles__list {
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 0.65rem;
    padding-bottom: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: #b8a98a transparent;
    /* 記事左右 padding を突き抜けて画面端までスクロール領域を広げる */
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hb-ingest-v1 .hb-article .hb-related-articles__list::-webkit-scrollbar {
    height: 5px;
  }
  .hb-ingest-v1 .hb-article .hb-related-articles__list::-webkit-scrollbar-thumb {
    background-color: #b8a98a;
    border-radius: 3px;
  }
  .hb-ingest-v1 .hb-article .hb-related-card {
    flex: 0 0 auto !important;
    scroll-snap-align: start;
    width: 75vw !important;
    min-width: 16rem !important;
    max-width: 22rem !important;
    padding: 0.5rem 0.7rem !important;
    border-left: 2px solid #d8d2c5 !important;
  }
  .hb-ingest-v1 .hb-article .hb-related-card .hb-related-card__title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }
  .hb-ingest-v1 .hb-article .hb-related-card__title { font-size: 0.85rem; }
  .hb-ingest-v1 .hb-article .hb-related-card__excerpt { font-size: 0.72rem; -webkit-line-clamp: 2; }

  /* CTA */
  .hb-ingest-v1 .hb-article .hb-callout--cta {
    padding: 1.5rem 1.2rem 1.3rem !important;
    margin: 2rem 0 !important;
    border-radius: 6px !important;
  }
  .hb-ingest-v1 .hb-article .hb-callout--cta .hb-callout__title { font-size: 1.1rem !important; }
  .hb-ingest-v1 .hb-article .hb-callout--cta p { font-size: 0.9rem !important; }
  .hb-ingest-v1 .hb-article .hb-callout__button {
    padding: 0.7rem 1.5rem !important;
    font-size: 0.88rem !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Callout 余白 */
  .hb-ingest-v1 .hb-article .hb-callout {
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
  }

  /* Byline モバイル */
  .hb-ingest-v1 .hb-article .hb-byline {
    gap: 0.7rem 1.2rem;
    padding: 0.85rem 0 !important;
  }
  .hb-ingest-v1 .hb-article .hb-byline-name { font-size: 0.88rem; }
  .hb-ingest-v1 .hb-article .hb-byline-role { font-size: 0.74rem; }

  /* 参考文献 */
  .hb-ingest-v1 .hb-article .hb-references__list li {
    padding-left: 2.1rem !important;
    font-size: 0.82rem !important;
  }
  .hb-ingest-v1 .hb-article .hb-references__heading { font-size: 1rem !important; }

  /* テーブル — モバイルで横スクロール時に内容が読みやすく */
  .hb-ingest-v1 .hb-article figure.wp-block-table th,
  .hb-ingest-v1 .hb-article figure.wp-block-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Image 余白圧縮 */
  .hb-ingest-v1 .hb-article figure.wp-block-image { margin: 1.75rem 0 !important; }
  .hb-ingest-v1 .hb-article figure.wp-block-image figcaption { font-size: 0.78rem; padding: 0 0.5rem; }

  /* 連載シリーズ目次 — モバイルでは padding 縮小・フォントサイズ調整 */
  .hb-ingest-v1 .hb-article .hb-series-toc {
    padding: 1.1rem 1.1rem !important;
    margin: 0 0 1.75rem !important;
  }
  .hb-ingest-v1 .hb-article .hb-series-toc__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .hb-ingest-v1 .hb-article .hb-series-toc__name { font-size: 0.88rem !important; }
  .hb-ingest-v1 .hb-article .hb-series-toc__progress { font-size: 0.65rem !important; }
  .hb-ingest-v1 .hb-article .hb-series-toc__item { font-size: 0.82rem !important; }
  .hb-ingest-v1 .hb-article .hb-series-toc__vol { font-size: 0.72rem !important; min-width: 3em; }
  .hb-ingest-v1 .hb-article .hb-series-toc__badge { font-size: 0.6rem; padding: 0.15rem 0.4rem; }

  /* 連載前後ナビ — モバイルでは縦並び */
  .hb-ingest-v1 .hb-article .hb-series-nav {
    grid-template-columns: 1fr !important;
    gap: 0.6rem;
  }
  .hb-ingest-v1 .hb-article .hb-series-nav__next {
    text-align: left;
  }
  .hb-ingest-v1 .hb-article .hb-series-nav__prev,
  .hb-ingest-v1 .hb-article .hb-series-nav__next {
    padding: 0.85rem 1rem;
  }

  /* スマホ統一: .hb-article は左右 padding 10px・本文文字サイズ 12px に固定。
     .hb-ingest-v1 ラッパの有無に関わらず適用するため両パターンで明示。
     既存の ".hb-ingest-v1 .hb-article p { font-size:16px !important }" を上書きするため
     html prefix を加えて specificity を一段上げる */
  html article.hb-article,
  html .hb-article,
  html .hb-ingest-v1 .hb-article,
  html body .hb-article {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 12px !important;
    line-height: 1.75 !important;
  }
  html .hb-article p,
  html .hb-article li,
  html .hb-article td,
  html .hb-article th,
  html .hb-article a,
  html .hb-article span,
  html .hb-article strong,
  html .hb-article em,
  html .hb-ingest-v1 .hb-article p,
  html .hb-ingest-v1 .hb-article li,
  html .hb-ingest-v1 .hb-article td,
  html .hb-ingest-v1 .hb-article th,
  html .hb-ingest-v1 .hb-article a,
  html .hb-ingest-v1 .hb-article span,
  html .hb-ingest-v1 .hb-article strong,
  html .hb-ingest-v1 .hb-article em {
    font-size: 12px !important;
  }
}

/* ========================================
 * code block (multi-line code, JSON ingest type=code)
 * ======================================== */
.hb-ingest-v1 .hb-article .hb-code {
  margin: 28px 0;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  font-family: "JetBrains Mono", "Source Code Pro", "Menlo", "Consolas", monospace;
  border: 1px solid #d8d2c5;
}

.hb-ingest-v1 .hb-article .hb-code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hb-ingest-v1 .hb-article .hb-code-lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "JetBrains Mono", monospace;
}

.hb-ingest-v1 .hb-article .hb-code-filename {
  font-style: italic;
  opacity: 0.7;
  margin-left: auto;
}

.hb-ingest-v1 .hb-article .hb-code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre;
  -webkit-font-smoothing: antialiased;
  tab-size: 2;
}

.hb-ingest-v1 .hb-article .hb-code pre code {
  font-family: inherit;
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  font-size: inherit;
  white-space: inherit;
}

.hb-ingest-v1 .hb-article .hb-code-caption {
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-style: italic;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
}

/* ----- dark theme (default) ----- */
.hb-ingest-v1 .hb-article .hb-code-theme-dark {
  background: #1a1d23;
  color: #e6e1d8;
  border-color: #1a1d23;
}
.hb-ingest-v1 .hb-article .hb-code-theme-dark .hb-code-header {
  background: #14161b;
  color: #c0bbb1;
}
.hb-ingest-v1 .hb-article .hb-code-theme-dark .hb-code-lang {
  color: #c9a85d;  /* gold accent */
}
.hb-ingest-v1 .hb-article .hb-code-theme-dark .hb-code-caption {
  background: #14161b;
  color: #c0bbb1;
}

/* ----- light theme ----- */
.hb-ingest-v1 .hb-article .hb-code-theme-light {
  background: #f5f4ed;
  color: #1a1a1a;
  border-color: #d8d2c5;
}
.hb-ingest-v1 .hb-article .hb-code-theme-light .hb-code-header {
  background: #ebe7dc;
  color: #555;
  border-bottom-color: #d8d2c5;
}
.hb-ingest-v1 .hb-article .hb-code-theme-light .hb-code-lang {
  color: #A0241F;  /* signature red */
}
.hb-ingest-v1 .hb-article .hb-code-theme-light .hb-code-caption {
  background: #ebe7dc;
  color: #555;
  border-top-color: #d8d2c5;
}

@media (max-width: 640px) {
  .hb-ingest-v1 .hb-article .hb-code {
    margin: 18px -10px;  /* モバイルでは画面端まで寄せる */
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .hb-ingest-v1 .hb-article .hb-code pre {
    padding: 12px 14px;
    font-size: 12.5px;
  }
  .hb-ingest-v1 .hb-article .hb-code-header {
    padding: 6px 12px;
    font-size: 10px;
  }
}

/* ----- Prism.js token colors (custom theme, scoped to .hb-code) -----
   Prism は自動で <code class="language-XXX"> 内に <span class="token TYPE"> を挿入する。
   token の色だけを theme に揃えて指定し、編集マガジン風に控えめなカラーパレット。 */

/* dark theme — One Dark inspired */
.hb-ingest-v1 .hb-code-theme-dark .token.comment,
.hb-ingest-v1 .hb-code-theme-dark .token.prolog,
.hb-ingest-v1 .hb-code-theme-dark .token.doctype,
.hb-ingest-v1 .hb-code-theme-dark .token.cdata { color: #6c7283; font-style: italic; }
.hb-ingest-v1 .hb-code-theme-dark .token.punctuation { color: #abb2bf; }
.hb-ingest-v1 .hb-code-theme-dark .token.property,
.hb-ingest-v1 .hb-code-theme-dark .token.tag,
.hb-ingest-v1 .hb-code-theme-dark .token.boolean,
.hb-ingest-v1 .hb-code-theme-dark .token.number,
.hb-ingest-v1 .hb-code-theme-dark .token.constant,
.hb-ingest-v1 .hb-code-theme-dark .token.symbol,
.hb-ingest-v1 .hb-code-theme-dark .token.deleted { color: #d19a66; }
.hb-ingest-v1 .hb-code-theme-dark .token.selector,
.hb-ingest-v1 .hb-code-theme-dark .token.attr-name,
.hb-ingest-v1 .hb-code-theme-dark .token.string,
.hb-ingest-v1 .hb-code-theme-dark .token.char,
.hb-ingest-v1 .hb-code-theme-dark .token.builtin,
.hb-ingest-v1 .hb-code-theme-dark .token.inserted { color: #98c379; }
.hb-ingest-v1 .hb-code-theme-dark .token.operator,
.hb-ingest-v1 .hb-code-theme-dark .token.entity,
.hb-ingest-v1 .hb-code-theme-dark .token.url,
.hb-ingest-v1 .hb-code-theme-dark .token.variable { color: #56b6c2; }
.hb-ingest-v1 .hb-code-theme-dark .token.atrule,
.hb-ingest-v1 .hb-code-theme-dark .token.attr-value,
.hb-ingest-v1 .hb-code-theme-dark .token.function,
.hb-ingest-v1 .hb-code-theme-dark .token.class-name { color: #61afef; }
.hb-ingest-v1 .hb-code-theme-dark .token.keyword { color: #c678dd; font-weight: 500; }
.hb-ingest-v1 .hb-code-theme-dark .token.regex,
.hb-ingest-v1 .hb-code-theme-dark .token.important { color: #e06c75; }

/* light theme — GitHub Light inspired */
.hb-ingest-v1 .hb-code-theme-light .token.comment,
.hb-ingest-v1 .hb-code-theme-light .token.prolog,
.hb-ingest-v1 .hb-code-theme-light .token.doctype,
.hb-ingest-v1 .hb-code-theme-light .token.cdata { color: #6a737d; font-style: italic; }
.hb-ingest-v1 .hb-code-theme-light .token.punctuation { color: #24292e; }
.hb-ingest-v1 .hb-code-theme-light .token.property,
.hb-ingest-v1 .hb-code-theme-light .token.tag,
.hb-ingest-v1 .hb-code-theme-light .token.boolean,
.hb-ingest-v1 .hb-code-theme-light .token.number,
.hb-ingest-v1 .hb-code-theme-light .token.constant,
.hb-ingest-v1 .hb-code-theme-light .token.symbol,
.hb-ingest-v1 .hb-code-theme-light .token.deleted { color: #005cc5; }
.hb-ingest-v1 .hb-code-theme-light .token.selector,
.hb-ingest-v1 .hb-code-theme-light .token.attr-name,
.hb-ingest-v1 .hb-code-theme-light .token.string,
.hb-ingest-v1 .hb-code-theme-light .token.char,
.hb-ingest-v1 .hb-code-theme-light .token.builtin,
.hb-ingest-v1 .hb-code-theme-light .token.inserted { color: #032f62; }
.hb-ingest-v1 .hb-code-theme-light .token.operator,
.hb-ingest-v1 .hb-code-theme-light .token.entity,
.hb-ingest-v1 .hb-code-theme-light .token.url,
.hb-ingest-v1 .hb-code-theme-light .token.variable { color: #d73a49; }
.hb-ingest-v1 .hb-code-theme-light .token.atrule,
.hb-ingest-v1 .hb-code-theme-light .token.attr-value,
.hb-ingest-v1 .hb-code-theme-light .token.function,
.hb-ingest-v1 .hb-code-theme-light .token.class-name { color: #6f42c1; }
.hb-ingest-v1 .hb-code-theme-light .token.keyword { color: #d73a49; font-weight: 600; }
.hb-ingest-v1 .hb-code-theme-light .token.regex,
.hb-ingest-v1 .hb-code-theme-light .token.important { color: #b31d28; }
