/* Responsive: yes */
/* ---------- Google Fonts ---------- */
/* NOTE: @import を廃止。以下を はてなブログ管理画面 > 設定 > 詳細設定 > headに要素を追加 に記述:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap" media="print" onload="this.media='all'">
   ↑ media="print" + onload でレンダリングブロッキングを回避（4秒短縮見込み）
*/

/* ==========================================================================
   AIリスキルLab — はてなブログ カスタムCSS
   Theme: Boilerplate（テンプレートCSS依存なし）
   Design: ナチュラル系アースカラー + UDフォント
   Max Width: 1100px（メイン 740px + サイドバー 280px + gap 48px）
   ========================================================================== */

:root {
  /* --- カラー: プライマリ --- */
  --color-primary:        #5B7553;
  --color-primary-light:  #7A9A6E;
  --color-primary-pale:   #E8EFE6;

  /* --- カラー: テキスト --- */
  --color-text:           #3C3C3C;
  --color-text-light:     #6B6B6B;
  --color-text-muted:     #9B9B9B;

  /* --- カラー: 背景 --- */
  --color-bg:             #FAF8F5;
  --color-bg-card:        #FFFFFF;
  --color-bg-accent:      #F5F0EB;

  /* --- カラー: ボーダー --- */
  --color-border:         #E5DED5;
  --color-border-light:   #F0EBE4;

  /* --- カラー: アクセント（CTA・重要要素） --- */
  --color-accent:         #e8a87c;
  --color-accent-dark:    #d4915f;
  --color-accent-light:   #f5d4b8;
  --color-bg-accent-warm: #fdf8f3;

  /* --- カラー: ヘッダー --- */
  --color-header-bg:      #3D3629;
  --color-header-text:    #FAF8F5;
  --color-header-text-dim: rgba(250, 248, 245, 0.6);
  --color-header-accent:  #C4A96A;

  /* --- フォント --- */
  --font-body: "BIZ UDPGothic", "Noto Sans JP", "Hiragino Kaku Gothic ProN",
               "メイリオ", Meiryo, sans-serif;
  --font-heading: "BIZ UDPGothic", "Noto Sans JP", "Hiragino Kaku Gothic ProN",
                  sans-serif;
  --font-mono: "BIZ UDGothic", "SFMono-Regular", Consolas, "Liberation Mono",
               Menlo, "Courier New", monospace;

  /* --- タイポグラフィ --- */
  --font-size-base:        16px;
  --font-size-small:       14px;
  --font-size-xs:          12px;
  --line-height-body:      1.85;
  --line-height-heading:   1.4;
  --letter-spacing-body:   0.04em;
  --letter-spacing-heading: 0.02em;

  /* --- スペーシング --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------- 0. リセット・ボックスモデル ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ---------- 1. 全体・基調 ---------- */

body {
  margin: 0;
  background: var(--color-bg);
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- 2. レイアウト ---------- */

#container {
  width: 100%;
}

#content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

#content-inner {
  display: flex;
  gap: 48px;
  padding: 32px 0;
}

#main {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

#box2 {
  width: 280px;
  flex-shrink: 0;
  font-size: 0.9em;
}

/* ---------- 3. ヘッダー ---------- */

#blog-title {
  background: var(--color-header-bg);
  padding: 0;
  margin: 0;
}

#blog-title-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 10px;
  border-bottom: 3px solid var(--color-header-accent);
}

/* PC H1: PCヘッダー圧縮 — ファーストビュー有効面積拡大 */
@media (min-width: 769px) {
  #blog-title {
    padding-top: 0 !important;
  }

  #blog-title-inner {
    padding: 12px 20px 8px;
  }

  #title a {
    font-size: 1.5em;
  }

  #blog-description {
    font-size: 0.85em;
    margin-top: 2px;
    padding-bottom: 6px;
    color: rgba(250, 248, 245, 0.7);
  }
}

#blog-title-content {
  text-align: left;
}

#title {
  margin: 0;
}

#title a {
  color: var(--color-header-text);
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: var(--letter-spacing-heading);
  text-decoration: none;
}

#title a:hover {
  text-decoration: none;
  opacity: 0.9;
}

#blog-description {
  color: var(--color-header-text-dim);
  font-size: 0.8em;
  margin-top: 4px;
  padding-bottom: 8px;
  letter-spacing: 0.06em;
}

/* ---------- 3.5. グローバルナビゲーション ---------- */
/* HTML: はてなブログ管理画面「デザイン」>「カスタマイズ」>「ヘッダ（タイトル下）」に追加 */
/*
  <nav class="reskill-nav">
    <a href="/">ホーム</a>
    <a href="/archive/category/roadmap">学習ロードマップ</a>
    <a href="/archive/category/certification">AI資格ガイド</a>
    <a href="/archive/category/career">キャリア戦略</a>
  </nav>
*/

/* PC H-2: スティッキーナビ — スクロール時もカテゴリアクセスを維持 */
.reskill-nav {
  background: var(--color-header-bg);
  padding: 0;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 37px; /* はてなグローバルヘッダーの高さ分 */
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* PC M-2: ナビリンク視認性・hoverフィードバック強化 */
.reskill-nav a {
  color: rgba(250, 248, 245, 0.75);
  text-decoration: none;
  padding: 12px 24px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  position: relative;
}

.reskill-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

.reskill-nav a.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 3.8. はてなキーワードリンク ---------- */

a.keyword {
  text-decoration: none;
  border-bottom: 1px dotted var(--color-border);
  color: inherit;
  transition: border-color 0.2s ease;
}

a.keyword:hover {
  border-bottom-color: var(--color-text-muted);
  text-decoration: none;
  color: inherit;
}

/* 意図的な内部リンク */
.entry-content a[href*="reskilling-japan.com/entry/"] {
  color: var(--color-accent-dark);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-light);
}

.entry-content a[href*="reskilling-japan.com/entry/"]:hover {
  color: var(--color-accent);
  border-bottom-width: 2px;
  text-decoration: none;
}

/* /entry/ パスへの内部リンク強調 */
.entry-content a[href*="/entry/"] {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(91, 117, 83, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.entry-content a[href*="/entry/"]:hover {
  text-decoration-color: var(--color-primary);
}

/* PC M4: 内部記事リンクに矢印アイコンで差別化 */
.entry-content a[href*="/entry/"]::after {
  content: " \2192";
  font-size: 0.85em;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.entry-content a[href*="/entry/"]:hover::after {
  opacity: 1;
}

/* TOC・関連記事・サイドバーには矢印を適用しない */
.table-of-contents a[href*="/entry/"]::after,
.related-entries a[href*="/entry/"]::after,
.hatena-module a[href*="/entry/"]::after {
  content: none;
}

/* ---------- 3.9. 編集ボタン ---------- */

.entry-header-menu {
  position: absolute;
  top: 0;
  right: 0;
}

/* ---------- 4. パンくずリスト ---------- */

.breadcrumb {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  border: none;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ---------- 4.5. パンくず下の余白最適化 (PC M-1: FV改善) ---------- */

#top-box {
  font-size: 13px;
  padding: 8px 0;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

#top-box a {
  color: var(--color-text-muted);
}

/* ---------- 5. 記事タイトル ---------- */

/* PC M-1: 記事エリア上部の余白圧縮 */
.entry-header {
  margin-bottom: 24px;
  padding-top: 20px;
}

.entry-header .entry-title {
  font-size: 1.75em;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0 0 8px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.entry-header .entry-title a {
  color: var(--color-text);
  text-decoration: none;
}

.entry-header .entry-title a:hover {
  color: var(--color-accent-dark);
  text-decoration: none;
}

/* 日付 */
.date {
  margin-bottom: 8px;
}

.date a {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

/* カテゴリタグ (PC M-2: コンパクト化 + 表示制限) */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
}

.categories a {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-text-light);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.categories a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(91, 117, 83, 0.05);
  text-decoration: none;
}

/* PC M-2: 5個目以降を非表示にする（タグの視覚ノイズ軽減） */
.categories a:nth-child(n+6) {
  display: none;
}

/* ---------- 5.5. H1重複非表示 (SP H-1: entry-content内の最初のH1を非表示) ---------- */
/* 記事タイトルは entry-header で表示済み。本文先頭のH1は冗長。 */
/* 全記事ページに一括適用。ファーストビュー有効面積が約200px改善。 */
.entry-content > h1:first-of-type {
  display: none;
}

/* ---------- 6. 記事本文 ---------- */

.entry-content {
  font-size: 16px;
}

/* 6.0.1 コンテンツ内リンクの視認性向上 (PC H-1) */
.entry-content a:not(.keyword):not(.aff-card):not(.aff-banner a) {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(91, 117, 83, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.entry-content a:not(.keyword):not(.aff-card):not(.aff-banner a):hover {
  text-decoration-color: var(--color-primary);
}

/* 見出し (PC M-1: 視覚的階層強化) */
.entry-content h2 {
  border-left: 5px solid var(--color-primary);
  border-bottom: none;
  background: var(--color-bg-accent);
  padding: 14px 18px;
  margin: 56px 0 28px;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--line-height-heading);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content h3 {
  border-bottom: 2px solid var(--color-primary-pale);
  padding-bottom: 6px;
  margin: 40px 0 16px;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--color-header-bg);
}

.entry-content h4 {
  margin: 28px 0 12px;
  font-size: 1.05em;
  font-weight: 700;
  color: var(--color-primary);
  padding-left: 1em;
  position: relative;
}

.entry-content h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

/* 強調: マーカー風アンダーライン */
.entry-content strong,
.entry-content b {
  font-weight: inherit;
  background: linear-gradient(transparent 60%, var(--color-primary-pale) 60%);
  padding: 0 2px;
}

/* 段落 — 最大行長制限で可読性向上 (PC 4-4) */
.entry-content p {
  margin: 0 0 20px;
  line-height: 1.9;
  max-width: 660px;
}

/* リスト — 最大行長制限で可読性向上 (PC 4-4) */
.entry-content ul,
.entry-content ol {
  margin: 0 0 24px;
  padding-left: 1.5em;
  line-height: 1.9;
  max-width: 660px;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content ul > li::marker {
  color: var(--color-primary);
}

.entry-content ol > li::marker {
  color: var(--color-primary);
  font-weight: 700;
}

/* コードブロック */
.entry-content code {
  background: var(--color-bg-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text);
}

.entry-content pre {
  background: var(--color-header-bg);
  color: #e8e8e8;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 24px;
  line-height: 1.6;
}

.entry-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 0.85em;
}

/* 引用 */
.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-accent);
  margin: 0 0 24px;
  padding: 16px 20px;
  color: var(--color-text-light);
  font-style: normal;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* テーブル */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 0.95em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* PC M-3: テーブル可読性改善 (padding増加) */
.entry-content thead th {
  background: var(--color-header-bg);
  color: var(--color-bg-card);
  padding: 12px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 0.9em;
  letter-spacing: 0.03em;
}

.entry-content tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border-light);
}

.entry-content tbody tr:nth-child(even) {
  background: var(--color-bg-accent);
}

.entry-content tbody tr:hover td {
  background: var(--color-bg-accent-warm);
}

.entry-content tbody tr:last-child td {
  border-bottom: none;
}

/* アフィリエイトまとめテーブル */
.affiliate-summary table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
}

.affiliate-summary thead th {
  background: var(--color-header-bg);
  color: var(--color-bg-card);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
}

.affiliate-summary tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.affiliate-summary tbody tr:nth-child(even) {
  background: var(--color-bg-accent);
}

/* 画像 */
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* SP H-2: point-boxクラス未付与時のフォールバック — H1直後の段落をスタイリング */
/* display:none の要素は DOM に残るため h1 + p セレクタは有効 */
.entry-content > h1:first-of-type + p {
  background: linear-gradient(135deg, var(--color-bg-accent-warm) 0%, #fef5ed 100%);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 12px 0 24px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

/* 「この記事で分かること」ボックス */
.entry-content .point-box {
  background: linear-gradient(135deg, var(--color-bg-accent-warm) 0%, #fef5ed 100%);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 20px 0 32px;
}

.entry-content .point-box::before {
  content: 'この記事で分かること';
  display: block;
  font-weight: bold;
  font-size: var(--font-size-small);
  color: var(--color-accent-dark);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.entry-content .point-box ul {
  margin: 0;
  padding-left: 20px;
}

.entry-content .point-box li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--color-text);
}

/* pillar記事誘導バナー */
.pillar-banner {
  margin: 0 0 24px;
  background: linear-gradient(135deg, var(--color-header-bg) 0%, #524f4a 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pillar-banner:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.pillar-banner a {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  color: var(--color-header-text);
  text-decoration: none;
  gap: 16px;
}

.pillar-banner a:hover {
  text-decoration: none;
  color: var(--color-header-text);
}

.pillar-banner .pillar-label {
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.pillar-banner .pillar-title {
  flex: 1;
  font-size: 15px;
  font-weight: bold;
  line-height: var(--line-height-heading);
}

.pillar-banner .pillar-cta {
  font-size: var(--font-size-small);
  color: var(--color-accent);
  white-space: nowrap;
  font-weight: bold;
}

/* ---------- 6.1b. pillar誘導CTAバナー (PC H-3) ---------- */

.pillar-cta-banner {
  background: linear-gradient(135deg, #4a5043 0%, #5a6b4e 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 24px 32px;
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-cta-banner h3 {
  font-size: 1.15em;
  margin: 0 0 8px;
  color: #fff;
}

.pillar-cta-banner p {
  font-size: 0.9em;
  opacity: 0.9;
  margin: 0;
}

.pillar-cta-banner .cta-button {
  background: #c8a84e;
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s;
}

.pillar-cta-banner .cta-button:hover {
  background: #b8963e;
}

/* 区切り線 */
.entry-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

/* 目次 (PC H-2: TOCスタイル強化) */
.entry-content .table-of-contents {
  background: var(--color-bg-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 32px;
  margin: 32px 0;
  font-size: 14px;
  line-height: 1.8;
}

.entry-content .table-of-contents::before {
  content: "\3053\306E\8A18\4E8B\306E\5185\5BB9";  /* この記事の内容 */
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
}

.entry-content .table-of-contents li {
  margin: 6px 0;
}

.entry-content .table-of-contents a {
  color: var(--color-primary) !important;
  text-decoration: none !important;
}

.entry-content .table-of-contents a:hover {
  text-decoration: underline !important;
}

.entry-content .table-of-contents ul ul {
  margin-left: 16px;
  font-size: 13px;
}

/* ---------- 6.2. テキスト型CTAボックス (PC H-3) ---------- */

.entry-content .cta-box {
  background: linear-gradient(135deg, var(--color-bg-accent) 0%, var(--color-primary-pale) 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 32px 0;
  text-align: center;
}

.entry-content .cta-box p {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--color-text);
}

.entry-content .cta-box a {
  display: inline-block;
  background: var(--color-primary);
  color: #fff !important;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.1s;
}

.entry-content .cta-box a:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

/* ---------- 6.2.2. 記事末尾CTAボックス (SP M2) ---------- */

.entry-content .cta-bottom {
  margin: 32px 0;
  padding: 24px;
  background: var(--color-primary-pale);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  text-align: center;
}

.entry-content .cta-bottom .cta-heading {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 12px;
}

.entry-content .cta-bottom .cta-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  min-height: 48px;
  line-height: 20px;
  transition: background 0.2s, transform 0.1s;
}

.entry-content .cta-bottom .cta-btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

/* ---------- 6.2.3. 記事内CTAボックス (PC H-3: 記事本文内のアクション誘導) ---------- */

.entry-content .article-cta {
  background: var(--color-bg-accent);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 40px 0;
  text-align: center;
}

.entry-content .article-cta__heading {
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: 8px;
}

.entry-content .article-cta__text {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 16px;
  line-height: 1.7;
}

.entry-content .article-cta__btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff !important;
  font-weight: bold;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: background 0.2s, transform 0.1s;
}

.entry-content .article-cta__btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

/* ---------- 6.3. アフィリエイトカード ---------- */

.aff-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  margin: 24px 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aff-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
  color: var(--color-text);
}

.aff-card__img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.aff-card__img--empty {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: var(--color-bg-accent);
  border-radius: var(--radius-sm);
}

.aff-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.aff-card__name {
  font-weight: 700;
  font-size: 1em;
  line-height: 1.4;
}

.aff-card__cta {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-primary);
  color: var(--color-bg-card);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-small);
  font-weight: 700;
  text-align: center;
  transition: background 0.2s ease;
  width: fit-content;
}

.aff-card:hover .aff-card__cta {
  background: var(--color-primary-light);
}

/* ---------- 6.3b. 書籍アフィリエイトカード ---------- */

.aff-book-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  margin: 24px 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}

.aff-book-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.aff-book-card__cover {
  flex-shrink: 0;
  width: 120px;
}

.aff-book-card__cover img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.aff-book-card__cover--empty {
  width: 120px;
  height: 170px;
  background: var(--color-bg-accent);
  border-radius: 4px;
}

.aff-book-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.aff-book-card__title {
  font-weight: 700;
  font-size: 1em;
  line-height: 1.4;
  color: var(--color-text);
}

.aff-book-card__author {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
}

.aff-book-card__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.aff-book-card__btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-small);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s ease;
}

.aff-book-card__btn:hover {
  opacity: 0.85;
  text-decoration: none;
  color: #fff;
}

.aff-book-card__btn--amazon {
  background: #FF9900;
}

.aff-book-card__btn--rakuten {
  background: #BF0000;
}

/* ---------- 6.4. アフィリエイトバナー ---------- */

/* PC H3: アフィリエイトバナーの表示面積拡大 */
.aff-banner {
  display: block;
  text-align: center;
  margin: 32px auto;
  max-width: 580px;
  padding: 16px;
  background: var(--color-bg);
  border: 2px solid var(--color-primary-pale);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.aff-banner:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(91, 117, 83, 0.15);
  transform: translateY(-1px);
}

.aff-banner img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* PC 4-2: ASPバナーリンクの表示改善（1x1px問題の安全策） */
.entry-content a[href*="accesstrade"] img,
.entry-content a[href*="valuecommerce"] img,
.entry-content a[href*="a8.net"] img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s ease;
}

.entry-content a[href*="accesstrade"] img:hover,
.entry-content a[href*="valuecommerce"] img:hover,
.entry-content a[href*="a8.net"] img:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ---------- 6.5. コメント欄 ---------- */

.comment-box {
  margin: 2em 0;
}

.comment-box .entry-comment {
  padding: 12px 0 12px 60px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.comment-box .entry-comment:first-child {
  border-top: 1px solid var(--color-border);
}

.comment-box .hatena-id-icon {
  position: absolute;
  top: 12px;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.comment-user-name {
  font-weight: 700;
  margin: 0 0 4px;
}

.comment-content {
  font-size: 0.9em;
  color: var(--color-text);
}

.comment-metadata {
  font-size: 0.8em;
  color: var(--color-text-muted);
}

.leave-comment-title {
  padding: 8px 16px;
  font-size: 0.85em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* ---------- 7. 記事フッター ---------- */

.entry-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.entry-footer-section {
  margin-bottom: 12px;
}

/* ソーシャルボタン */
.social-buttons,
.entry-footer-html {
  margin: 16px 0;
}

/* 「記事を書く」ボタン非表示 */
.btn-subscribe {
  display: none;
}

/* ---------- 8. ページャー (PC M-4: カード型に改善) ---------- */

.pager {
  display: flex;
  gap: 16px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
}

.pager .pager-prev,
.pager .pager-next {
  flex: 1;
  padding: 16px 20px;
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: border-color 0.2s, background 0.2s;
}

.pager .pager-prev:hover,
.pager .pager-next:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-pale);
}

.pager a {
  color: var(--color-text) !important;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
  display: block;
}

.pager a:hover {
  text-decoration: none;
}

.pager .pager-prev::before {
  content: "\524D\306E\8A18\4E8B";  /* 前の記事 */
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.pager .pager-next::before {
  content: "\6B21\306E\8A18\4E8B";  /* 次の記事 */
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* ---------- 9. アーカイブ（トップ／カテゴリ一覧）---------- */

.archive-entries {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* 最初の記事を全幅（Featured） */
.archive-entry:first-child {
  grid-column: 1 / -1;
}

.archive-entry:first-child .entry-thumb-link .entry-thumb {
  height: 240px;
}

.archive-entry:first-child .archive-entry-header .entry-title {
  font-size: 1.3em;
}

.archive-entry {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.archive-entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* サムネイルをカード最上部に配置 */
.archive-entry .entry-thumb-link {
  display: block;
  order: -1;
}

.archive-entry .entry-thumb-link .entry-thumb {
  width: 100% !important;
  height: 160px !important;
  float: none !important;
  display: block;
  background-size: cover;
  background-position: center;
  border-radius: 0;
}

.archive-entry-header {
  padding: 16px 16px 8px;
}

.archive-entry-header .date {
  margin-bottom: 4px;
}

.archive-entry-header .entry-title {
  font-size: 1em;
  font-weight: 700;
  line-height: var(--line-height-heading);
  margin: 0;
}

.archive-entry-header .entry-title a {
  color: var(--color-text);
  text-decoration: none;
}

.archive-entry-header .entry-title a:hover {
  color: var(--color-primary);
}

.archive-entry-body {
  padding: 0 16px 16px;
}

/* 本文プレビューを3行に制限 */
.archive-entry-body .entry-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  line-height: 1.7;
  margin: 0;
}

.archive-entry .categories {
  padding: 0 16px 8px;
}

/* PC M1: 記事カード間の視覚的分離強化 + 余白調整 */
.archive-entry + .archive-entry {
  border-top: none;
}

.archive-entry {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* ---------- 9.2. トップページ ピックアップセクション (PC M-4: 初回訪問者の回遊導線) ---------- */

.pickup-section {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
}

.pickup-card {
  flex: 0 0 200px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.pickup-card__img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.pickup-card__body {
  padding: 10px 12px;
}

.pickup-card__category {
  font-size: 10px;
  color: var(--color-primary);
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pickup-card__title {
  font-size: 13px;
  font-weight: bold;
  line-height: 1.5;
  color: var(--color-text);
}

/* PC M-1 (2/21): 記事カード間余白を詰めてスキャナビリティ向上 */
@media (min-width: 769px) {
  .archive-entries {
    gap: 20px;
  }
}

/* ---------- 9.3. カテゴリ説明文エリア (PC M-3, 2/21) ---------- */

.archive-heading {
  margin-bottom: 8px !important;
}

.archive-heading + .archive-entries::before {
  content: "";  /* JSまたはカスタムHTMLで動的に挿入する想定 */
  display: block;
  background: #f8f6f2;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92em;
  color: #666;
  margin-bottom: 24px;
}

/* ---------- 9.5. 関連記事リンク ---------- */

/* 記事末尾の内部リンクリスト */
.entry-content ul li a[href*="/entry/"] {
  display: inline-block;
  padding: 4px 0;
  color: var(--color-accent-dark);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-light);
  transition: all 0.2s ease;
}

.entry-content ul li a[href*="/entry/"]:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* はてな自動生成の関連記事 */
.related-entries-header {
  font-size: 1.05em;
  font-weight: bold;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

/* はてな関連記事のホバーエフェクト */
.related-entries .related-entries-title {
  font-size: 18px;
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.related-entries .related-entry {
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.related-entries .related-entry:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---------- 10. サイドバー ---------- */

.hatena-module {
  margin-bottom: 24px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.hatena-module-title {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 8px;
  margin: 0 0 16px;
}

.hatena-module-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hatena-module-body li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.hatena-module-body li:last-child {
  border-bottom: none;
}

.hatena-module-body li a {
  color: var(--color-text);
  font-size: var(--font-size-small);
  line-height: 1.5;
  transition: color 0.2s, padding-left 0.2s;
  text-decoration: none;
}

/* PC H2: サイドバーリンクのhoverフィードバック強化 */
.hatena-module-body li a:hover {
  color: var(--color-primary);
  padding-left: 4px;
}

/* PC M-2 (2/21): サイドバー「最新記事」と「関連記事」の差別化 */
.hatena-module-related-entries .hatena-module-body li {
  border-bottom: 1px solid #e8e4dc;
  padding: 10px 0;
}

.hatena-module-related-entries .hatena-module-body li:last-child {
  border-bottom: none;
}

.hatena-module-recent-entries .hatena-module-body li {
  font-size: 0.88em;
  padding: 6px 0;
  border-left: 3px solid #c8a84e;
  padding-left: 10px;
  margin-bottom: 6px;
  border-bottom: none;
}

/* プロフィールモジュール */
.hatena-module-profile .profile-icon {
  border-radius: 50%;
  width: 64px;
  height: 64px;
}

/* 検索モジュール */
.hatena-module-search-box .search-form {
  display: flex;
}

.hatena-module-search-box .search-module-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: var(--font-size-small);
  outline: none;
}

.hatena-module-search-box .search-module-input:focus {
  border-color: var(--color-primary);
}

.hatena-module-search-box .search-module-button {
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-bg-card);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: var(--font-size-small);
}

/* ---------- 10.5. サイドバーCTAバナー (PC H-1: DMMバナー削除後のCTA空白を埋める) ---------- */

.sidebar-cta {
  background: linear-gradient(135deg, #3D3629 0%, #5B7553 100%);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  margin-bottom: 20px;
  text-align: center;
  color: #fff;
}

.sidebar-cta__title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.5;
}

.sidebar-cta__desc {
  font-size: 13px;
  margin-bottom: 16px;
  opacity: 0.9;
  line-height: 1.6;
}

.sidebar-cta__btn {
  display: inline-block;
  background: #E8A33C;
  color: #fff !important;
  font-weight: bold;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: background 0.2s;
}

.sidebar-cta__btn:hover {
  background: #D4922F;
}

/* ---------- 10.6. サイドバーカテゴリナビ (PC M-3: 回遊導線の確保) ---------- */

.sidebar-category-nav {
  margin-bottom: 20px;
}

.sidebar-category-nav__title {
  font-size: 15px;
  font-weight: bold;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
}

.sidebar-category-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-category-nav__list li {
  margin-bottom: 0;
}

.sidebar-category-nav__list a {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: all 0.2s;
}

.sidebar-category-nav__list a:hover {
  background: var(--color-bg-accent);
  color: var(--color-primary);
  padding-left: 16px;
}

.sidebar-category-nav__list .count {
  float: right;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ---------- 11. フッター ---------- */

#footer {
  background: var(--color-header-bg);
  color: var(--color-header-text-dim);
  font-size: 0.8em;
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}

#footer a {
  color: rgba(255, 255, 255, 0.8);
}

#footer a:hover {
  color: var(--color-header-accent);
}

/* ---------- 12. はてなグローバルヘッダー ---------- */

#globalheader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

body {
  padding-top: 37px;
}

/* ---------- 13. モバイル対応 ---------- */

@media (max-width: 768px) {
  /* --- レイアウト: シングルカラム --- */
  #content {
    padding: 0 16px;
  }

  #content-inner {
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
  }

  #main {
    padding: 24px 20px;
    border-radius: 0;
    box-shadow: none;
  }

  #box2 {
    width: 100%;
    margin-top: 32px;
    padding: 0 4px;
  }

  /* --- サイドバー: 検索・カテゴリのみ表示 --- */
  #box2 .hatena-module-links,
  #box2 .hatena-module-archive,
  #box2 .hatena-module-recent-entries {
    display: none;
  }

  /* --- ヘッダー圧縮 (SP H1: ビューポート消費48%->30%以下) --- */
  #blog-title-inner {
    padding: 12px 16px 8px;
  }

  #title a {
    font-size: 1.1em;
  }

  #title {
    line-height: 1.3;
  }

  #blog-description {
    font-size: 0.72em;
    margin-top: 2px;
    margin-bottom: 4px;
  }

  /* --- 記事ページ固有のヘッダー更なる圧縮 (SP H2) --- */
  .page-entry #blog-title-inner {
    padding: 8px 16px 6px;
  }

  .page-entry #title a {
    font-size: 1.0em;
  }

  .page-entry #blog-description {
    display: none;
  }

  .page-entry .entry-header {
    margin-bottom: 12px;
  }

  .page-entry .entry-header .entry-title {
    font-size: 1.3em;
    line-height: 1.35;
  }

  .page-entry #content-inner {
    padding-top: 8px;
  }

  .page-entry #main {
    padding-top: 16px;
  }

  /* --- タップターゲット最小サイズ確保 (SP H3) --- */
  .date a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 4px;
  }

  .blog-controlls-subscribe-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
  }

  .entry-content a.keyword {
    padding: 4px 0;
  }

  .bookmark-widget-counter {
    display: none;
  }

  .pager-prev a,
  .pager-next a {
    min-height: 48px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
  }

  #blog-description {
    font-size: 0.78em;
    margin-bottom: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  /* --- グローバルナビ: 横スクロール --- */
  .reskill-nav {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .reskill-nav::-webkit-scrollbar {
    display: none;
  }

  .reskill-nav a {
    padding: 14px 16px;
    font-size: 13px;
    scroll-snap-align: start;
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- 記事カード: 1列化 --- */
  .archive-entries {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .archive-entry:first-child .entry-thumb-link .entry-thumb {
    height: 180px !important;
  }

  /* 記事カード: コンパクト化 */
  .archive-entry {
    margin-bottom: 12px;
  }

  .archive-entry-body .entry-description {
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
  }

  /* pillar誘導バナー: モバイル対応 */
  .pillar-banner a {
    padding: 12px 16px;
    gap: 12px;
  }

  .pillar-banner .pillar-title {
    font-size: 13px;
  }

  /* --- 記事本文 --- */
  .entry-content {
    font-size: var(--font-size-base);
    line-height: var(--line-height-body);
  }

  /* SP: 本文の行長制限を解除（全幅使用） */
  .entry-content > p,
  .entry-content > ul,
  .entry-content > ol {
    max-width: none;
  }

  .entry-content h2 {
    font-size: 1.15em;
    padding: 10px 12px;
    margin: 40px 0 16px;
    scroll-margin-top: 100px;
  }

  .entry-content h3 {
    font-size: 1.05em;
    margin: 28px 0 12px;
    scroll-margin-top: 100px;
  }

  /* --- 小さいフォントの底上げ (SP M1) --- */
  #box2 {
    font-size: 14px;
  }

  #box2 .hatena-module-body li a {
    font-size: 14px;
    line-height: 1.6;
    padding: 8px 0;
  }

  .breadcrumb {
    font-size: 13px;
    line-height: 1.5;
    padding: 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* --- 目次リンクのタップ領域 (SP M3) --- */
  .entry-content .table-of-contents li {
    padding: 6px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .entry-content .table-of-contents a {
    display: block;
    width: 100%;
    padding: 4px 0;
  }

  .entry-content .table-of-contents {
    padding: 20px 20px 20px 2em;
  }

  /* --- テキスト型CTAボックスのモバイル対応 --- */
  .entry-content .cta-box a {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 48px;
    line-height: 24px;
  }

  /* --- 記事末尾CTAのモバイル対応 (SP M2) --- */
  .entry-content .cta-bottom .cta-btn {
    display: block;
    width: 100%;
    text-align: center;
  }

  /* --- 目次: モバイル最適化 --- */
  .entry-content .table-of-contents {
    padding: 16px 16px 16px 2em;
    margin: 16px 0 24px;
    font-size: var(--font-size-small);
    line-height: 1.8;
  }

  .entry-content .table-of-contents li {
    margin-bottom: 8px;
  }

  .entry-content .table-of-contents a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
  }

  /* --- テーブル: SP幅に収める --- */
  .entry-content table,
  .affiliate-summary table {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
  }

  .entry-content thead th {
    padding: 10px 8px;
    font-size: var(--font-size-xs);
  }

  .entry-content tbody td {
    padding: 10px 8px;
    vertical-align: top;
  }

  /* --- コードブロック --- */
  .entry-content pre {
    padding: 14px;
    font-size: 0.82em;
    border-radius: 0;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
  }

  /* --- 本文リンク: タップ領域拡大 --- */
  .entry-content a {
    padding: 8px 2px;
    margin: -8px -2px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  /* --- パンくずリスト: SP M1 で 13px に底上げ済み --- */
  .breadcrumb {
    font-size: var(--font-size-xs);
    padding: 8px 0;
  }

  /* --- カテゴリタグ: タップ領域確保 --- */
  .categories a {
    padding: 6px 14px;
    min-height: 44px;
    line-height: 32px;
    font-size: 0.85em;
  }

  /* --- ページャー: タップ領域確保 --- */
  .pager a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- フッター --- */
  #footer {
    padding: 20px 16px;
  }

  /* --- アフィリエイトカード: 縦型 --- */
  .aff-card {
    flex-direction: column;
    text-align: center;
  }

  .aff-card__img,
  .aff-card__img--empty {
    width: 160px;
    height: 160px;
  }

  .aff-card__cta {
    width: 100%;
  }

  /* --- 書籍カード: 縦型 --- */
  .aff-book-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .aff-book-card__cover {
    width: 140px;
  }

  .aff-book-card__links {
    justify-content: center;
  }

  /* --- 記事ページでサイドバー非表示 --- */
  .page-entry #box2 {
    display: none;
  }

  /* --- トップ・カテゴリページのカード内カテゴリタグを非表示 --- */
  .archive-entry .categories {
    display: none;
  }

  /* --- 記事ページのカテゴリタグを非表示 (SP FV改善) --- */
  /* パンくず・記事フッターにカテゴリ表示あり。ヘッダーは冗長 */
  .page-entry .categories {
    display: none;
  }

  /* --- アフィリエイトバナーの余白強化 --- */
  .aff-banner {
    margin: 32px auto;
    padding: 16px 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
  }

  /* --- サイドバーモジュール --- */
  .hatena-module {
    border-radius: 0;
  }

  /* --- SP H-1 (revised): 3列以上テーブルの横スクロール + 最小幅設定 --- */
  /* SP H-3 (new): 2列テーブルは横スクロール不要 — :has()で列数判定 */
  .entry-content table {
    min-width: 480px;
  }

  /* 2列テーブルは画面幅に収める（:has() は iOS 15.4+対応済み） */
  .entry-content table:has(th:nth-child(2):last-child),
  .entry-content table:has(td:nth-child(2):last-child) {
    min-width: 0 !important;
    table-layout: fixed;
  }

  /* --- SP H-2: 記事ページ カテゴリタグの表示制限（3個まで） --- */
  .page-entry .categories a:nth-child(n+4) {
    display: none;
  }

  /* --- SP H-3: 前後記事ナビのテキスト改善 --- */
  .pager .pager-prev a,
  .pager .pager-next a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    min-height: 48px;
    padding: 12px 8px;
  }

  /* --- SP M-1: アイキャッチ画像のCLS防止 --- */
  .archive-entry .entry-thumb-link .entry-thumb {
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  .archive-entry:first-child .entry-thumb-link .entry-thumb {
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  /* --- SP M-5: アフィリエイトバナーのCLS防止 --- */
  .aff-banner {
    min-height: 280px;
  }

  /* --- SP H-1 (2/21): 記事本文内のH1重複を非表示 --- */
  .page-entry .entry-content > h1:first-child {
    display: none;
  }

  /* --- SP M-1 (2/21): パンくずリスト オーバーフロー制御 --- */
  .breadcrumb .breadcrumb-child {
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: bottom;
  }

  /* --- SP M-3 (2/21): 4列テーブルのコンパクト化 --- */
  .entry-content table:has(th:nth-child(4)) {
    font-size: 12px;
  }

  .entry-content table:has(th:nth-child(4)) th,
  .entry-content table:has(th:nth-child(4)) td {
    padding: 8px 4px;
  }

  /* --- SP M-1 (2/22): テーブル横スクロールの視覚的ヒント --- */
  .entry-content .table-scroll-hint {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .entry-content .table-scroll-hint::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 100%;
    background: linear-gradient(to left, rgba(250, 248, 245, 0.8), transparent);
    pointer-events: none;
  }

  /* --- SP M-2 (2/22): はてな関連記事のSP最適化 --- */
  .related-entries .related-entry {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
  }

  .related-entries .related-entry-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    object-fit: cover;
  }

  .related-entries .related-entry-title {
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* --- SP M-3 (2/22): パンくずリスト — 最後の要素のみ省略 --- */
  .breadcrumb {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .breadcrumb a {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .breadcrumb span:last-child,
  .breadcrumb > :last-child:not(a) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  /* --- SP M-4 (2/22): アイキャッチ直後の余白調整 --- */
  .entry-content > p:first-child {
    margin-bottom: 12px;
  }

  .entry-content > p:first-child img {
    margin-bottom: 8px;
  }

  /* --- SP: 記事内CTAボックスのモバイル対応 --- */
  .entry-content .article-cta__btn {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 48px;
    line-height: 24px;
  }

  /* --- SP: ピックアップセクションのモバイル対応 --- */
  .pickup-section {
    padding: 12px 16px;
    gap: 12px;
  }

  .pickup-card {
    flex: 0 0 160px;
  }

  .pickup-card__img {
    height: 90px;
  }
}

/* ---------- 13.5. 狭い画面対応（480px以下）---------- */

@media (max-width: 480px) {
  #content {
    padding: 0 12px;
  }

  #main {
    padding: 20px 16px;
  }

  .entry-content pre {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
  }

  /* カテゴリタグ: より大きなタップ領域 */
  .categories a {
    padding: 8px 16px;
  }
}

/* ==========================================================================
   14. フッターナビ（固定ページリンク）
   ========================================================================== */

.footer-nav {
  text-align: center;
  padding: 24px 16px 8px;
  font-size: 14px;
  line-height: 1.8;
}

.footer-nav a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-sep {
  margin: 0 12px;
  color: var(--color-border);
}

.footer-copy {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  padding-bottom: 16px;
  margin: 0;
}

/* --- SP: フッターナビ --- */
@media (max-width: 768px) {
  .footer-nav {
    padding: 20px 16px 8px;
    font-size: 13px;
  }

  .footer-sep {
    margin: 0 8px;
  }
}

/* ==========================================================================
   15. お問い合わせフォーム（Googleフォーム埋め込み）
   ========================================================================== */

.contact-form-wrapper {
  width: 100%;
  max-width: 640px;
  margin: 24px auto;
}

.contact-form-wrapper iframe {
  width: 100%;
  border: none;
}

@media (max-width: 768px) {
  .contact-form-wrapper iframe {
    height: 1000px;
  }
}
