/* 資料の掲載ページ（制作例 b）
   JIS X 8341-3:2016 適合レベル AA を目標に作成。外部の書体・ライブラリ・JavaScript を使わない。
   文字色と背景の組合せはすべてコントラスト比 4.5:1 以上、図の線・棒と背景は 3:1 以上 */

:root {
  --bg: #ffffff;
  --fg: #1a1b23;
  --fg-2: #4a4c58;
  --rule: #c8cad3;
  --rule-soft: #e3e4ea;
  --panel: #f5f6f9;
  --accent: #2f45c8;
  --focus: #c8410b;
  --font: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'BIZ UDPGothic', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 1rem; line-height: 1.85; letter-spacing: 0.03em; }
a { color: var(--accent); text-underline-offset: 0.22em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
/* フォーカスは色だけに頼らず、太い枠で示す（2.4.7） */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 8px; top: -100px; z-index: 10; padding: 10px 16px; background: var(--fg); color: #fff; font-weight: 600; }
.skip:focus { top: 8px; }

.sample { background: #1a1b23; color: #eceef4; font-size: 0.875rem; }
.sample p { margin: 0 auto; max-width: 1040px; padding: 8px 20px; }
.sample a { color: #c9d0ff; }

.site { border-bottom: 1px solid var(--rule); }
.site__in { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site__name { margin: 0; font-weight: 700; font-size: 1rem; }
.site__note { margin: 0; font-size: 0.875rem; color: var(--fg-2); }

.crumbs { max-width: 1040px; margin: 0 auto; padding: 12px 20px 0; font-size: 0.875rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: '›'; margin: 0 6px; color: var(--fg-2); }

main { max-width: 1040px; margin: 0 auto; padding: 8px 20px 96px; }
/* 文章は読みやすい行長に、図と表は本文の幅いっぱいに */
.doc > h1, .doc > .meta, .doc > .about, .doc > .toc, .points, .contact, .source p { max-width: 46em; }
h1 { margin: 28px 0 0; font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.45; letter-spacing: 0.02em; }
.meta { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 0.9375rem; color: var(--fg-2); }
.meta dt { display: inline; }
.meta dt::after { content: '：'; }
.meta dd { display: inline; margin: 0; color: var(--fg); }
.about { margin: 20px 0 0; padding: 14px 18px; background: var(--panel); border-left: 4px solid var(--accent); font-size: 0.9375rem; }
.about p { margin: 0; }
.about p + p { margin-top: 6px; }

.toc { margin: 28px 0 0; padding: 18px 22px; border: 1px solid var(--rule); border-radius: 6px; }
.toc h2 { margin: 0; font-size: 1rem; border: 0; padding: 0; }
.toc ol { margin: 6px 0 0; padding-left: 1.5em; }
.toc li { margin-top: 4px; }

section { margin-top: 56px; }
h2 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.5rem); line-height: 1.55; padding: 10px 0 10px 16px; border-left: 6px solid var(--fg); background: var(--panel); }
h2 .line { display: block; }
.points { margin: 18px 0 0; padding-left: 1.4em; }
.points li { margin-top: 10px; }
.points li::marker { content: '○ '; }

figure { margin: 32px 0 0; padding: 20px; border: 1px solid var(--rule); border-radius: 6px; }
figure > figcaption { font-weight: 700; font-size: 1rem; }
.fig-sub { margin: 2px 0 0; font-size: 0.875rem; color: var(--fg-2); }
.chart { margin-top: 14px; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; min-width: 560px; font-family: var(--font); }
.chart--narrow svg { min-width: 0; }
.chart text { fill: var(--fg); }
.fig-desc { margin: 12px 0 0; font-size: 0.9375rem; }
.fig-note { margin: 8px 0 0; font-size: 0.875rem; color: var(--fg-2); }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.875rem; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 12px; border: 1px solid #666a78; }
.legend i.line { height: 0; border-width: 2px 0 0; width: 22px; }

details { margin-top: 14px; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); width: fit-content; }
summary:hover { text-decoration: underline; }
.tablewrap { margin-top: 12px; overflow-x: auto; }
table { border-collapse: collapse; font-size: 0.875rem; line-height: 1.5; min-width: 100%; }
caption { text-align: left; font-weight: 700; padding-bottom: 8px; font-size: 1rem; }
th, td { border: 1px solid var(--rule); padding: 6px 10px; }
thead th { background: #eceef4; text-align: center; vertical-align: middle; font-weight: 600; }
tbody th { text-align: left; font-weight: 500; background: #fafbfc; white-space: nowrap; }
td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.l { text-align: left; }
tr.gap th, tr.gap td { border-top: 3px double var(--rule); }
.table-notes { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--fg-2); }
.table-notes li + li { margin-top: 2px; }
sup { font-size: 0.75em; }

.contact { margin-top: 48px; padding: 16px 20px; border: 1px solid var(--rule); border-radius: 6px; font-size: 0.9375rem; }
.contact h2 { font-size: 1rem; background: none; border: 0; padding: 0; }
.contact p { margin: 6px 0 0; }

.source { margin-top: 48px; font-size: 0.9375rem; }
.source h2 { font-size: 1.125rem; }
.source p { margin: 12px 0 0; }

.foot { border-top: 1px solid var(--rule); }
.foot p { max-width: 1040px; margin: 0 auto; padding: 24px 20px 40px; font-size: 0.875rem; color: var(--fg-2); }

@media (max-width: 600px) {
  figure { padding: 14px; margin-left: -6px; margin-right: -6px; }
  h2 { padding-left: 12px; }
}
@media print {
  .skip, .sample { display: none; }
  details > *:not(summary) { display: block; }
  figure, table { break-inside: avoid; }
}
