/* =========================================================
   article_code_visual.css ── コード解説記事の可視化

   【スコープ】 `.entry-content .sp-*` (= 記事本文内限定)

   【Phase 4 refactor (2026-06-01)】
   - 全 selector に `.entry-content ` 親スコープ追加
   - 全 197 個の `!important` 削除 (= wp_reset.css 専有原則に整合)
   - 機能差なし、詳細度の正規化のみ

   【触るべきとき】
   - フロー図 (.sp-flow) のサイズ・色を変えたい → 該当セレクタを直接編集
   - パイプライン (.sp-pipeline) や関数表 (.sp-func-table) の見た目調整
   - 参照フロー (.sp-ref-flow) の見直し

   【関連ファイル】
   - tokens.css: 色変数 (--accent, --paper 等)
   - article_diagrams.css: .sa-* 系 (= 別 prefix、別スコープ)
   - code_block.css: .sa-pre 系 (= 別 prefix、別スコープ)
========================================================= */


/* フロー図（横並び） */
.entry-content .sp-flow {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
  width: 100%;
}
.entry-content .sp-flow__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.entry-content .sp-flow__box {
  display: block;
  padding: 12px 20px;
  background: linear-gradient(160deg,rgba(250,246,236,.98),rgba(243,240,226,.97));
  border: 1.5px solid rgba(168,180,110,.40);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(80,110,60,.06);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  min-width: 108px;
  line-height: 1.5;
}
.entry-content .sp-flow__lbl {
  display: block;
  font-family: ui-monospace,Menlo,monospace;
  font-size: 10px;
  letter-spacing: .10em;
  color: var(--muted);
  text-transform: uppercase;
}
.entry-content .sp-flow__arr {
  display: block;
  font-size: 20px;
  color: var(--accent);
  opacity: .6;
  padding: 0 10px;
  margin-bottom: 18px;
  align-self: center;
  flex-shrink: 0;
  line-height: 1;
}
.entry-content .sp-flow__caption {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  margin-top: 4px;
  letter-spacing: .04em;
}

/* パイプライン（縦）*/
.entry-content .sp-pipeline {
  display: block;
  margin: 22px 0;
  border: 1.5px solid rgba(168,180,110,.35);
  border-radius: 20px;
  background: linear-gradient(160deg,rgba(250,246,236,.98),rgba(243,240,226,.97));
  box-shadow: 0 6px 22px rgba(80,110,60,.07);
  overflow: hidden;
}
.entry-content .sp-pipeline__row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(168,180,110,.22);
}
.entry-content .sp-pipeline__row:last-child { border-bottom: none; }
.entry-content .sp-pipeline__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-family: ui-monospace,Menlo,monospace;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.entry-content .sp-pipeline__badge--icon {
  font-size: 15px;
  background: transparent;
  border: 1.5px solid rgba(168,180,110,.50);
  color: var(--accent);
}
.entry-content .sp-pipeline__label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
}
.entry-content .sp-pipeline__body {
  display: block;
  font-family: ui-monospace,Menlo,monospace;
  font-size: 12.5px;
  line-height: 2.0;
  color: var(--ink-soft);
}
.entry-content .sp-pipeline__body .hi { color: #6a9a30; font-weight: 600; }
.entry-content .sp-pipeline__body .cm { color: var(--muted); font-style: italic; font-size: 11.5px; }
.entry-content .sp-pipeline__cmd {
  display: inline-flex;
  align-items: center;
  background: #1e1c17;
  color: #7fbf7f;
  border-radius: 10px;
  padding: 6px 14px;
  font-family: ui-monospace,Menlo,monospace;
  font-size: 13px;
  margin-top: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.entry-content .sp-pipeline__cmd::before {
  content: "$";
  color: #6a6252;
  margin-right: 10px;
  font-size: 12px;
  user-select: none;
}
.entry-content .sp-pipeline__arrow-row {
  display: block;
  padding: 2px 22px 2px 38px;
  color: var(--accent);
  opacity: .45;
  font-size: 18px;
  line-height: 1;
  border-bottom: 1px solid rgba(168,180,110,.22);
}

/* 関数テーブル */
.entry-content .sp-func-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid rgba(168,180,110,.35);
  box-shadow: 0 6px 22px rgba(80,110,60,.07);
}
.entry-content .sp-func-table th {
  background: linear-gradient(160deg,rgba(250,246,236,.98),rgba(243,240,226,.97));
  color: var(--ink-soft);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1.5px solid rgba(168,180,110,.40);
  letter-spacing: .04em;
}
.entry-content .sp-func-table td {
  padding: 11px 16px;
  font-size: 13.5px;
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  color: var(--ink);
  border-bottom: 1px solid rgba(168,180,110,.18);
  vertical-align: middle;
  line-height: 1.7;
  background: var(--paper-2);
}
.entry-content .sp-func-table tr:last-child td { border-bottom: none; }
.entry-content .sp-func-table tr:hover td { background: rgba(212,168,64,.05); }
.entry-content .sp-func-table td:first-child {
  font-family: ui-monospace,Menlo,monospace;
  font-size: 12.5px;
  color: #5a8c28;
  font-weight: 600;
  white-space: nowrap;
}
.entry-content .sp-func-table td:last-child {
  font-family: ui-monospace,Menlo,monospace;
  font-size: 12px;
  color: #7a4090;
  white-space: nowrap;
}
.entry-content .sp-func-table__caption {
  padding: 9px 16px;
  background: linear-gradient(160deg,rgba(250,246,236,.98),rgba(243,240,226,.97));
  border-top: 1px solid rgba(168,180,110,.22);
  font-size: 12px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  letter-spacing: .03em;
}

/* toctree参照フロー図 */
.entry-content .sp-ref-flow {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  margin: 22px 0;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
}
.entry-content .sp-ref-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 110px;
  gap: 0;
  flex-shrink: 0;
}
.entry-content .sp-ref-box {
  display: block;
  width: 100%;
  padding: 14px 12px 10px;
  background: linear-gradient(160deg,rgba(250,246,236,.98),rgba(243,240,226,.97));
  border: 1.5px solid rgba(168,180,110,.40);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(80,110,60,.06);
  text-align: center;
  box-sizing: border-box;
}
.entry-content .sp-ref-box__name {
  display: block;
  font-family: ui-monospace,Menlo,monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.entry-content .sp-ref-box__desc {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  line-height: 1.6;
}
.entry-content .sp-ref-lbl {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  letter-spacing: .10em;
  text-transform: uppercase;
  text-align: center;
}
.entry-content .sp-ref-arr {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 20px;
  color: var(--accent);
  opacity: .5;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 22px;
  line-height: 1;
}
.entry-content .sp-ref-caption {
  display: block;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(212,168,64,.06);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  letter-spacing: .03em;
  border: 1px solid rgba(168,180,110,.20);
}

/* パイプライン残り */
.entry-content .sp-pipeline__caption {
  display: block;
  padding: 10px 22px;
  background: rgba(212,168,64,.06);
  border-top: 1px solid rgba(168,180,110,.20);
  font-size: 12px;
  color: var(--muted);
  font-family: "Hiragino Sans","Noto Sans JP",sans-serif;
  letter-spacing: .03em;
}

@media (max-width: 680px) {
  .sp-flow { gap: 4px; }
  .sp-flow__arr { padding: 0 4px; font-size: 16px; }
  .sp-ref-flow { gap: 0; }
  .sp-ref-arr { padding: 0 4px; }
  .sp-ref-box__name { font-size: 11.5px; }
  .sp-func-table th, .sp-func-table td { padding: 9px 10px; font-size: 12.5px; }
}
