/* =====================================================================
   VINIS — Tin tức & White paper (v1, 03/11/2026)
   Dùng cho: tin-tuc.html, tin-tuc-bai.html, white-paper.html, white-paper-bai.html
   Trang đọc bài: 3 cột tràn gần sát 2 mép màn hình (mục lục trái · thân bài · bài liên quan phải).
   Mọi kích thước tính bằng rem/vw → co giãn theo màn hình cùng css/responsive.css,
   màn hình lớn không bị "lọt thỏm" ở giữa.
   ===================================================================== */

/* ---------- 1. Khung 3 cột của trang đọc bài ---------- */
.bv-shell {
  --bv-toc: clamp(14.5rem, 15vw, 22rem);
  --bv-rel: clamp(18rem, 19vw, 27rem);
  --bv-gap: clamp(2rem, 3vw, 4.5rem);
  --bv-body: clamp(55rem, 52vw, 64rem);          /* ~880px ở 1536px, rộng dần theo màn hình */
  padding-left: clamp(1rem, 1.6vw, 2rem);
  padding-right: clamp(1rem, 1.6vw, 2rem);
}
.bv-grid { display: block; }
.bv-col-main { max-width: var(--bv-body); margin: 0 auto; min-width: 0; }
.bv-col-toc { display: none; }
.bv-col-rel { max-width: var(--bv-body); margin: 3.5rem auto 0; min-width: 0; }
.bv-rel-side { display: grid; gap: 1.5rem; }
@media (min-width: 768px) and (max-width: 1279px) { .bv-rel-side { grid-template-columns: 1fr 1fr; } .bv-rel-side > :first-child { grid-row: span 2; } }
@media (min-width: 1280px) {
  .bv-grid { display: grid; grid-template-columns: var(--bv-toc) minmax(0, 1fr) var(--bv-rel); column-gap: var(--bv-gap); }
  .bv-col-toc { display: block; }
  .bv-col-main { width: 100%; }
  .bv-col-rel { margin: 0; max-width: none; }
  .bv-toc-mobile { display: none; }
  .bv-sticky { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; scrollbar-width: thin; }
  .bv-sticky::-webkit-scrollbar { width: 6px; }
}

/* ---------- 2. Mục lục (Tổng quan bài viết) ---------- */
.toc-link { display: block; padding: .35rem .7rem; border-radius: .5rem; font-size: .84rem; line-height: 1.45; color: #475569; border-left: 2px solid transparent; transition: background .15s, color .15s; }
.toc-link:hover { background: #fff8eb; color: #8a5506; }
.toc-link.toc-sub { padding-left: 1.45rem; font-size: .8rem; color: #64748b; }
.toc-link.active { color: #8a5506; background: #fff8eb; border-left-color: #f8ac1a; font-weight: 700; }
.toc-progress { height: 3px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.toc-progress > span { display: block; height: 100%; width: 0; background: #f8ac1a; transition: width .1s linear; }

/* Mục lục bản điện thoại / màn hẹp: bấm mở, bấm lại thì đóng (mặc định đóng) */
.bv-toc-mobile .toc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.bv-toc-mobile.open .toc-body { max-height: 70vh; overflow-y: auto; }
.bv-toc-mobile.open .toc-chev { transform: rotate(180deg); }
.toc-chev { transition: transform .25s; }

/* ---------- 3. Nội dung bài ---------- */
.article-content { color: #334155; line-height: 1.8; font-size: 1.0625rem; overflow-wrap: anywhere; }
.article-content > * + * { margin-top: 1.05rem; }
.article-content h2 { font-weight: 800; font-size: 1.6rem; line-height: 1.3; margin: 2.4rem 0 .6rem; color: #0e0e10; letter-spacing: -.01em; }
.article-content h3 { font-weight: 700; font-size: 1.22rem; line-height: 1.4; margin: 1.7rem 0 .45rem; color: #16161a; }
.article-content h4 { font-weight: 700; font-size: 1.05rem; margin: 1.3rem 0 .3rem; color: #16161a; }
.article-content h2, .article-content h3 { scroll-margin-top: 6rem; }
.article-content p { margin: 1rem 0; }
.article-content a { color: #b06d0a; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(248,172,26,.6); }
.article-content a:hover { color: #8a5506; }
.article-content ul, .article-content ol { margin: 1rem 0; padding-left: 1.4rem; }
.article-content ul { list-style: disc; } .article-content ol { list-style: decimal; }
.article-content li { margin: .45rem 0; }
.article-content li::marker { color: #d98f0a; }
.article-content strong { color: #0f172a; font-weight: 700; }
.article-content img { border-radius: .9rem; margin: 1.8rem auto; max-width: 100%; height: auto; display: block; box-shadow: 0 18px 40px -24px rgba(15,23,42,.45); }
.article-content figure { margin: 1.8rem 0; } .article-content figure img { margin: 0 auto; }
.article-content figcaption { text-align: center; font-size: .85rem; color: #64748b; margin-top: .6rem; }
.article-content blockquote { border-left: 4px solid #f8ac1a; background: #fffaf0; padding: 1rem 1.3rem; border-radius: 0 .75rem .75rem 0; color: #475569; margin: 1.5rem 0; }
.article-content blockquote p { margin: .4rem 0; }
.article-content code { background: #f1f5f9; border-radius: .3rem; padding: .1rem .35rem; font-size: .9em; }
.article-content iframe { max-width: 100%; width: 100%; aspect-ratio: 16/9; border-radius: .9rem; margin: 1.6rem 0; }
.article-content .bv-table { overflow-x: auto; margin: 1.5rem 0; border: 1px solid #e2e8f0; border-radius: .8rem; }
.article-content table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 32rem; }
.article-content th, .article-content td { border-bottom: 1px solid #e2e8f0; padding: .7rem .9rem; text-align: left; vertical-align: top; }
.article-content tr:last-child td { border-bottom: 0; }
.article-content th { background: #16161a; color: #fff; font-weight: 700; }
.article-content th strong { color: #fff; }
.article-content tbody tr:nth-child(even) td { background: #f8fafc; }

/* Khối trình bày của blog cũ (thẻ lợi ích, bước, số liệu, ô kêu gọi) → kiểu VINIS */
.article-content [class$="-grid"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.article-content [class$="-row"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.article-content [class$="-card"], .article-content .stat-item { border: 1px solid #e2e8f0; background: #f8fafc; border-radius: .9rem; padding: 1.15rem 1.2rem; }
.article-content [class$="-card"] > * + *, .article-content .stat-item > * + * { margin-top: .4rem; }
.article-content [class$="-card"] h3, .article-content [class$="-card"] h4 { margin: .5rem 0 .3rem; font-size: 1.02rem; }
.article-content [class$="-card"] p { margin: .3rem 0; font-size: .95rem; line-height: 1.65; }
.article-content [class$="-card"] .icon { width: 2.6rem; height: 2.6rem; border-radius: .7rem; background: #fff8eb; color: #b06d0a; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.article-content .stat-item { text-align: center; }
.article-content .number { font-weight: 800; font-size: 1.9rem; color: #b06d0a; line-height: 1.1; }
.article-content .label, .article-content .level { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.article-content .name { font-weight: 700; color: #0f172a; }
.article-content .desc { font-size: .92rem; color: #475569; }
.article-content .step-item { display: flex; gap: 1rem; align-items: flex-start; margin: 1rem 0; }
.article-content .step-circle { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 999px; background: #f8ac1a; color: #0e0e10; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.article-content .step-text { flex: 1; min-width: 0; }
.article-content .cta-box { background: #16161a radial-gradient(circle at 15% 0%, rgba(248,172,26,.25), transparent 55%); color: #cbd5e1; border-radius: 1.1rem; padding: 1.8rem 1.6rem; text-align: center; margin: 2.2rem 0; }
.article-content .cta-box .title { color: #fff; font-weight: 800; font-size: 1.25rem; margin: 0 0 .3rem; }
.article-content .cta-box .sub { color: #fbc04f; font-size: .9rem; margin: 0 0 1rem; }
.article-content .cta-box p { margin: .4rem 0; }
.article-content .cta-box strong { color: #fff; }
.article-content .cta-box a { color: #fbc04f; }
.article-content .cta-box a.cta-btn, .article-content a.cta-btn { display: inline-flex; align-items: center; gap: .4rem; background: #f8ac1a; color: #0e0e10 !important; font-weight: 700; text-decoration: none; padding: .75rem 1.5rem; border-radius: .6rem; font-size: .9rem; margin: .25rem; transition: background .15s; }
.article-content a.cta-btn:hover { background: #fbc04f; }
.article-content .cta-box a.cta-btn[style*="background"] { background: #fff !important; }

/* White paper: hộp "Bạn sẽ nắm được", ghi chú, mẹo */
.article-content .wp-note { border: 1px solid #fcd88f; background: #fff8eb; border-radius: .9rem; padding: 1rem 1.2rem; font-size: .97rem; }
.article-content .wp-note > :first-child { margin-top: 0; } .article-content .wp-note > :last-child { margin-bottom: 0; }
.article-content .wp-tip { display: flex; gap: .8rem; border-left: 4px solid #16161a; background: #f8fafc; border-radius: 0 .8rem .8rem 0; padding: .9rem 1.1rem; font-size: .97rem; }
.article-content .wp-tip i { color: #d98f0a; margin-top: .3rem; }
.article-content .wp-tip p { margin: 0; }
.article-content .wp-steps { counter-reset: s; list-style: none; padding-left: 0; }
.article-content .wp-steps > li { counter-increment: s; position: relative; padding-left: 2.6rem; margin: .9rem 0; }
.article-content .wp-steps > li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 1.8rem; height: 1.8rem; border-radius: 999px; background: #16161a; color: #f8ac1a; font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; }

/* ---------- 4. Thẻ bài (trang danh sách + bài liên quan) ---------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bv-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.bv-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -22px rgba(176,109,10,.35); border-color: #fcd88f; }
.bv-card:hover .bv-thumb img { transform: scale(1.04); }
.bv-thumb img { transition: transform .4s ease; }
.bv-chip { transition: background .15s, color .15s, border-color .15s; }
.bv-chip.active { background: #16161a; color: #fff; border-color: #16161a; }
.bv-chip.active .bv-count { background: #f8ac1a; color: #0e0e10; }

/* Lưới bài: 3 cột, màn rất rộng 4 cột */
.bv-list { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .bv-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1900px) { .bv-list.bv-list-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Bản in: chỉ in thân bài */
@media print {
  #header, footer, .bv-col-toc, .bv-col-rel, .bv-no-print, .fixed { display: none !important; }
  .bv-grid { display: block !important; }
}
