/* 人手不足を乗り越える — トークンの正典は site/DESIGN.md */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --ink: #222222;
  --muted: #666666;
  --link: #176B87;
  --link-hover: #0F5268;
  --rule: #E5E5E5;
  --soft: #F6F7F8;
  --font-body: "BIZ UDPGothic", "BIZ UDPゴシック", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-mono: ui-monospace, Consolas, "BIZ UDGothic", monospace;
  --gutter: 16px;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  line-break: strict;
  font-feature-settings: "palt";
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.45; font-weight: 700; margin: 0; text-wrap: balance; }
p { margin: 0 0 1.2em; }

.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10;
}
.skip-link:focus { top: 8px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- header ---- */
.site-head { border-bottom: 1px solid var(--rule); padding: 24px 0 16px; }
.site-name { margin: 0; font-size: 24px; line-height: 1.4; letter-spacing: 0.02em; }
.site-name a { color: var(--ink); text-decoration: none; display: inline-block; padding: 8px 0; margin: -8px 0; }
.site-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ---- top ---- */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 32px 0; border-bottom: 1px solid var(--rule); }
.post-meta { margin: 0 0 4px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.post-meta .cat { margin-left: 12px; }
.posts h2 { font-size: 20px; margin: 0 0 8px; }
.posts h2 a { color: var(--ink); text-decoration: none; }
.posts h2 a:hover { color: var(--link); text-decoration: underline; }
.excerpt {
  margin: 0; font-size: 15px; line-height: 1.8; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.profile { padding: 40px 0 72px; }
.profile h2 { font-size: 18px; margin-bottom: 8px; }
.profile p { font-size: 15px; line-height: 1.85; margin-bottom: 8px; }

/* ---- article ---- */
.post { padding: 32px 0 48px; }
.pr-note { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.post h1 { font-size: clamp(24px, 5.6vw, 30px); margin: 0 0 24px; text-wrap: wrap; }
.post-head .post-meta { margin-bottom: 8px; }

.env { background: var(--soft); border: 1px solid var(--rule); padding: 12px 16px; margin: 0 0 32px; font-size: 14px; line-height: 1.7; }
.env-title { margin: 0 0 4px; font-weight: 700; font-size: 14px; }
.env dl { margin: 0; }
.env .row { display: flex; gap: 12px; padding: 2px 0; }
.env dt { flex: 0 0 5.5em; color: var(--muted); }
.env dd { margin: 0; flex: 1; }

.prose h2 { font-size: 22px; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.prose h3 { font-size: 18px; margin: 32px 0 8px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.prose li { margin-bottom: 0.3em; }
.prose .conclusion { background: var(--soft); padding: 12px 16px; }
.table-scroll { overflow-x: auto; margin: 0 0 1.4em; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table thead th { font-weight: 700; border-bottom: 1px solid var(--ink); background: var(--soft); }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.data-table caption { caption-side: bottom; text-align: left; font-size: 13px; color: var(--muted); padding-top: 8px; }
.prose pre {
  background: var(--soft); border: 1px solid var(--rule);
  padding: 12px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; margin: 0 0 1.4em;
}

/* affiliate button */
.aff { margin: 28px 0; }
.btn {
  display: inline-block; font-weight: 700; font-size: 16px; line-height: 1.5;
  background: var(--link); color: #fff; text-decoration: none; padding: 12px 20px; border-radius: 2px;
}
.btn:hover { background: var(--link-hover); }
.nb { white-space: nowrap; }

.back { margin: 48px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; }
.back a { display: inline-block; padding: 8px 0; }

/* ---- plain pages ---- */
.page { padding: 32px 0 72px; }
.page h1 { font-size: clamp(20px, 5.6vw, 30px); margin-bottom: 24px; text-wrap: wrap; }
.page h2 { font-size: 19px; margin: 40px 0 8px; }
.page h2 + p { margin-top: 0; }

/* ---- footer ---- */
.site-foot { border-top: 1px solid var(--rule); padding: 16px 0 32px; font-size: 14px; color: var(--muted); }
.site-foot ul { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-foot a { color: var(--ink); display: inline-block; padding: 10px 0; }
.site-foot p { margin: 0; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 狭幅の表 */
@media (max-width: 559px) {
  .data-table { font-size: 14px; table-layout: fixed; }
  .data-table th, .data-table td { padding: 8px 8px; }
  .data-table td.num { white-space: normal; }
  .data-table.cols-3 th:nth-child(1) { width: 42%; }
  .data-table.cols-3 th:nth-child(2) { width: 26%; }
}
@media print {
  .site-foot, .skip-link, .aff { display: none; }
}
