:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1f2328;
  --text-muted: #5d646d;
  --border: #e4e1da;
  --accent: #8a5a2b;
  --accent-soft: #f3ece3;
  --radius: 10px;
  --maxw: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e8e6e3;
    --text-muted: #a3a9b0;
    --border: #2d3238;
    --accent: #d9a066;
    --accent-soft: #272220;
  }
}

:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1d2024;
  --text: #e8e6e3;
  --text-muted: #a3a9b0;
  --border: #2d3238;
  --accent: #d9a066;
  --accent-soft: #272220;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: var(--maxw); }

a { color: var(--accent); }

/* ヘッダー */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.site-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
}
.site-tagline { font-size: 13px; color: var(--text-muted); }

/* トップ */
.hero { padding: 44px 0 8px; }
.hero-title { font-size: 26px; line-height: 1.5; margin: 0 0 12px; }
.hero-lead { color: var(--text-muted); margin: 0; }

.blog-list { padding: 28px 0 56px; }
.section-title { font-size: 18px; margin: 0 0 16px; }

.blog-grid { display: flex; flex-direction: column; gap: 12px; }
.blog-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover { border-color: var(--accent); }
.blog-card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.blog-card-date { font-size: 12px; color: var(--text-muted); }
.blog-card-draft {
  font-size: 11px; padding: 1px 7px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
}
.blog-card-title { font-size: 17px; font-weight: 700; line-height: 1.6; margin-bottom: 4px; }
.blog-card-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.8; }
.blog-empty { color: var(--text-muted); }

/* 記事 */
.article { padding: 28px 0 48px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 6px; }
.article-title { font-size: 27px; line-height: 1.55; margin: 0 0 12px; }
.article-meta { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 14px; margin-bottom: 28px; }

.article-body h2 {
  font-size: 20px;
  line-height: 1.6;
  margin: 44px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.article-body h3 { font-size: 17px; margin: 30px 0 10px; }
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.article-body li { margin-bottom: 8px; }
.article-body img, .article-body svg { max-width: 100%; height: auto; }

.article-figure { margin: 0 0 28px; }
.article-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}
.article-figure-portrait img { max-width: 420px; margin: 0 auto; }
.article-figure figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.7;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 22px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14.5px;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}
.article-body th { background: var(--accent-soft); }

.article-body blockquote {
  margin: 0 0 20px;
  padding: 2px 16px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}

/* 目次 */
.toc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 36px;
}
.toc-box-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.toc-box ol { margin: 0; padding-left: 1.3em; font-size: 14px; }
.toc-box li { margin-bottom: 5px; }

/* 記事中のCTA */
.mid-cta {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 36px 0;
}
.mid-cta-title { font-weight: 700; margin-bottom: 6px; }
.mid-cta-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.mid-cta-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

/* 関連記事 */
.related-section { border-top: 1px solid var(--border); padding: 36px 0 56px; }
.related-section .container { max-width: var(--maxw); }
.section-head { margin-bottom: 16px; }
.section-tag { display: none; }
.related-grid { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
}
.related-card:hover { border-color: var(--accent); }
.related-card-date { font-size: 12px; color: var(--text-muted); }
.related-card-title { font-size: 15px; font-weight: 700; line-height: 1.6; }

/* フッター */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  background: var(--surface);
}
.footer-note, .footer-copy { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }

/* 下書きバナー */
.draft-banner {
  background: #b23b3b;
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
}

@media (max-width: 600px) {
  .article-title { font-size: 23px; }
  .hero-title { font-size: 22px; }
  .article-body h2 { font-size: 18.5px; }
}
