/* 
 * XD Extra - Main Style
 * Author: vinhxd.com 
 */

/* 1. GIAO DIỆN TRANG COMING SOON */
.xd-icon img{max-width: 28px;}
.xd-cs-body {
    text-align: center; 
    padding: 150px 20px; 
    background: #f9f9f9; 
    font-family: 'Be Vietnam Pro', sans-serif;
}

.xd-cs-container {
    max-width: 600px; 
    margin: 0 auto; 
    background: #fff; 
    padding: 50px; 
    border-radius: 15px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.xd-cs-container h1 {
    color: #e31b23;
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* 2. BỘ NÚT LIÊN HỆ VINFAST STYLE (RING & SHINE) */
.xd-contact-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
}

.xd-btn {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 25px;
    font-family: 'Be Vietnam Pro', sans-serif;
    position: relative;
}

.xd-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    animation: xd-wiggle 2s infinite;
}

.xd-icon svg {
    width: 25px;
    height: 25px;
    fill: #fff;
}

/* Hiệu ứng lan tỏa 3 lớp */
.xd-icon::before, .xd-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
}

.xd-icon::before { animation: xd-pulse 2s infinite; }
.xd-icon::after { animation: xd-pulse 2s infinite 0.5s; }

.xd-body {
    color: #fff;
    padding: 8px 20px 8px 40px;
    border-radius: 30px;
    margin-left: -30px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Màu sắc Phone & Zalo */
.xd-phone .xd-icon, .xd-phone .xd-body { background: #e31b23; }
.xd-phone .xd-icon::before, .xd-phone .xd-icon::after { background: rgba(227, 27, 35, 0.4); }

.xd-zalo .xd-icon, .xd-zalo .xd-body { background: #0068ff; }
.xd-zalo .xd-icon::before, .xd-zalo .xd-icon::after { background: rgba(0, 104, 255, 0.4); }

/* Animation Rung & Lan tỏa */
@keyframes xd-wiggle {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50%, 70% { transform: rotate(-15deg); }
    20%, 40%, 60%, 80% { transform: rotate(15deg); }
}

@keyframes xd-pulse {
    0% { width: 100%; height: 100%; opacity: 0.6; }
    100% { width: 200%; height: 200%; opacity: 0; }
}

/* 3. GALLERY HÌNH ẢNH XE — main + thumbnails */
.xd-gallery-wrap {
    width: 100%;
    font-size: 0;
}

/* Ảnh lớn */
.xd-gallery-main-wrap {
    position: relative;
    width: 100%;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.xd-gallery-main-img {
    width: 100%;
    height: 100%;
}

.xd-gallery-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .25s;
}

/* Badge giảm giá */
.xd-gallery-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #e31b23;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Be Vietnam Pro', sans-serif;
}

/* Nút phóng to */
.xd-gallery-expand {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255,255,255,.85);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background .2s;
}
.xd-gallery-expand:hover { background: #fff; }
.xd-gallery-expand svg { width: 20px; height: 20px; fill: #333; }

/* Dải thumbnail */
.xd-gallery-thumbs-wrap {
    margin-top: 10px;
    overflow: hidden;
}

.xd-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.xd-gallery-thumbs::-webkit-scrollbar { height: 4px; }
.xd-gallery-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.xd-gallery-thumb-item {
    flex: 0 0 calc(25% - 6px);
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s;
}

.xd-gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.xd-gallery-thumb-item:hover img { transform: scale(1.06); }

.xd-gallery-thumb-item.xd-thumb-active {
    border-color: #e31b23;
}

/* Lightbox */
.xd-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.xd-lightbox.xd-lightbox-open { display: flex; }
.xd-lightbox-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.xd-lightbox-inner img { max-width: 100%; max-height: 92vh; border-radius: 6px; display: block; }
.xd-lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #333;
    font-weight: 700;
}


/* 4. TIN TỨC — 1 lớn trái + 4 nhỏ phải */
.xd-news-section {
    display: flex;
    gap: 20px;
    font-family: 'Be Vietnam Pro', sans-serif;
    margin: 30px 0;
}

/* Cột lớn bên trái (chiếm ~55%) */
.xd-news-big {
    flex: 0 0 55%;
    max-width: 55%;
}

.xd-news-big-item {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.xd-news-big-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 10px;
}

.xd-news-big-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}
.xd-news-big-item:hover .xd-news-big-thumb img { transform: scale(1.04); }

.xd-news-big-body { padding: 14px 0 0; }

.xd-news-date {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 6px;
}

.xd-news-title-big {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 10px;
    line-height: 1.4;
}
.xd-news-big-item:hover .xd-news-title-big { color: #e31b23; }

.xd-news-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cột nhỏ bên phải (chiếm ~45%) */
.xd-news-list-small {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xd-news-small-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
}
.xd-news-small-item:last-child { border-bottom: none; padding-bottom: 0; }

.xd-news-small-thumb {
    flex: 0 0 100px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
}
.xd-news-small-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.xd-news-small-item:hover .xd-news-small-thumb img { transform: scale(1.06); }

.xd-news-small-body { flex: 1; }

.xd-news-title-small {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 4px 0 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xd-news-small-item:hover .xd-news-title-small { color: #e31b23; }


/* RESPONSIVE CHO MOBILE */
@media (max-width: 768px) {
    .xd-body { display: none; }
    .xd-icon { margin-left: 0; }

    /* Gallery thumbnails: hiển thị 3 trên mobile */
    .xd-gallery-thumb-item { flex: 0 0 calc(33.333% - 6px); }

    /* Tin tức: stack dọc */
    .xd-news-section { flex-direction: column; gap: 0; }
    .xd-news-big { flex: none; max-width: 100%; margin-bottom: 20px; }
    .xd-news-title-big { font-size: 16px; }
    .xd-news-small-thumb { flex: 0 0 80px; height: 58px; }
    .xd-news-title-small { font-size: 13px; }
}

/* ============================================================
   5. ARCHIVE PAGE — VinFast Style
   ============================================================ */

/* Hero strip */
.xd-arc-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 28px 0 22px;
    margin-bottom: 32px;
}
.xd-arc-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    margin: 8px 0 0;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.xd-breadcrumb {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,.65);
}
.xd-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.xd-breadcrumb a:hover { color: #fff; }
.xd-bc-sep { margin: 0 6px; }

/* Layout 2 cột */
.xd-arc-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.xd-arc-main { flex: 1; min-width: 0; }
.xd-arc-sidebar { flex: 0 0 300px; }

/* Grid 3 cột bài viết */
.xd-arc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

/* Card */
.xd-arc-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
}
.xd-arc-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    transform: translateY(-3px);
}

/* Thumbnail + badge ngày */
.xd-arc-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.xd-arc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}
.xd-arc-card:hover .xd-arc-thumb img { transform: scale(1.06); }

.xd-arc-date-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #e31b23;
    color: #fff;
    border-radius: 6px;
    text-align: center;
    padding: 4px 10px;
    line-height: 1;
    font-family: 'Be Vietnam Pro', sans-serif;
}
.xd-arc-day   { display: block; font-size: 20px; font-weight: 800; }
.xd-arc-month { display: block; font-size: 11px; text-transform: uppercase; opacity: .9; margin-top: 1px; }

/* Body */
.xd-arc-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.xd-arc-cat {
    font-size: 11px;
    font-weight: 700;
    color: #e31b23;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-decoration: none;
}
.xd-arc-cat:hover { text-decoration: underline; }

.xd-arc-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xd-arc-card-title a { color: inherit; text-decoration: none; }
.xd-arc-card:hover .xd-arc-card-title a { color: #e31b23; }

.xd-arc-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.55;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xd-arc-readmore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #e31b23;
    text-decoration: none;
    margin-top: auto;
}
.xd-arc-readmore svg { width: 14px; height: 14px; stroke: #e31b23; stroke-width: 2.5; fill: none; transition: transform .2s; }
.xd-arc-readmore:hover svg { transform: translateX(3px); }

/* Pagination */
.xd-arc-pagination { margin: 10px 0 40px; }
.xd-arc-pagination .page-numbers {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin: 2px;
    transition: background .2s, color .2s;
}
.xd-arc-pagination .page-numbers.current,
.xd-arc-pagination .page-numbers:hover { background: #e31b23; color: #fff; }


/* ============================================================
   6. SINGLE POST — VinFast Style
   ============================================================ */

.xd-single-page { padding: 0 0 60px; }

.xd-single-breadcrumb { padding: 18px 0 0; font-size: 13px; color: #888; }
.xd-single-breadcrumb a { color: #555; text-decoration: none; }
.xd-single-breadcrumb a:hover { color: #e31b23; }

/* Layout 2 cột */
.xd-single-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 20px;
}
.xd-single-main    { flex: 1; min-width: 0; }
.xd-single-sidebar { flex: 0 0 300px; }

/* Category label */
.xd-single-cat-label {
    display: inline-block;
    background: #e31b23;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 12px;
}

/* Tiêu đề bài */
.xd-single-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: #111;
    line-height: 1.35;
    margin: 0 0 14px;
}

/* Meta */
.xd-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #888;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    font-family: 'Be Vietnam Pro', sans-serif;
}
.xd-meta-item { display: flex; align-items: center; gap: 5px; }
.xd-meta-item svg { width: 15px; height: 15px; fill: #bbb; }

/* Ảnh đại diện */
.xd-single-featured-img {
    margin-bottom: 24px;
    border-radius: 10px;
    overflow: hidden;
}
.xd-featured-img { width: 100%; height: auto; display: block; }

/* Mục lục */
.xd-toc {
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    border-left: 4px solid #e31b23;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
    font-family: 'Be Vietnam Pro', sans-serif;
}
.xd-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: #222;
    margin-bottom: 12px;
}
.xd-toc-header svg { width: 18px; height: 18px; fill: #e31b23; flex-shrink: 0; }
.xd-toc-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #e31b23;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
}
#xd-toc-list { list-style: none; padding: 0; margin: 0; }
#xd-toc-list li { padding: 4px 0; }
#xd-toc-list li a { font-size: 14px; color: #333; text-decoration: none; line-height: 1.5; }
#xd-toc-list li a:hover { color: #e31b23; text-decoration: underline; }
.xd-toc-h3 { padding-left: 18px !important; }
.xd-toc-h3 a { font-size: 13px !important; color: #555 !important; }

/* Nội dung bài */
.xd-single-content {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}
.xd-single-content h2 {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e31b23;
}
.xd-single-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 26px 0 10px;
}
.xd-single-content h4 { font-size: 16px; font-weight: 700; color: #333; margin: 20px 0 8px; }
.xd-single-content p  { margin: 0 0 16px; }
.xd-single-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; display: block; }
.xd-single-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.xd-single-content table th { background: #e31b23; color: #fff; padding: 10px 14px; text-align: left; font-weight: 700; }
.xd-single-content table td { padding: 9px 14px; border-bottom: 1px solid #eee; }
.xd-single-content table tr:nth-child(even) td { background: #fafafa; }
.xd-single-content blockquote { border-left: 4px solid #e31b23; background: #fff5f5; padding: 14px 20px; margin: 20px 0; border-radius: 0 8px 8px 0; font-style: italic; color: #555; }
.xd-single-content ul, .xd-single-content ol { padding-left: 24px; margin: 0 0 16px; }
.xd-single-content li { margin-bottom: 6px; }
.xd-single-content a { color: #e31b23; }
.xd-single-content a:hover { text-decoration: underline; }
.xd-single-content strong { font-weight: 700; color: #111; }

/* Tags */
.xd-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 28px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-family: 'Be Vietnam Pro', sans-serif;
}
.xd-single-tags svg { width: 16px; height: 16px; fill: #aaa; }
.xd-tag-pill {
    display: inline-block;
    background: #f5f5f5;
    color: #555;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.xd-tag-pill:hover { background: #e31b23; color: #fff; }

/* Share bar */
.xd-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 0;
    font-family: 'Be Vietnam Pro', sans-serif;
}
.xd-share-label { font-size: 14px; font-weight: 700; color: #333; }
.xd-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: opacity .2s;
}
.xd-share-btn:hover { opacity: .85; }
.xd-share-btn svg { width: 16px; height: 16px; fill: #fff; }
.xd-share-fb   { background: #1877f2; }
.xd-share-zalo { background: #0068ff; }

/* Bài viết liên quan (dưới nội dung — ẩn trên desktop, hiện trên mobile) */
.xd-related-posts { margin-top: 36px; }
.xd-related-mobile { display: none; }
.xd-related-title { font-size: 18px; font-weight: 800; color: #111; margin-bottom: 16px; font-family: 'Be Vietnam Pro', sans-serif; }
.xd-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.xd-related-card { text-decoration: none; color: #222; display: block; }
.xd-related-thumb { aspect-ratio: 16/10; overflow: hidden; border-radius: 8px; margin-bottom: 8px; }
.xd-related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.xd-related-card:hover .xd-related-thumb img { transform: scale(1.05); }
.xd-related-card-title { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xd-related-card:hover .xd-related-card-title { color: #e31b23; }


/* ============================================================
   7. SIDEBAR CHUNG
   ============================================================ */

.xd-sb-block {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    padding: 20px;
    margin-bottom: 20px;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.xd-sb-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #111;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
}
.xd-sb-title span {
    border-left: 4px solid #e31b23;
    padding-left: 10px;
}

/* Bài viết sidebar */
.xd-sb-recent-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.xd-sb-recent-item:last-child { border-bottom: none; }
.xd-sb-recent-thumb {
    flex: 0 0 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}
.xd-sb-recent-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.xd-sb-recent-item:hover .xd-sb-recent-thumb img { transform: scale(1.06); }
.xd-sb-recent-body { flex: 1; }
.xd-sb-recent-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xd-sb-recent-item:hover .xd-sb-recent-title { color: #e31b23; }
.xd-sb-recent-date { font-size: 11px; color: #aaa; }

/* CTA sidebar */
.xd-sb-cta {
    background: linear-gradient(135deg, #1a1a2e, #0f3460) !important;
    text-align: center;
    color: #fff;
}
.xd-sb-cta-icon { font-size: 36px; margin-bottom: 10px; }
.xd-sb-cta-text { font-size: 14px; color: rgba(255,255,255,.9); line-height: 1.5; margin: 0 0 16px; }
.xd-sb-cta-text strong { color: #fff; }
.xd-sb-cta-btn {
    display: block;
    background: #e31b23;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
    transition: background .2s;
}
.xd-sb-cta-btn:hover { background: #c41019; }
.xd-sb-cta-btn--zalo { background: #0068ff !important; }
.xd-sb-cta-btn--zalo:hover { background: #005ce6 !important; }

/* Sticky CTA */
.xd-sb-cta-sticky { transition: box-shadow .3s; }
.xd-sb-is-sticky { position: sticky; top: 80px; }


/* ============================================================
   8. RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .xd-arc-grid { grid-template-columns: repeat(2, 1fr); }
    .xd-arc-sidebar, .xd-single-sidebar { flex: 0 0 260px; }
}

@media (max-width: 768px) {
    /* Archive */
    .xd-arc-layout { flex-direction: column; }
    .xd-arc-sidebar { display: none; } /* Ẩn sidebar trên mobile */
    .xd-arc-grid { grid-template-columns: 1fr; gap: 16px; }
    .xd-arc-title { font-size: 20px; }

    /* Single */
    .xd-single-layout { flex-direction: column; }
    .xd-single-sidebar { display: none; }
    .xd-related-mobile { display: block; }
    .xd-related-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .xd-single-title { font-size: 20px; }
    .xd-single-content h2 { font-size: 18px; }
    .xd-single-content h3 { font-size: 16px; }
    .xd-single-content { font-size: 15px; }
}

@media (max-width: 480px) {
    .xd-related-grid { grid-template-columns: 1fr; }
}



/* ============================================================
   9. MỤC LỤC TỰ ĐỘNG (TOC) — Cây thư mục
   ============================================================ */

.xd-toc-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 0 0 28px;
    font-family: 'Be Vietnam Pro', sans-serif;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

/* Header */
.xd-toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.xd-toc-icon {
    width: 18px;
    height: 18px;
    fill: #555;
    flex-shrink: 0;
    display: block;
}

.xd-toc-label {
    font-size: 13px;
    font-weight: 800;
    color: #222;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex: 1;
}

/* Nút toggle toàn bộ */
.xd-toc-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color .2s;
}
.xd-toc-toggle:hover { color: #111; }

/* Body cuộn */
.xd-toc-body {
    max-height: 420px;
    overflow-y: auto;
    padding: 10px 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.xd-toc-body::-webkit-scrollbar { width: 4px; }
.xd-toc-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Danh sách gốc */
.xd-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Sub-list (children) */
.xd-toc-sub {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Mỗi dòng (row = toggle btn + link) */
.xd-toc-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 2px 0;
}

/* Nút toggle từng node (▾ / ▴) */
.xd-toc-node-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    line-height: 22px;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    transition: color .15s;
}
.xd-toc-node-toggle:hover { color: #333; }

/* Dấu chấm cho node không có con */
.xd-toc-node-dot {
    display: inline-block;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    line-height: 22px;
    font-size: 10px;
    color: #ccc;
}
.xd-toc-node-dot::before { content: "•"; }

/* Link */
.xd-toc-row a {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
}
.xd-toc-row a:hover .xd-toc-text { color: #1a6fdb; text-decoration: underline; }

.xd-toc-num {
    flex-shrink: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.xd-toc-text {
    color: #222;
    transition: color .15s;
}

/* ── Cấp H2 (L2) ── */
.xd-toc-l2 {
    margin-bottom: 2px;
}
.xd-toc-l2 > .xd-toc-row a { font-size: 14px; font-weight: 600; }
.xd-toc-l2 > .xd-toc-row .xd-toc-num { font-size: 13px; color: #333; min-width: 22px; }
.xd-toc-l2 > .xd-toc-row .xd-toc-text { color: #111; }

/* ── Cấp H3 (L3) — thụt vào 20px ── */
.xd-toc-l3 {
    padding-left: 22px;
    margin-top: 1px;
}
.xd-toc-l3 > .xd-toc-row a { font-size: 13.5px; font-weight: 500; }
.xd-toc-l3 > .xd-toc-row .xd-toc-num { font-size: 12px; color: #666; min-width: 32px; }
.xd-toc-l3 > .xd-toc-row .xd-toc-text { color: #333; }

/* ── Cấp H4 (L4) — thụt vào thêm 20px ── */
.xd-toc-l4 {
    padding-left: 22px;
    margin-top: 1px;
}
.xd-toc-l4 > .xd-toc-row a { font-size: 13px; font-weight: 400; }
.xd-toc-l4 > .xd-toc-row .xd-toc-num { font-size: 11px; color: #999; min-width: 40px; }
.xd-toc-l4 > .xd-toc-row .xd-toc-text { color: #555; }

/* Đường kẻ dọc cây */
.xd-toc-l2.xd-toc-has-children > .xd-toc-sub {
    border-left: 2px solid #e8e8e8;
    margin-left: 8px;
    padding-left: 4px;
    margin-top: 2px;
}
.xd-toc-l3.xd-toc-has-children > .xd-toc-sub {
    border-left: 2px solid #f0f0f0;
    margin-left: 8px;
    padding-left: 4px;
    margin-top: 2px;
}

html { scroll-behavior: smooth; }
[id^="xd-toc-"] { scroll-margin-top: 90px; }

@media (max-width: 768px) {
    .xd-toc-body { max-height: 300px; }
    .xd-toc-l2 > .xd-toc-row a { font-size: 13px; }
    .xd-toc-l3 > .xd-toc-row a { font-size: 12.5px; }
}
