/* ====================================================================
   VGP — CSS GIAO DIỆN (bài viết · danh mục · FAQ · mục lục)
   Gộp 3 snippet cũ: 'CSS bài viết' + 'CSS FAQ' + 'CSS mục lục'.
   Đã BỎ snippet 'CSS cho note' (trùng .vgp-note — mục 9 bên dưới đã có).
   Nguồn: export Perfmatters kesatviengiaphat.com 20/06/2026.
   ==================================================================== */

/* --- BIẾN MÀU (Đã đồng bộ với màu Logo cũ) --- */
:root {
    --vgp-blue: #1e73be; /* Màu xanh gốc của web cũ */
    --vgp-green: #2CA837; /* Màu xanh lá điểm nhấn */
    --vgp-bg-light: #F0F8FF;
    --vgp-text: #333333;
    --vgp-step-bg: #fff;
}

/* --- WRAPPER BÀI VIẾT (.vgp-category-content) --- */
/* Chỉ áp dụng style cho nội dung nằm trong class này */

/* 1. Reset & Typography */
.vgp-category-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--vgp-text);
    text-align: left;
    padding-left: 16px;
    padding-right: 16px;
}

/* a11y: link trong đoạn văn có gạch chân (không chỉ phân biệt bằng màu) */
.vgp-category-content p a { text-decoration: underline; }

/* 2. Tiêu đề H2, H3 */
.vgp-category-content h2 {
    background-color: var(--vgp-bg-light);
    color: var(--vgp-blue);
    padding: 10px 15px;
    border-left: 5px solid var(--vgp-green);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 20px;
    border-radius: 3px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

.vgp-category-content h3 {
    color: var(--vgp-text);
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--vgp-green);
    display: inline-block;
    padding-bottom: 3px;
}

/* 3. Danh sách ưu điểm (UL - Dấu tích xanh) */
.vgp-category-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.vgp-category-content ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.vgp-category-content ul li::before {
    content: "✔"; 
    position: absolute;
    left: 0;
    top: 0;
    color: var(--vgp-green); 
    font-weight: bold;
    font-size: 1.1rem;
}

/* 4. Quy trình thực hiện (OL - Card Style) */
.vgp-category-content ol {
    counter-reset: vgp-counter;
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

.vgp-category-content ol li {
    position: relative;
    background-color: var(--vgp-step-bg);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px 15px 15px 60px; /* Padding cho Desktop */
    margin-bottom: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.vgp-category-content ol li:hover {
    transform: translateY(-2px);
    border-color: var(--vgp-blue);
}

.vgp-category-content ol li::before {
    counter-increment: vgp-counter;
    content: counter(vgp-counter);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-color: var(--vgp-blue);
    color: #fff;
    font-weight: bold;
    text-align: center;
    line-height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(30, 115, 190, 0.3);
}

.vgp-category-content ol li strong {
    color: var(--vgp-blue);
    display: block;
    margin-bottom: 5px;
    font-size: 1.05em;
}

/* Fix Mobile cho danh sách số */
@media (max-width: 768px) {
    .vgp-category-content ol li {
        padding-left: 45px; /* Giảm padding trên mobile */
    }
    .vgp-category-content ol li::before {
        left: 8px; /* Dịch số sát lề trái hơn */
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.9rem;
    }
}

/* 5. Hình ảnh trong bài */
.vgp-category-content img {
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

/* 6. Bảng trong bài viết (Table) */
.vgp-category-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    border: 1px solid #ddd;
}
.vgp-category-content th {
    background-color: var(--vgp-blue);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
}
.vgp-category-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}
.vgp-category-content tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 7. BOX TÓM TẮT (Giao diện Mới - Phẳng) */
.vgp-category-content .tldr-highlight-box {
    background-color: #f0fdf4;
    border: 1px dashed var(--vgp-green);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}
.vgp-category-content .tldr-title {
    color: var(--vgp-green);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
/* Reset lại style list trong box tóm tắt để không dính dấu tích xanh */
.vgp-category-content .tldr-highlight-box ul li::before {
    content: none;
}
.vgp-category-content .tldr-highlight-box ul li {
    padding-left: 0;
    list-style: disc inside;
    margin-bottom: 5px;
}

/* 8. GALLERY ẢNH (lưới ngang, dùng cho cụm ảnh sản phẩm) */
.vgp-category-content .vgp-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 20px 0;
    align-items: end;
}
.vgp-category-content .vgp-gallery figure {
    margin: 0;
}
.vgp-category-content .vgp-gallery img {
    margin: 0;
    width: 100%;
    height: auto;
    background: #fff;
}
.vgp-category-content .vgp-gallery figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
}
@media (max-width: 600px) {
    .vgp-category-content .vgp-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* 9. NOTE / CALLOUT (làm nổi bật lời khuyên, lưu ý, định nghĩa) */
.vgp-category-content .vgp-note {
    background: var(--vgp-bg-light);
    border-left: 4px solid var(--vgp-blue);
    padding: 14px 18px;
    border-radius: 6px;
    margin: 22px 0;
    line-height: 1.65;
}
.vgp-category-content .vgp-note strong { color: #155a96; }
/* Biến thể cảnh báo (vàng) */
.vgp-category-content .vgp-note.warning {
    background: #fff8e6;
    border-left-color: #e0a800;
}
.vgp-category-content .vgp-note.warning strong { color: #7a5900; }

/* 10. CTA BOX (kêu gọi hành động nổi bật) */
.vgp-category-content .vgp-cta {
    background: linear-gradient(135deg, var(--vgp-blue), #14538a);
    color: #fff;
    padding: 28px 24px;
    border-radius: 12px;
    margin: 32px 0;
    text-align: center;
    box-shadow: 0 8px 20px rgba(30,115,190,.25);
}
.vgp-category-content .vgp-cta .vgp-cta-title {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}
.vgp-category-content .vgp-cta p { color: #fff; margin: 0 0 4px; }
.vgp-category-content .vgp-cta .vgp-btn {
    display: inline-block;
    margin-top: 16px;
    background: var(--vgp-green);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 13px 32px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(44,168,55,.3);
}
.vgp-category-content .vgp-cta .vgp-btn:hover { filter: brightness(1.08); }

/* 11. ẢNH TỈ LỆ CỐ ĐỊNH (.vgp-figure) — ảnh khổ nào cũng hiển thị ĐỀU, chống lệch kích thước + chống CLS */
/* Dùng cho ảnh thân bài: bọc <figure class="vgp-figure"> quanh <img> là đủ, KHÔNG cần khai width/height thật. */
.vgp-category-content .vgp-figure { margin: 22px 0; }
.vgp-category-content .vgp-figure img {
    width: 100%;
    aspect-ratio: 16 / 9;   /* khung chừa sẵn chỗ → không nhảy layout dù chưa biết kích thước ảnh */
    object-fit: cover;       /* ảnh tự cắt vừa khung, không méo */
    height: auto;
    margin: 0;
    background: #f5f5f5;
}
.vgp-category-content .vgp-figure.ratio-4-3 img   { aspect-ratio: 4 / 3; }
.vgp-category-content .vgp-figure.ratio-square img { aspect-ratio: 1 / 1; }
.vgp-category-content .vgp-figure.ratio-wide img   { aspect-ratio: 1.91 / 1; } /* khổ hero/og:image */
.vgp-category-content .vgp-figure figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
}

/* 12. HỘP TRẢ LỜI NHANH (.vgp-quickanswer) — câu trả lời trực tiếp 40–60 từ ngay sau intro, nhắm featured snippet / AI Overview */
.vgp-category-content .vgp-quickanswer {
    background: var(--vgp-bg-light);
    border: 1px solid #cfe3f5;
    border-top: 4px solid var(--vgp-blue);
    border-radius: 8px;
    padding: 16px 20px 18px;
    margin: 0 0 28px;
    font-size: 1.05rem;
    line-height: 1.7;
}
.vgp-category-content .vgp-quickanswer::before {
    content: "⚡ TRẢ LỜI NHANH";
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--vgp-blue);
    margin-bottom: 8px;
}
.vgp-category-content .vgp-quickanswer p:last-child { margin-bottom: 0; }

/* 13. PULL-QUOTE (.vgp-pull) — câu chốt đắt làm điểm dừng mắt giữa bài */
.vgp-category-content .vgp-pull {
    border: none;
    border-left: 5px solid var(--vgp-green);
    margin: 28px 0;
    padding: 6px 0 6px 22px;
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 600;
    font-style: italic;
    color: var(--vgp-blue);
    background: none;
}
.vgp-category-content .vgp-pull p { margin: 0; }

/* 14. CHECKLIST (.vgp-checklist) — danh sách đóng hộp, người đọc chụp màn hình/lưu lại được (dấu ✔ xanh kế thừa từ mục 3) */
.vgp-category-content .vgp-checklist {
    background: #f0fdf4;
    border: 1px solid #bfe6c4;
    border-radius: 8px;
    padding: 18px 20px 18px 22px;
    margin: 24px 0;
}
.vgp-category-content .vgp-checklist li { margin-bottom: 12px; }
.vgp-category-content .vgp-checklist li:last-child { margin-bottom: 0; }

/* 15. HỘP VÍ DỤ / MINI-CASE (.vgp-example) — dẫn chứng thực tế, tăng E-E-A-T */
.vgp-category-content .vgp-example {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-left: 4px solid var(--vgp-green);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 24px 0;
    line-height: 1.65;
}
.vgp-category-content .vgp-example::before {
    content: "📌 VÍ DỤ THỰC TẾ";
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--vgp-green);
    margin-bottom: 8px;
}
.vgp-category-content .vgp-example p:last-child { margin-bottom: 0; }

/* ============================================================
   FAQ SECTION (gộp từ snippet "CSS cho FAQ") — <details>
   ============================================================ */
.faq-section { max-width: 1400px; margin: 20px auto; }
.faq-section h2 { color: #333; font-size: 20px; margin-bottom: 15px; text-align: center; }
.faq-item { border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: 8px; background: #ffffff; }
.faq-item summary {
  padding: 12px 15px; cursor: pointer; font-weight: 500; font-size: 14px; color: #333;
  background: #f8f9fa; border-radius: 6px; list-style: none;
  transition: background-color 0.2s ease; position: relative;
}
.faq-item summary:hover { background: #e9ecef; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  font-size: 16px; font-weight: bold; color: var(--vgp-blue); transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: '\2212'; transform: translateY(-50%) rotate(180deg); }
.faq-item div {
  padding: 12px 15px 15px; color: #555; font-size: 13px; line-height: 1.5;
  background: #fafbfc; border-top: 1px solid #f0f0f0;
}
.faq-item p { margin: 0; }
@media (max-width: 768px) {
  .faq-section { margin: 15px 10px; }
  .faq-item summary { padding: 10px 12px; font-size: 13px; }
  .faq-item div { padding: 10px 12px 12px; font-size: 12px; }
}

/* ============================================================
   MỤC LỤC TỰ ĐỘNG (gộp từ snippet "CSS cho mục lục") — .vgp-toc-*
   ============================================================ */
.vgp-toc-container {
  background-color: #f5f5f5; border: 1px solid #e9ecef; border-radius: 8px;
  padding: 20px; margin: 20px 0 30px 0; display: block; clear: both;
}
.vgp-toc-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--vgp-blue); padding-bottom: 12px; margin-bottom: 15px;
}
.vgp-toc-title {
  font-weight: 800; font-size: 1.1rem; color: var(--vgp-text);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.vgp-toc-toggle { font-size: 0.85rem; cursor: pointer; color: var(--vgp-blue); font-weight: 600; }
.vgp-toc-list {
  margin: 0 !important; padding: 0 !important; list-style: none !important;
  max-height: 450px; overflow-y: auto; overscroll-behavior: contain;
}
.vgp-toc-list::-webkit-scrollbar { width: 6px; }
.vgp-toc-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.vgp-toc-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.vgp-toc-list::-webkit-scrollbar-thumb:hover { background: #bbb; }
.vgp-toc-list li { margin-bottom: 8px !important; padding-left: 0 !important; line-height: 1.5; }
.vgp-toc-list li::before { content: none !important; }
.vgp-toc-list li a {
  text-decoration: none; color: #4a5568; transition: color 0.2s; font-size: 0.95rem; display: block;
}
.vgp-toc-list li a:hover { color: var(--vgp-blue); }
.vgp-toc-list li.toc-h2 a { font-weight: 600; color: #2d3748; }
.vgp-toc-list li.toc-h3 {
  margin-left: 15px !important; padding-left: 15px !important; border-left: 2px solid #e2e8f0;
}
.vgp-toc-list li.toc-h3 a { font-size: 0.9rem; color: #4a5568; }
