:root {
  --color-primary: #2563eb;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-bg: #f8fafc;
  --color-card-bg: #ffffff;
  --color-border: #e2e8f0;
  --radius: 8px;
  --max-width: 800px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ヘッダー */
.site-header {
  background: var(--color-card-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--color-primary);
}

/* メイン */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 140px);
}

/* 記事一覧 */
.post-list {
  list-style: none;
}

.post-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-card h2 {
  margin-bottom: 0.5rem;
  line-height: 1.45;
  white-space: pre-line;
}

.post-card h2 a {
  color: var(--color-text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--color-primary);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.post-excerpt {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* 記事詳細 */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.65rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  word-break: break-word;
  white-space: pre-line;
}

.post-meta-full {
  font-size: 0.9rem;
  color: var(--color-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-body {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.25rem;
}

.post-body h1 {
  font-size: 1.5rem;
  line-height: 1.4;
  margin: 2.2rem 0 1rem;
}

.post-body h2 {
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 2.2rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--color-primary);
  color: #1e293b;
}

.post-body h3 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 1.8rem 0 0.75rem;
  color: #334155;
}

.post-body h4,
.post-body h5 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 1.2rem 0 0.5rem;
  color: #475569;
}

.post-body p {
  line-height: 1.85;
  margin-bottom: 1.25rem;
  color: #334155;
}

.post-body .lead-box {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
  background: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-primary);
  margin-bottom: 2rem;
}

.post-body img {
  max-width: 100%;
  height: auto !important;
  display: block;
  margin: 1.5rem auto 0.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  object-fit: contain;
}

.post-body figcaption,
.post-body .image-caption {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 1.75rem;
}

.post-body ul,
.post-body ol {
  margin: 0.5rem 0 1.25rem 1.5rem;
  line-height: 1.8;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body a {
  color: var(--color-primary);
}

.post-body blockquote {
  border-left: 4px solid #cbd5e1;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: #f8fafc;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #475569;
}

/* タグ・カテゴリバッジ */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.badge:hover {
  opacity: 0.8;
}

.badge-category {
  background: #dbeafe;
  color: #1e40af;
}

.badge-tag {
  background: #f0fdf4;
  color: #166534;
}

/* タグ一覧・カテゴリ一覧 */
.tag-list,
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
}

.tag-list .badge,
.category-list .badge {
  font-size: 0.95rem;
  padding: 0.4rem 1rem;
}

/* ページタイトル */
.page-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

/* 戻るリンク */
.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--color-primary);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* フッター */
.site-footer {
  background: var(--color-card-bg);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

/* レスポンシブ */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav {
    gap: 1rem;
  }

  .post-body {
    padding: 1.25rem;
  }

  .post-header h1 {
    font-size: 1.5rem;
  }
}
/* Thumbnails */
.post-thumbnail { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--border-color); display: block; border-radius: 8px 8px 0 0; }
.post-card { padding: 0; overflow: hidden; }
.post-card-content { padding: 1.5rem; }
