/* “ほんのり”なカード風 */
blockquote.callout {
  border-left: 4px solid #888;
  background: #f9f9f9;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 6px;
}
blockquote.callout > p:first-child {
  font-weight: 600;
  margin-top: 0;
  color: #444;
}
blockquote.callout p:last-child {
  margin-bottom: 0;
}

/* 全てのMarkdown表に適用 */
table {
  display: block;
  overflow-x: auto;       /* 横スクロール対応 */
  border-collapse: collapse;
  width: 100%;
  table-layout: auto;     /* 列幅を中身に合わせて自動調整 */
}

/* ヘッダやセルの共通調整 */
table th, table td {
  padding: 0.4em 0.6em;
  vertical-align: top;
  white-space: normal;    /* 改行を許可 */
  line-break: strict;
  word-break: keep-all;   /* 日本語を変な位置で切らない */
  overflow-wrap: anywhere;
}

/* 長文列用に最小幅を広めに確保（すべての列に効く）*/
table th, table td {
  min-width: 8rem;       /* これでどの列もそこそこ広めになる */
}
table th:last-child,
table td:last-child {
  min-width: 18rem;
}
/* 見出し(TH)は基本 折り返さない → 変な改行を防ぐ */
.markdown-body table thead th{
  white-space: nowrap !important;
  vertical-align: middle;
}

/* 4列テーブルだけに幅配分を適用（5列以上は除外） */
.markdown-body table:has(> thead > tr > th:nth-child(4))
:not(:has(> thead > tr > th:nth-child(5))) th:nth-child(1),
.markdown-body table:has(> thead > tr > th:nth-child(4))
:not(:has(> thead > tr > th:nth-child(5))) td:nth-child(1){
  min-width: 10ch !important;     /* 軸：やや狭め/中央 */
  text-align: center;
}

/* 本文セルは自然改行、日本語の途中切れを抑制 */
.markdown-body table td{
  white-space: normal !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* スマホ調整：幅を少し緩め、横スクロールも許容 */
@media (max-width: 720px){
  .markdown-body table{
    overflow-x: auto;
  }
  .markdown-body table thead th{
    white-space: nowrap !important;
    font-size: 0.95em;
  }
  .markdown-body table td{
    line-height: 1.7;
  }
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) th:nth-child(2),
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) td:nth-child(2),
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) th:nth-child(3),
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) td:nth-child(3){
    min-width: 16rem !important;
  }
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) th:nth-child(4),
  .markdown-body table:has(> thead > tr > th:nth-child(4))
  :not(:has(> thead > tr > th:nth-child(5))) td:nth-child(4){
    min-width: 20rem !important;
  }
}
