/* public-blog.css — blog list + article, on the shared design tokens (public-site.css) */
:root { --text-secondary: var(--text-2); --text-tertiary: var(--muted); --primary-600: var(--primary-text); }

#read-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #6366F1, #2563EB, #10B981); z-index: 1100; }

/* ── List page ── */
.blog-hero { position: relative; overflow: hidden; text-align: center; padding: 56px 0 44px; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.blog-hero::before { content: ""; position: absolute; top: -220px; left: 50%; width: 900px; height: 420px; transform: translateX(-50%); background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.blog-hero-content { position: relative; max-width: 720px; margin: 0 auto; padding: 0 20px; }
.blog-hero-badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.blog-hero h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.035em; }
.blog-hero p { color: var(--muted); margin-top: 10px; font-size: 17px; }
.blog-search-wrap { margin: 26px auto 0; max-width: 520px; }
.blog-search-inner { display: flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.blog-search-inner input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; padding: 10px 18px; outline: none; }
.blog-search-inner button { border: 0; background: var(--primary); color: #fff; width: 44px; border-radius: 999px; }
.blog-search-inner button:hover { background: var(--primary-hover); }

.cat-tabs-wrap { border-bottom: 1px solid var(--border); background: var(--surface); }
.cat-tabs { max-width: var(--maxw); margin: 0 auto; padding: 12px 24px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.cat-tab { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); text-decoration: none !important; white-space: nowrap; }
.cat-tab:hover { background: var(--surface-2); color: var(--text); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.blog-main { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 72px; }
.section-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { font-size: 24px; font-weight: 800; white-space: nowrap; }
.section-heading .sep { flex: 1; height: 1px; background: var(--border); }
.result-info { color: var(--muted); margin: -8px 0 20px; font-size: 14.5px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.blog-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: inherit; text-decoration: none !important; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.blog-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.45); }
.card-img-box { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card .card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.card-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.3; color: var(--text); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-excerpt { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.card-meta-author { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.card-meta-date { font-size: 12.5px; color: var(--muted); }
.card-read-btn { font-weight: 700; font-size: 13.5px; color: var(--primary-text); white-space: nowrap; }
.no-results { grid-column: 1 / -1; text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.no-results .emoji { font-size: 44px; }
.no-results h3 { margin: 8px 0 6px; }
.no-results p { color: var(--muted); }
.no-results a { display: inline-block; margin-top: 14px; font-weight: 600; }
.pagination-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 40px; }
.pag-link { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; text-decoration: none !important; }
.pag-link:hover { background: var(--surface-2); }
.pag-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dots { align-self: center; color: var(--muted); padding: 0 4px; }
.pag-info { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 12px; }

/* ── Article page ── */
.detail-topbar { border-bottom: 1px solid var(--border); background: var(--surface); }
.detail-topbar-inner { max-width: 1000px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.breadcrumb-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); min-width: 0; }
.breadcrumb-nav a { color: var(--muted); }
.breadcrumb-nav a:hover { color: var(--text); }
.article-wrap { max-width: 800px; margin: 0 auto; padding: 36px 24px 72px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 22px; text-decoration: none !important; }
.back-btn:hover { color: var(--text); }
.article-cat { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; text-decoration: none !important; }
.article-title { font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; letter-spacing: -.035em; line-height: 1.15; margin: 16px 0 20px; }
.article-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.meta-author { display: flex; align-items: center; gap: 12px; }
.author-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #4F46E5, #2563EB); }
.meta-author-name { font-weight: 700; font-size: 15px; }
.meta-author-sub { font-size: 13px; color: var(--muted); }
.meta-divider { width: 1px; height: 28px; background: var(--border-strong); }
.meta-stat { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.article-thumbnail { margin: 26px 0 8px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.article-thumbnail img { display: block; width: 100%; height: auto; }

.article-content { margin-top: 26px; font-size: 17.5px; line-height: 1.8; color: var(--text-2); overflow-wrap: anywhere; }
.article-content h2 { font-size: 28px; font-weight: 800; margin: 42px 0 14px; color: var(--text); }
.article-content h3 { font-size: 22px; font-weight: 700; margin: 30px 0 10px; color: var(--text); }
.article-content h4 { font-size: 18px; font-weight: 700; margin: 24px 0 8px; color: var(--text); }
.article-content p { margin: 0 0 18px; }
.article-content ul, .article-content ol { margin: 0 0 20px 1.4rem; list-style: revert; padding: 0; }
.article-content li { margin-bottom: 8px; }
.article-content a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.article-content strong { color: var(--text); }
.article-content img { max-width: 100%; height: auto; border-radius: 12px; }
.article-content blockquote { margin: 22px 0; padding: 14px 20px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 12px 12px 0; color: var(--text); }
.article-content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15.5px; display: block; overflow-x: auto; }
.article-content th, .article-content td { border: 1px solid var(--border-strong); padding: 10px 14px; text-align: left; }
.article-content th { background: var(--surface-2); color: var(--text); }
.article-content pre, .article-content code { font-family: var(--font-mono); font-size: .9em; }
.article-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.article-content pre { background: var(--code-bg); color: var(--code-text); padding: 16px; border-radius: 12px; overflow-x: auto; margin: 20px 0; }
.article-content pre code { background: transparent; padding: 0; }
.article-content iframe, .article-content video { max-width: 100%; }
.article-divider { height: 1px; background: var(--border); margin: 36px 0 24px; }
.tags-section { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 26px; }
.tag-pill { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); text-decoration: none !important; }
.tag-pill:hover { color: var(--primary-text); border-color: var(--primary); }
.share-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow); }
.share-section h4 { font-size: 15px; margin-bottom: 12px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #fff !important; text-decoration: none !important; }
.share-wa { background: #25D366; } .share-fb { background: #1877F2; } .share-tw { background: #0F1419; } .share-tg { background: #229ED9; } .share-li { background: #0A66C2; }
.share-btn:hover { filter: brightness(1.08); }
.related-section { margin-top: 44px; }
.related-title { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: inherit; text-decoration: none !important; transition: transform .2s, border-color .2s; }
.related-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,.45); }
.related-card-img { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-card-body { padding: 14px 16px 16px; }
.related-card-cat { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.related-card-title { font-weight: 700; line-height: 1.35; margin: 4px 0 6px; color: var(--text); }
.related-card-date { font-size: 12.5px; color: var(--muted); }

@media (max-width: 960px) { .blog-grid, .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .blog-grid, .related-grid { grid-template-columns: 1fr; }
  .blog-main { padding: 28px 16px 56px; }
  .article-wrap { padding: 24px 16px 56px; }
  .article-content { font-size: 16.5px; }
  .article-content h2 { font-size: 24px; }
  .meta-divider { display: none; }
  .cat-tabs { padding: 10px 16px; }
}
