/* 図表の部品（scripts/lib/visual-parts.mjs が作る HTML の見た目）。部品のある記事だけが読み込む。
   色・線・角は site.css の :root の値を使う（白いカード・細い線・角6px、図の塗りは緑）。
   数字や期間は必ず文字でも出しているので、色だけで意味を伝えない。スマホ（360px）でも横にはみ出さない */
.prose .vp { margin: 28px 0 32px; padding: 16px 18px 14px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius); }
.prose .vp ul, .prose .vp ol { list-style: none; padding: 0; margin: 0; }
.prose .vp li { margin: 0; }
.prose .vp-title { margin: 0 0 12px; font-size: var(--fs-ui); font-weight: 700; line-height: 1.6; color: var(--ink); }
.prose .vp-note { margin: 12px 0 0; font-size: var(--fs-small); line-height: 1.6; color: var(--muted); }
.prose .vp-table { padding: 0; border: 0; background: none; }
.prose .vp-table .vp-title { margin-bottom: 8px; }

/* 1. 比べる横棒グラフ */
.vp-bar-list { display: grid; grid-template-columns: minmax(7em, 30%) 1fr auto; align-items: center; gap: 12px; }
.vp-bar-list li { display: contents; } /* 3つの欄を表のようにそろえる（棒の長さをそろえて比べられるように） */
.vp-bar-label { font-size: var(--fs-ui); line-height: 1.5; }
.vp-bar-track { position: relative; height: 14px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.vp-bar-fill, .vp-bar-range { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.vp-bar-fill { background: var(--fill-blue); }
.vp-bar-range { background: repeating-linear-gradient(135deg, var(--fill-blue) 0 3px, #d6e6dc 3px 7px); } /* 幅のある値の上の方は斜線 */
.vp-bar-value { font-size: var(--fs-ui); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
@media (max-width: 560px) {
  .vp-bar-list { grid-template-columns: 1fr; gap: 0; }
  .prose .vp-bar-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; margin-bottom: 14px; }
  .prose .vp-bar-list li:last-child { margin-bottom: 0; }
  .vp-bar-label { grid-column: 1; }
  .vp-bar-value { grid-column: 2; grid-row: 1; }
  .vp-bar-track { grid-column: 1 / -1; }
}

/* 2. 季節カレンダー */
.vp-cal-list { display: grid; gap: 10px; }
.vp-cal-row { display: grid; grid-template-columns: minmax(8em, 34%) 1fr; align-items: center; gap: 4px 12px; }
.vp-cal-label { display: flex; flex-direction: column; font-size: var(--fs-ui); line-height: 1.5; }
.vp-cal-label b { font-weight: 700; }
.vp-cal-text { font-size: var(--fs-small); color: var(--ink2); }
.vp-cal-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.vp-cal-strip > span { height: 16px; background: var(--soft); border-radius: 0; }
.vp-cal-strip > span.on { background: var(--fill-blue); }
.vp-cal-strip > span.s { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.vp-cal-strip > span.e { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.vp-cal-head { margin-bottom: 6px; }
.vp-cal-head .vp-cal-label { font-size: var(--fs-small); color: var(--muted); }
.vp-cal-head .vp-cal-strip > span { height: auto; background: none; text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .vp-cal-row { grid-template-columns: 1fr; }
  .vp-cal-head .vp-cal-label { display: none; }
  .vp-cal-label { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
}

/* 3. 道順・位置関係の図（点と線。地図ではない） */
.vp-route-list { position: relative; display: grid; gap: 0; }
.vp-stop { display: flex; align-items: flex-start; gap: 12px; }
.vp-dot { flex: none; width: 14px; height: 14px; margin-top: 5px; border: 3px solid var(--fill-blue); border-radius: 50%; background: var(--surface); }
.vp-stop:first-child .vp-dot, .vp-stop:last-child .vp-dot { background: var(--fill-blue); }
.vp-stop-text { display: flex; flex-direction: column; font-size: var(--fs-ui); line-height: 1.6; }
.vp-stop-text span { font-size: var(--fs-small); color: var(--ink2); }
.vp-leg { margin-left: 6px; padding: 6px 0 6px 17px; border-left: 2px dashed var(--fill-blue); }
.vp-leg-text { display: inline-block; padding: 1px 8px; font-size: var(--fs-small); font-weight: 700; color: var(--accent); background: var(--blue-bg); border-radius: var(--radius-tag); }
@media (min-width: 720px) {
  /* 地点が4つまでなら PC では横に並べる（地点・移動・地点…。移動の線は残りの幅で伸びる） */
  .vp-route-wide { display: flex; align-items: flex-start; }
  .vp-route-wide::before { content: ""; position: absolute; top: 11px; left: 4.5em; right: 4.5em; border-top: 2px dashed var(--fill-blue); } /* 最初の点から最後の点までの線 */
  .vp-route-wide .vp-stop { position: relative; flex: 0 0 9em; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .vp-route-wide .vp-stop-text { align-items: center; }
  .vp-route-wide .vp-leg { flex: 1 1 0; display: flex; justify-content: center; margin: 0; padding: 0; border-left: 0; }
  .vp-route-wide .vp-leg-text { position: relative; white-space: nowrap; }
}
.prose .vp-route-note { padding-top: 8px; border-top: 1px solid var(--line); }

/* 4. 数字カード */
.vp-stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.vp-stat-list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--soft); border-radius: var(--radius-s); }
.vp-stat-label { font-size: var(--fs-small); color: var(--ink2); line-height: 1.5; }
.vp-stat-value { font-size: 22px; line-height: 1.35; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vp-stat-sub { font-size: var(--fs-small); color: var(--muted); line-height: 1.5; }
@media (max-width: 560px) {
  .vp-stat-list { grid-template-columns: 1fr 1fr; }
  .vp-stat-list.vp-n3 li:last-child { grid-column: 1 / -1; }
  .vp-stat-value { font-size: 19px; }
}
@media (min-width: 561px) { .vp-stat-list.vp-n4 { grid-template-columns: repeat(4, 1fr); } }

/* 5. 見やすい比較表（おすすめの行・スマホでカード） */
.prose .vp-table table { width: 100%; }
.prose .vp-table tr.vp-rec td { background: #eef5f0; }
.prose .vp-table tr.vp-rec td:first-child { box-shadow: inset 3px 0 0 var(--fill-blue); font-weight: 700; }
.vp-badge { display: inline-block; margin: 0 6px 2px 0; padding: 0 6px; font-size: 11px; font-weight: 700; line-height: 1.7; color: var(--surface); background: var(--accent); border-radius: var(--radius-tag); vertical-align: middle; }
/* スマホでカードにする部分（vp-cards）は、ふつうの表と共通なので site.css の「記事の表：スマホでカード」へ移した（T-0086） */
@media (max-width: 760px) {
  .prose table.vp-cards tr.vp-rec { border-color: var(--fill-blue); }
  .prose table.vp-cards tr.vp-rec td:first-child { box-shadow: none; background: #eef5f0; }
}
}
