/* デジタルDIY ブログ — 一覧・記事ページ */

.breadcrumb { font-size: 12px; color: var(--text-sub); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span { color: var(--navy); font-weight: 700; }

.page-h1 { font-family: var(--serif); font-size: clamp(28px, 4.5vw, 42px); color: var(--navy-dark); line-height: 1.2; margin-bottom: 8px; }

/* ── レイアウト (一覧) ── */
.blog-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; margin-top: 28px; align-items: start; }
@media (max-width: 900px) { .blog-layout { grid-template-columns: 1fr; } }

.blog-search { display: flex; gap: 8px; margin-bottom: 24px; }
.blog-search input { flex: 1; padding: 10px 14px; font-size: 15px; border: 1.5px solid var(--border); border-radius: 8px; }

/* ── 記事カード一覧 ── */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-link { display: block; color: inherit; text-decoration: none; }
.post-link:hover { text-decoration: none; }
.post-thumb { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--navy), var(--navy-light)); display: flex; align-items: center; justify-content: center; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-thumb-fallback { color: rgba(255,255,255,.5); font-size: 36px; }
.post-info { padding: 14px 16px 16px; }
.post-cat { display: inline-block; font-size: 11px; color: var(--yellow-dark); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 4px; }
.post-title { font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--navy-dark); margin-bottom: 6px; font-weight: 700; }
.post-excerpt { font-size: 13px; color: var(--text-sub); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { font-size: 11px; color: #999; margin-top: 8px; }

.empty { color: var(--text-sub); padding: 80px 20px; text-align: center; }

/* ── ページネーション ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--navy); background: #fff; border: 1px solid var(--border); }
.pagination a:hover { background: var(--bg-soft); }
.pagination .pg-current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── サイドバー ── */
.blog-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.side-card h3 { font-family: var(--serif); font-size: 14px; color: var(--navy-dark); margin-bottom: 10px; }
.side-list { list-style: none; }
.side-list li { padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f0f1f5; }
.side-list li:last-child { border-bottom: 0; }
.side-list a { color: var(--text); text-decoration: none; display: block; }
.side-list a:hover { color: var(--navy); }
.side-list a.active { color: var(--navy); font-weight: 800; }
.cta-card { background: linear-gradient(135deg, #f8fafc, #fff); border: 1.5px solid var(--yellow); }
.cta-card p { font-size: 12px; color: var(--text-sub); margin: 8px 0 12px; line-height: 1.6; }

/* ── 記事ページ ── */
.article-wrap { padding-top: 24px; }
.article {
  max-width: 760px; margin: 0 auto; padding: 0 20px;
  background: #fff; border-radius: 0;
}
.article-cat { display: inline-block; font-size: 12px; color: var(--yellow-dark); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 12px; }
.article-title { font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); line-height: 1.3; color: var(--navy-dark); margin-bottom: 14px; }
.article-meta { font-size: 13px; color: var(--text-sub); margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.article-fi { width: 100%; max-width: 760px; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; margin-bottom: 28px; box-shadow: var(--shadow-md); }

.article-toc { background: var(--bg-soft); border-radius: 10px; padding: 16px 20px; margin-bottom: 28px; border-left: 3px solid var(--yellow); }
.article-toc strong { display: block; font-size: 14px; color: var(--navy); margin-bottom: 8px; }
.article-toc ol { list-style: none; counter-reset: toc; }
.article-toc li { counter-increment: toc; padding: 4px 0; font-size: 13px; }
.article-toc li::before { content: counter(toc) ". "; color: var(--yellow-dark); font-weight: 700; margin-right: 4px; }
.article-toc li.lv-3 { padding-left: 18px; font-size: 12px; color: var(--text-sub); }
.article-toc li.lv-3::before { content: "・"; }
.article-toc a { color: var(--text); text-decoration: none; }
.article-toc a:hover { color: var(--navy); text-decoration: underline; }

/* ── 記事本文 (Markdown rendered) ── */
.article-body { font-size: 16px; line-height: 1.85; color: #2a2f3a; }
.article-body p { margin: 18px 0; }
.article-body h2 { font-family: var(--serif); font-size: clamp(20px, 3vw, 26px); color: var(--navy-dark); margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--yellow); }
.article-body h3 { font-family: var(--serif); font-size: clamp(18px, 2.5vw, 22px); color: var(--navy); margin: 28px 0 10px; }
.article-body h4 { font-size: 16px; color: var(--navy); margin: 20px 0 8px; }
.article-body ul, .article-body ol { margin: 14px 0 14px 28px; }
.article-body li { margin: 4px 0; }
.article-body a { color: var(--navy); border-bottom: 1px solid var(--yellow); }
.article-body a:hover { background: rgba(255,193,7,.1); }
.article-body strong { color: var(--navy-dark); }
.article-body em { font-style: italic; }
.article-body blockquote { background: var(--bg-soft); border-left: 4px solid var(--yellow); margin: 20px 0; padding: 14px 18px; color: #4b5563; border-radius: 0 8px 8px 0; }
.article-body blockquote p { margin: 6px 0; }
.article-body img { width: 100%; max-width: 760px; border-radius: 10px; margin: 20px 0; box-shadow: var(--shadow-sm); }
.article-body code { background: #f1f3f7; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #d33a3a; font-family: 'SF Mono', Menlo, monospace; }
.article-body pre { background: #1a1d24; color: #e5e7eb; padding: 16px 20px; border-radius: 10px; overflow-x: auto; margin: 20px 0; font-size: 13px; line-height: 1.6; }
.article-body pre code { background: transparent; color: inherit; padding: 0; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.article-tags { margin: 28px 0 12px; }
.article-tags .tag { display: inline-block; background: var(--bg-soft); color: var(--navy); padding: 4px 10px; border-radius: 99px; font-size: 12px; margin-right: 6px; margin-bottom: 6px; font-weight: 700; }

.share-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-btn { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; border: 0; font-family: inherit; }
.share-btn.x { background: #000; color: #fff; }
.share-btn.fb { background: #1877f2; color: #fff; }
.share-btn.line { background: #06C755; color: #fff; }
.share-btn.copy { background: var(--bg-soft); color: var(--navy); border: 1px solid var(--border); }

.article-cta {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: #fff; padding: 28px 24px; border-radius: 14px; margin: 32px 0;
  text-align: center;
}
.article-cta h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; color: var(--yellow); }
.article-cta p { font-size: 13px; opacity: .85; margin-bottom: 14px; }

@media (max-width: 600px) {
  .article-body { font-size: 15px; }
  .post-list { grid-template-columns: 1fr; }
}
