/* スマホ優先のシンプルなスタイル。JS・Webフォントなし。 */
:root {
  --bg: #fdfcfa;
  --fg: #222;
  --muted: #6b6b6b;
  --line: #e6e3de;
  --accent: #1f5fa8;
  --code-bg: #f2f0ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --fg: #e4e4e4;
    --muted: #9a9a9a;
    --line: #2d2f33;
    --accent: #7cb4f0;
    --code-bg: #222428;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 1.0625rem; /* 17px: スマホで読みやすい大きさ */
  line-height: 1.85;
  overflow-wrap: anywhere;
  line-break: strict;
}

.site-header, main, .site-footer {
  max-width: 42rem;
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.site-header { padding-top: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.site-title { color: var(--fg); font-weight: 700; text-decoration: none; }

main { padding-top: 1.5rem; padding-bottom: 2rem; }

a { color: var(--accent); text-underline-offset: .2em; }

h1 { font-size: 1.5rem; line-height: 1.45; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; line-height: 1.5; margin: 2.5rem 0 .75rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 2rem 0 .5rem; }
p, ul, ol, blockquote, table, pre { margin: 0 0 1.25rem; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .3rem; }

.meta { color: var(--muted); font-size: .875rem; margin-bottom: 2rem; }
.tag { margin-left: .5em; }

img { max-width: 100%; height: auto; border-radius: 4px; }

blockquote { margin-left: 0; padding: .25rem 0 .25rem 1rem; border-left: 3px solid var(--line); color: var(--muted); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--code-bg); padding: .9rem 1rem; border-radius: 6px; overflow-x: auto; line-height: 1.6; }
pre code { background: none; padding: 0; }

/* 表は横スクロールさせて画面幅を壊さない */
table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .9375rem; }
th, td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; white-space: nowrap; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* 記事一覧：行全体がタップ領域 */
.lead { color: var(--muted); font-size: .9375rem; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { margin: 0; border-bottom: 1px solid var(--line); }
.article-list a { display: block; padding: 1rem 0; color: inherit; text-decoration: none; }
.item-title { display: block; font-weight: 700; line-height: 1.5; color: var(--accent); }
.item-desc { display: block; color: var(--muted); font-size: .875rem; line-height: 1.6; margin-top: .25rem; }
.item-date { display: block; color: var(--muted); font-size: .75rem; margin-top: .25rem; }

.back { margin-top: 3rem; }
.back a { display: inline-block; padding: .5rem 0; }

.site-footer { padding-top: 1.5rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.site-footer p { margin: 0 0 .25rem; }

.ai-note { margin-top: 2.5rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
