/* Trang bài v2 — nạp sau site.css; dùng biến và component của site.css. */
.article-detail { padding-top: 8px; padding-bottom: 24px; }
.article-head { margin-bottom: 24px; }
.article-head h1 { margin-bottom: .35em; }
.article-head .meta a { color: var(--green-900); font-weight: 600; }
.article-head .meta > * + *::before { content: "·"; margin-right: 16px; color: var(--muted); }

/* Đầu bài: trả lời nhanh | ảnh */
.article-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; margin-bottom: 24px; }
.article-top .box-answer { margin: 0; display: flex; flex-direction: column; justify-content: center; font-size: 1.1rem; }
.article-top .box-answer p { margin: 0; }
.article-top .box-answer h2 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-700); font-family: var(--sans); }
.article-figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-50); }
.article-figure img { width: 100%; height: 100%; max-height: 380px; object-fit: cover; }
.article-top:not(:has(.box-answer)) { grid-template-columns: minmax(0, 1fr); }

/* Tóm tắt nhanh */
.box-takeaways ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.box-takeaways li { position: relative; padding-left: 28px; }
.box-takeaways li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: var(--green-900); color: var(--white); font-size: .75rem; line-height: 20px; text-align: center; }

/* Thân bài */
.article-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.article-aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 20px; }
.toc, .share { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.toc h2, .share h2, .article-share-m h2 { font-size: 1.05rem; margin-bottom: .6em; }
.toc ol, .toc-mobile ol { padding-left: 1.4em; display: grid; gap: 6px; font-size: .95rem; }
.toc a, .toc-mobile a { text-decoration: none; }
.toc a:hover, .toc-mobile a:hover { text-decoration: underline; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.share-links .btn { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn-share .ico { width: 20px; height: 20px; flex: none; }
.btn-fb .ico, .btn-zalo .ico { stroke: none; }
.btn-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn-fb:hover { background: #0e63d3; border-color: #0e63d3; color: #fff; }
.btn-zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.btn-zalo:hover { background: #0054cc; border-color: #0054cc; color: #fff; }
.toc-mobile, .article-share-m, .article-bar { display: none; }

/* Nội dung */
.entry-content { font-size: 1.08rem; overflow-wrap: anywhere; }
.entry-content h2 { margin-top: 1.8em; scroll-margin-top: 16px; }
.entry-content h3 { margin-top: 1.4em; scroll-margin-top: 16px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1em; }
.entry-content li + li { margin-top: .35em; }
.entry-content img { border-radius: var(--radius-sm); margin: 1em 0; }
.entry-content blockquote { margin: 1.2em 0; padding: 12px 20px; border-left: 4px solid var(--coral-500); background: var(--coral-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); }
.entry-content blockquote > :last-child { margin-bottom: 0; }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.2em 0; font-size: .96rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.entry-content th { background: var(--green-900); color: var(--white); font-weight: 700; }
.entry-content tbody tr:nth-child(even) { background: var(--white); }
.entry-content sup { font-size: .72em; line-height: 0; color: var(--coral-700); font-weight: 700; }

.article-main > section, .article-main > .box-warning { margin-top: 2.2rem; }
.article-main > .box-warning { margin-bottom: 0; }
.box-warning ul { padding-left: 1.2em; }

/* FAQ */
.article-faq ol { list-style: none; counter-reset: faq; display: grid; gap: 14px; }
.article-faq li { counter-increment: faq; position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 16px 62px; }
.article-faq li::before { content: counter(faq); position: absolute; left: 18px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--green-900); color: var(--white); font-weight: 700; line-height: 30px; text-align: center; }
.article-faq h3 { font-size: 1.1rem; margin-bottom: .3em; }
.article-faq p { margin: 0; }

/* Nguồn */
.article-sources ol { padding-left: 1.5em; display: grid; gap: 6px; }
.article-sources p { font-size: .88rem; margin: .8em 0 0; }

/* Chủ đề, tag */
.article-topic { margin: 2rem 0 .8rem; font-weight: 600; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Đọc tiếp */
.article-nav { margin-top: 2.2rem; }
.nav-card { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 16px 10px 10px; text-decoration: none; color: var(--ink); }
.nav-card:hover { border-color: var(--green-900); color: var(--ink); }
.nav-card img { width: 88px; height: 66px; object-fit: cover; border-radius: var(--radius-sm); background: var(--green-50); }
.nav-card-text { display: flex; flex-direction: column; min-width: 0; }
.nav-card-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-700); }
.nav-card-title { font-family: var(--serif); font-weight: 700; color: var(--green-900); line-height: 1.3; }
.nav-card-arrow { font-size: 1.4rem; color: var(--green-900); }
.nav-next:only-child { grid-column: 2; }

/* Bài viết liên quan */
.article-related { margin-top: 40px; }
.related-list { display: grid; gap: 16px; }
.related-list .card-row { grid-template-columns: 200px minmax(0, 1fr); }
.related-list .card-media img { height: 100%; }
.related-list .card-body { justify-content: center; gap: 6px; align-items: flex-start; }

@media (max-width: 899px) {
  .article-top { grid-template-columns: minmax(0, 1fr); }
  .article-top .box-answer { order: 0; } /* GEO: câu trả lời đứng trước ảnh trên mobile */
  .article-figure { order: 0; }
  .box-takeaways ul { grid-template-columns: minmax(0, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { display: none; }
  .toc-mobile { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 1.4rem; scroll-margin-top: 12px; }
  .toc-mobile summary { cursor: pointer; font-family: var(--serif); font-weight: 700; color: var(--green-900); }
  .toc-mobile[open] summary { margin-bottom: .6em; }
  .article-share-m { display: block; margin-top: 2rem; scroll-margin-top: 12px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .related-list .card-row { grid-template-columns: 110px minmax(0, 1fr); }
  .related-list .card-row .card-body { padding: 12px 14px; }
  .related-list .card-row h3 { font-size: 1rem; }
  .article-detail { padding-bottom: 72px; }
  .article-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--green-900); box-shadow: 0 -4px 16px rgba(31, 42, 39, .15); }
  .article-bar a { flex: 1; text-align: center; padding: 14px 8px; color: var(--white); font-weight: 700; text-decoration: none; }
  .article-bar a + a { border-left: 1px solid rgba(255, 255, 255, .25); }
  .article-bar a:hover { background: var(--green-700); color: var(--white); }
}

/* Hộp tác giả cuối bài */
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 2rem; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.author-box p { margin: 0 0 .4em; }
.author-box-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.author-box-name a { text-decoration: none; }
.author-box-role { color: var(--coral-700); font-size: .9rem; font-weight: 600; }
@media (max-width: 600px) { .author-box { padding: 16px; gap: 12px; } }
