/* src/site.py が作る。手で直さない */
:root {
  --bg: #f5f6f1;
  --surface: #ffffff;
  --ink: #1c211f;
  --muted: #58615c;
  --line: #d8ddd4;
  --head: #eceee6;
  --stripe: #f8f9f5;
  --accent: #17657d;
  --shell: #e9b73c;
  --note: #fbf5e3;
  --note-line: #eadcae;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121513;
    --surface: #191d1b;
    --ink: #e3e7e2;
    --muted: #9ba49f;
    --line: #2d3430;
    --head: #212724;
    --stripe: #161a18;
    --accent: #79c1d8;
    --shell: #e0ae36;
    --note: #221f15;
    --note-line: #463d20;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic",
    Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
main, footer { max-width: 72rem; margin-inline: auto; }
main { padding-block: 2rem 3rem; }
main > p, main > blockquote, main > ul:not(.toc), footer ul, footer p { max-width: 46rem; }
h1, h2, h3 { line-height: 1.35; text-wrap: balance; scroll-margin-top: 1rem; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); margin: 0 0 1.25rem; }
h1::after { content: ""; display: block; width: 3.5rem; height: 5px; margin-top: 0.6rem;
  border-radius: 3px; background: var(--shell); }
h2 { font-size: 1.45rem; margin: 3.25rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin: 2.25rem 0 0.5rem; }
p { margin: 0.6rem 0; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em;
  padding: 0.1em 0.35em; border-radius: 4px; background: var(--head); }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0 1.5rem; }
blockquote { margin: 0 0 1.5rem; padding: 0.8rem 1.1rem; border: 1px solid var(--note-line);
  border-radius: 10px; background: var(--note); font-size: 0.94rem; }
blockquote p { margin: 0.3rem 0; }
ul.toc { list-style: none; padding: 0; margin: 1.25rem 0 2rem; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 1.5rem; }
ul.toc li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin: 0.9rem 0 1.75rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--head); font-weight: 600; white-space: nowrap; }
td.nw { white-space: nowrap; }
td:not(.nw) { min-width: 9em; }
@media (max-width: 40rem) {
  table { font-size: 0.88rem; }
  th, td { padding: 0.45rem 0.55rem; }
}
tbody tr:nth-child(even) { background: var(--stripe); }
tbody tr:last-child td { border-bottom: 0; }
img { max-width: 100%; height: auto; }
td img { display: block; margin-inline: auto; max-width: none; }
.al-l { text-align: left; }
.al-c { text-align: center; }
.al-r { text-align: right; }
footer { padding-block: 1.5rem 5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer h2 { margin: 0 0 0.5rem; padding: 0; border: 0; font-size: 1.1rem; color: var(--ink); }
footer ul { padding-left: 1.2rem; margin: 0; }
footer li + li { margin-top: 0.4rem; }
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 1.1rem;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); }
