/* keiba-trend 共通CSS。design.md 最優先ルール準拠:
   Noto Sans JP / 無彩色背景 / 左縁帯や枠線だけの面を使わない / 数字を先に見せる。
   ページ #f3f4f5 ／ セクション #ffffff ／ カード 薄いグレー#eceff1、を面の塗りだけで区切る。 */

:root {
  --page-bg: #f3f4f5;
  --section-bg: #ffffff;
  --card-bg: #eceff1;
  --text: #1f2328;
  --text-sub: #5f6368;
  --accent: #1a56db; /* プライマリ（主要リンク・強調数字） */
  --border-hairline: #d7dade; /* 区切りの最小限の線のみに使う。箱の枠には使わない */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--section-bg);
  padding: 16px;
}
.site-header__inner {
  max-width: 760px;
  margin: 0 auto;
}
.site-header__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}
.site-header__title a {
  color: var(--text);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.lede {
  color: var(--text-sub);
  font-size: 0.9375rem;
  margin: 4px 0 24px;
}

h1 {
  font-size: 1.602rem; /* 1.25比率スケール */
  line-height: 1.4;
  margin: 0 0 8px;
}
h2 {
  font-size: 1.266rem;
  margin: 40px 0 12px;
}
h3 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
}

section {
  background: var(--section-bg);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

/* 結論の数字（最優先で見せる） */
.headlines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.headline-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
}
.headline-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.headline-card__label {
  font-size: 0.875rem;
  margin-top: 4px;
}
.headline-card__note {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.table-scroll {
  overflow-x: auto;
  margin: 8px 0;
}
.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.9375rem;
}
.table-scroll th,
.table-scroll td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}
.table-scroll th:first-child,
.table-scroll td:first-child {
  text-align: left;
  white-space: normal; /* 和文ラベル列はnowrapにしない（design.md） */
  min-width: 7em;
}
.table-scroll thead th {
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.8125rem;
}

.scroll-hint {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin: 0 0 8px;
  display: none;
}
.scroll-hint.is-visible {
  display: block;
}

.table-note {
  font-size: 0.8125rem;
  color: var(--text-sub);
  margin: 4px 0 16px;
}

.source-note {
  font-size: 0.8125rem;
  color: var(--text-sub);
  margin-top: 32px;
}

.article-body {
  font-size: 0.9375rem;
}
.article-body p {
  margin: 0 0 1em;
}

.todo-note {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-sub);
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-list li {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.article-list a {
  font-weight: 700;
  font-size: 1rem;
}
.article-list .article-list__meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-size: 0.8125rem;
  color: var(--text-sub);
}
.site-footer nav {
  margin-bottom: 8px;
}
.site-footer nav a {
  margin-right: 16px;
}

.simple-page h1 {
  margin-bottom: 16px;
}
.simple-page p {
  margin: 0 0 1em;
}

.table-scroll th.txt,
.table-scroll td.txt {
  text-align: left;
}
.table-scroll td.horse {
  white-space: nowrap;
}
.table-scroll td.txt {
  white-space: normal;
  min-width: 8em;
}

/* 横棒グラフ（dataviz: 1系列・1色、棒は24px以下、データ端4px角丸、値は棒の先、文字は文字色） */
.chart { margin: 32px 0; }
.chart h2 { margin: 0 0 4px; }
.chart-takeaway { margin: 0 0 12px; color: var(--text-sub); font-size: 0.875rem; }
.bar-chart { list-style: none; margin: 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(6em, 11em) 1fr auto; align-items: center; gap: 10px; padding: 5px 0; }
.bar-row:hover, .bar-row:focus { background: #f3f4f5; outline: none; }
.bar-label { font-size: 0.875rem; line-height: 1.3; }
.bar-track, .mini-track { display: block; height: 16px; background: #eceef0; border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 4.5em; }
.bar-value small, .mini small { font-weight: 400; color: var(--text-sub); font-size: 0.75rem; }
.mini-track { display: inline-block; width: 64px; height: 10px; vertical-align: middle; margin-right: 6px; }
.mini-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.all-tables { margin: 32px 0; }
.all-tables summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 7.5em 1fr auto; gap: 6px; }
  .bar-value small { display: none; }
}

.table-scroll table.entries td.horse { white-space: nowrap; }
.table-scroll table.entries td.mini { white-space: nowrap; text-align: left; }
.table-scroll table.entries th:last-child { text-align: left; }
@media (min-width: 481px) { .bar-row { grid-template-columns: 15em 1fr auto; } }

small.ride { display: block; font-size: 0.75rem; color: var(--text-sub); font-weight: 400; line-height: 1.3; }
.umaban { display: inline-block; min-width: 1.6em; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.table-scroll table.entries { min-width: 0; }
@media (max-width: 480px) {
  .table-scroll table.entries th, .table-scroll table.entries td { padding: 8px 6px; font-size: 0.8125rem; }
  .table-scroll table.entries td.txt { min-width: 7em; }
  .mini-track { width: 40px; }
}
.bar-row.is-muted .bar-fill { background: #a9c9f0; }
.bar-row.is-muted + .bar-row.is-muted { }
