/*
 * Trang danh sách tour, lịch khởi hành, blog và bài viết — bản hiện đại 31/10.
 * Nạp SAU tour-modern.css (dùng lại --tv-*, .tv-btn, .tv-tcard). Mọi quy tắc nằm dưới .tv.
 * Nội dung lưu trong DB (category.intro / faq) cố ý đặt ngoài .tv để giữ nguyên kiểu .dtt của site.
 */

/* Thẻ .tv-tcard ở trang danh sách không kéo ngang như tour gợi ý */
.tv-listing .tv-tcard { flex: none; max-width: none; height: 100%; }
.tv-listing .tv-tcard__media:empty { display: none; }
/* Ảnh bìa blog thiết kế sẵn tỉ lệ 1200×630 có chữ trên ảnh: giữ đúng tỉ lệ để không cắt chữ */
.tv-listing .tv-tcard--blog .tv-tcard__media { aspect-ratio: 1200 / 630; }

/* ===== Banner ===== */
.tv .tv-banner { position: relative; background: var(--tv-brand); }
.tv .tv-banner,
.tv .tv-banner .carousel-inner,
.tv .tv-banner .carousel-item { height: clamp(250px, 36vh, 340px); }
.tv .tv-banner .carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.tv .tv-banner__shade {
    background: linear-gradient(180deg, rgba(10, 20, 20, .25) 0%, rgba(10, 20, 20, .32) 45%, rgba(10, 20, 20, .8) 100%);
    pointer-events: none;
}
.tv .tv-banner__body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 0 56px;
    color: #fff;
    text-align: left;
}
.tv .tv-banner__body .container { width: 100%; }
.tv .tv-banner__title {
    max-width: 860px;
    color: #fff;
    font-size: clamp(26px, 3.6vw, 42px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.01em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .4);
}
.tv .tv-banner__pills {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tv .tv-banner__pills.d-none { display: none; }
.tv .tv-banner__pills::-webkit-scrollbar { display: none; }
.tv .tv-banner__pills .tag-item {
    flex: 0 0 auto;
    padding: 7px 16px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.tv .tv-banner__pills .tag-item:hover { background: #fff; color: var(--tv-ink); }
.tv .tv-banner .carousel-indicators { z-index: 3; justify-content: flex-end; margin: 0 24px 58px auto; left: auto; }
.tv .tv-banner .carousel-indicators [data-bs-target] { width: 22px; height: 4px; border: 0; border-radius: 4px; margin: 0 3px; }

/* ===== Thẻ bộ lọc ===== */
.tv .tv-filter { position: relative; z-index: 4; }
.tv .tv-banner + .tv-filter { margin-top: -36px; }
.tv .tv-filter__form {
    display: grid;
    gap: 12px;
    align-items: end;
    padding: 16px 18px;
    background: #fff;
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
}
.tv .tv-filter__form--tour { grid-template-columns: minmax(0, 1.5fr) minmax(0, 3fr) auto; align-items: center; }
.tv .tv-filter__form--dep { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.tv .tv-filter__q { position: relative; display: flex; align-items: center; gap: 8px; }
.tv .tv-filter__q > .bi-search { position: absolute; left: 14px; color: var(--tv-muted); pointer-events: none; }
.tv .tv-filter__q .form-control { padding-left: 40px; }
.tv .tv-filter .form-control,
.tv .tv-filter .form-select {
    width: 100%;
    min-height: 48px;
    border: 1.5px solid var(--tv-line);
    border-radius: 10px;
    background-color: #fff;
    color: var(--tv-ink);
    font-size: 16px; /* dưới 16px iOS tự phóng to khi gõ */
    box-shadow: none;
}
.tv .tv-filter .form-control:focus,
.tv .tv-filter .form-select:focus { border-color: var(--tv-accent); box-shadow: 0 0 0 3px var(--tv-accent-soft); outline: 0; }
.tv .tv-filter__toggle {
    flex: 0 0 auto;
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--tv-line);
    border-radius: 10px;
    color: var(--tv-ink);
    font-size: 18px;
}
.tv .tv-filter__toggle:not(.collapsed) { border-color: var(--tv-accent); color: var(--tv-accent); }
.tv .tv-filter .tv-btn,
.tv .tv-filter .btn-search-primary { min-height: 48px; padding: 10px 26px; white-space: nowrap; }
.tv .tv-filter .btn-search-primary { border-radius: 999px !important; font-weight: 700; letter-spacing: 0; text-transform: none; }
.tv .tv-filter .search-label {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--tv-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
.tv .tv-filter .search-label i { color: var(--tv-accent); }
@media (min-width: 768px) {
    .tv .tv-filter__more,
    .tv .tv-filter__more.collapse:not(.show) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; height: auto; visibility: visible; }
}

/* ===== Breadcrumb + nhảy tới danh sách ===== */
.tv .tv-listcrumbs { padding-top: 18px; }
.tv .tv-listcrumbs .breadcrumb { margin: 0; padding: 0; background: none; font-size: 13px; }
.tv .tv-listcrumbs .breadcrumb-item a { color: var(--tv-muted); }
.tv .tv-listcrumbs .breadcrumb-item a:hover { color: var(--tv-accent); }
.tv .tv-jump {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--tv-accent-soft);
    color: var(--tv-accent);
    font-size: 14px;
    font-weight: 700;
}
.tv .tv-jump:hover { background: var(--tv-accent); color: #fff; }

/* ===== Danh sách ===== */
.tv-list { padding: 24px 0 40px; }
.tv-list #tours-list { scroll-margin-top: calc(var(--tv-header-h, 130px) + 16px); }
.tv-empty {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 48px 24px;
    background: var(--tv-surface);
    border-radius: var(--tv-radius);
    color: var(--tv-muted);
    text-align: center;
}
.tv-empty i { font-size: 30px; color: var(--tv-accent); line-height: 1; }
.tv-empty p { margin: 0; }

/* ===== Blog: nhóm theo chuyên mục ===== */
.tv-blogsec { padding-bottom: 16px; }
.tv-blogsec__head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 16px;
}
.tv .tv-blogsec__title { margin: 0; color: var(--tv-brand); font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.3; }
.tv-blogsec__more {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--tv-line);
    border-radius: 50%;
    color: var(--tv-ink);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tv-blogsec__more:hover { background: var(--tv-accent); border-color: var(--tv-accent); color: #fff; }

/* ===== Lịch khởi hành ===== */
.tv .tv-dep__month {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 28px 0 14px;
    color: var(--tv-brand);
    font-size: 22px;
    font-weight: 700;
}
.tv .tv-dep__month:first-child { margin-top: 0; }
.tv .tv-dep__month i { color: var(--tv-accent); font-size: 20px; }
.tv .tv-depcard {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: var(--tv-radius);
    transition: transform .2s ease, box-shadow .2s ease;
}
.tv .tv-depcard:hover { transform: translateY(-3px); box-shadow: var(--tv-shadow); }
.tv .tv-depcard__media {
    position: relative;
    min-height: 200px;
    background-color: var(--tv-surface);
    background-size: cover;
    background-position: center;
}
.tv .tv-depcard .tour-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
}
.tv .tv-depcard__date {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    min-width: 76px;
    padding: 6px 12px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    color: var(--tv-muted);
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}
.tv .tv-depcard__date b { color: var(--tv-accent); font-size: 26px; line-height: 1.15; }
.tv .tv-depcard__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 20px 24px;
}
.tv .tv-depcard .tour-code { color: var(--tv-accent); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.tv .tv-depcard .tour-title { color: var(--tv-brand); font-size: 19px; font-weight: 700; line-height: 1.3; }
.tv .tv-depcard .tour-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--tv-ink); font-size: 14px; }
.tv .tv-depcard .meta-item { display: inline-flex; gap: 6px; align-items: center; }
.tv .tv-depcard .meta-item i { color: var(--tv-accent); }
.tv .tv-depcard .tour-link { font-size: 13.5px; font-weight: 400; line-height: 1.45; }
.tv .tv-depcard .tour-link:hover { text-decoration: underline; }
.tv .tv-depcard__cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 20px 22px;
    background: var(--tv-surface);
    border-left: 1px solid var(--tv-line);
}
.tv .tv-depcard .cta-label,
.tv .tv-depcard .cta-sub { color: var(--tv-muted); font-size: 12.5px; font-weight: 400; }
.tv .tv-depcard .cta-price { margin: 2px 0; color: var(--tv-brand); font-size: 22px; font-weight: 700; line-height: 1.2; }
.tv .tv-depcard__btns { display: grid; gap: 8px; }
.tv .tv-depcard__btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
}
.tv .tv-depcard__btns .btn-outline-cta { border-width: 1.5px !important; }

/* ===== Bài viết ===== */
.tv-article { padding: 20px 0 48px; }
.tv-article .container { max-width: 1232px; }
.tv .tv-article__crumbs .breadcrumb { margin: 0 0 18px; padding: 0; background: none; font-size: 13px; }
.tv .tv-article__crumbs .breadcrumb-item a { color: var(--tv-muted); }
.tv .tv-article__crumbs .breadcrumb-item a:hover { color: var(--tv-accent); }
.tv-article__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}
.tv-article .mg-post { padding: 0; }
.tv.tv-article .mg-post-title { margin: 0 0 14px; font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.tv.tv-article .mg-post-title a { color: var(--tv-brand); }
.tv.tv-article .mg-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    color: var(--tv-muted);
    font-size: 14px;
}
.tv.tv-article .mg-post-meta span { padding: 0; }
.tv.tv-article .mg-post-meta span::after { content: none; }
.tv.tv-article .tv-share { display: inline-flex; margin-left: auto; }
.tv.tv-article .tv-share a {
    background: var(--tv-surface);
    color: var(--tv-ink);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.tv.tv-article .tv-share a:hover { background: var(--tv-accent); color: #fff; }
.tv-article__cover { display: block; width: 100%; height: auto; margin-bottom: 24px; border-radius: var(--tv-radius); }

/* Mục lục do lp.js dựng trong #blog-toc */
.tv.tv-article #blog-toc-list {
    margin: 0 0 28px;
    padding: 16px 20px;
    background: var(--tv-surface);
    border-left: 3px solid var(--tv-accent);
    border-radius: 0 12px 12px 0;
    font-size: 15px;
}
.tv.tv-article #blog-toc-list ol { padding-left: 16px; }
.tv.tv-article #blog-toc-list li { padding: 3px 0; }
.tv.tv-article #blog-toc-list a { color: var(--tv-ink); }
.tv.tv-article #blog-toc-list a:hover { color: var(--tv-accent); }

/* Nội dung lưu trong DB: :where giữ độ ưu tiên 0 nên kiểu riêng của bài (.dtt...) vẫn thắng */
.tv .blog-content { font-size: 17px; line-height: 1.75; overflow-wrap: break-word; }
.tv .blog-content img { max-width: 100%; height: auto; border-radius: 12px; }
.tv .blog-content iframe,
.tv .blog-content video { max-width: 100%; border-radius: 12px; }
.tv .blog-content table { max-width: 100%; }
.tv .blog-content .dtt .wrap { padding-left: 0; padding-right: 0; }
.tv .blog-content .dtt > .wrap > .blk:first-child { border-top: 0; padding-top: 0; }
:where(.tv .blog-content) h2 { margin: 1.6em 0 .5em; font-size: 26px; font-weight: 700; line-height: 1.25; }
:where(.tv .blog-content) h3 { margin: 1.4em 0 .4em; font-size: 21px; font-weight: 700; line-height: 1.3; }
:where(.tv .blog-content) ul,
:where(.tv .blog-content) ol { padding-left: 1.3em; }
:where(.tv .blog-content) blockquote { margin: 1.2em 0; padding: 10px 18px; border-left: 3px solid var(--tv-accent); background: var(--tv-surface); }
.tv .blog-content :is(p, li, td) > a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

/* Thẻ advisor cuối bài: chỉ có khi model có advisorCard */
.tv .advisor-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 32px 0 8px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
}
.tv .advisor-card__avatar { flex: 0 0 auto; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; }
.tv .advisor-card__info { flex: 1 1 200px; min-width: 0; }
.tv .advisor-card__label { color: var(--tv-muted); font-size: 13px; line-height: 1.4; }
.tv .advisor-card__name { color: var(--tv-brand); font-size: 19px; font-weight: 700; line-height: 1.3; }
.tv .advisor-card__phone { color: var(--tv-ink); font-size: 15px; font-weight: 700; }
.tv .advisor-card__phone:hover { color: var(--tv-accent); }
.tv .advisor-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tv .advisor-card__actions .btn { min-height: 44px; padding: 9px 22px; border-radius: 999px; font-weight: 700; }

.tv-author {
    margin-top: 28px;
    padding: 18px 20px;
    background: var(--tv-surface);
    border-radius: var(--tv-radius);
    font-size: 15px;
    color: var(--tv-muted);
}

.tv .tv-article__related { margin-top: 36px; }
.tv .tv-article__related .tv-h2 { font-size: 22px; }

/* Cột phải */
.tv-article__side {
    position: sticky;
    top: calc(var(--tv-header-h, 130px) + 16px);
    display: grid;
    gap: 16px;
}
.tv .tv-widget { padding: 20px 22px; background: #fff; border: 1px solid var(--tv-line); border-radius: var(--tv-radius); }
.tv .tv-widget__title { margin: 0 0 12px; color: var(--tv-brand); font-size: 16px; font-weight: 700; line-height: 1.3; }
.tv .tv-widget__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tv .tv-widget__tags a {
    padding: 4px 12px;
    border: 1px solid var(--tv-line);
    border-radius: 999px;
    background: var(--tv-surface);
    color: var(--tv-ink);
    font-size: 13px;
}
.tv .tv-widget__tags a:hover { border-color: var(--tv-accent); color: var(--tv-accent); }
.tv .tv-widget__list { margin: 0; padding: 0; list-style: none; }
.tv .tv-widget__list li + li { border-top: 1px solid var(--tv-line); }
.tv .tv-widget__list a { display: block; padding: 8px 0; color: var(--tv-ink); font-size: 14px; line-height: 1.45; }
.tv .tv-widget__list a:hover { color: var(--tv-accent); }

/* ===== Máy tính bảng & điện thoại ===== */
@media (max-width: 991.98px) {
    .tv .tv-depcard { grid-template-columns: 220px minmax(0, 1fr); }
    .tv .tv-depcard__cta {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        border-left: 0;
        border-top: 1px solid var(--tv-line);
    }
    .tv .tv-depcard__btns { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 280px; }

    .tv-article__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .tv-article__side { position: static; }
}

@media (max-width: 767.98px) {
    .tv .tv-banner,
    .tv .tv-banner .carousel-inner,
    .tv .tv-banner .carousel-item { height: 230px; }
    .tv .tv-banner__body { padding-bottom: 50px; }
    .tv .tv-banner .carousel-indicators { display: none; }

    .tv .tv-filter__form { padding: 12px; }
    .tv .tv-filter__form--tour,
    .tv .tv-filter__form--dep { grid-template-columns: minmax(0, 1fr); }
    .tv .tv-filter__toggle { display: inline-flex; }
    .tv .tv-filter__more.collapse.show,
    .tv .tv-filter__more.collapsing { display: block; }
    .tv .tv-filter__more .form-select + .form-select { margin-top: 12px; }
    .tv .tv-filter .tv-btn,
    .tv .tv-filter .btn-search-primary { width: 100%; }

    /* Thẻ tour / bài dạng ngang: nhiều mục mà vẫn gọn (chỉ khi 1 cột, ?col=2 giữ dạng dọc) */
    .tv-list .col-12 > .tv-tcard:not(.tv-tcard--blog) { flex-direction: row; }
    .tv-list .col-12 > .tv-tcard:not(.tv-tcard--blog) .tv-tcard__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 118px; }
    .tv-list .col-12 > .tv-tcard:not(.tv-tcard--blog) .tv-tcard__body { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 12px 14px; }
    .tv-list .col-12 > .tv-tcard:not(.tv-tcard--blog) .tv-tcard__name { font-size: 15px; }
    .tv-list .col-12 > .tv-tcard:not(.tv-tcard--blog) .tv-tcard__badge { left: 8px; top: 8px; padding: 2px 9px; font-size: 12px; }
    .tv-list .one-product-content.col-12 { margin-bottom: 12px !important; }

    .tv .tv-depcard { grid-template-columns: minmax(0, 1fr); }
    .tv .tv-depcard__media { min-height: 170px; }
    .tv .tv-depcard__body { padding: 16px 18px; }
    .tv .tv-depcard__cta { padding: 16px 18px; }
    .tv .tv-depcard__btns { flex-basis: 100%; }

    .tv.tv-article .tv-share { margin-left: 0; }
    .tv .blog-content { font-size: 16px; }
    .tv .blog-content table:not(.table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
