/* Blog video công khai: /video (thư viện + "Xem liên tục") và /video/{slug}. Ưu tiên điện thoại. */

.vb-wrap { max-width: 1040px; margin: 0 auto; padding: 0 2px; }
.vb-post { max-width: 640px; }

/* ── Đầu trang: nền tối kiểu app video, video mới nhất bên phải ── */
.vb-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 16px;
    margin: 8px 0 14px; padding: 22px 18px;
    border-radius: 24px; color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(249, 115, 22, .55) 0%, rgba(249, 115, 22, 0) 60%),
        radial-gradient(80% 80% at 0% 100%, rgba(234, 88, 12, .35) 0%, rgba(234, 88, 12, 0) 60%),
        #121214;
    box-shadow: 0 14px 40px rgba(17, 17, 20, .28);
}
.vb-hero__text { flex: 1; min-width: 0; }
.vb-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); font-size: .75rem; font-weight: 600;
}
.vb-hero h1 { margin: 12px 0 8px; font-size: clamp(1.35rem, 5.6vw, 2.3rem); font-weight: 900; line-height: 1.18; letter-spacing: -.02em; }
.vb-hero h1 em { font-style: normal; color: #fdba74; }
.vb-hero p { margin: 0; color: rgba(255, 255, 255, .78); font-size: .92rem; line-height: 1.5; }
.vb-hero__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.vb-hero__count { font-size: .8rem; color: rgba(255, 255, 255, .65); }
.vb-hero__feature {
    position: relative; flex: 0 0 34%; max-width: 230px; aspect-ratio: 9 / 16;
    border-radius: 18px; overflow: hidden; display: block;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45); transform: rotate(2.5deg);
    transition: transform .2s;
}
.vb-hero__feature:hover { transform: rotate(0deg) scale(1.02); }
.vb-hero__feature img, .vb-hero__feature video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vb-hero__badge {
    position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px;
    background: #ef4444; color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .02em;
}
@media (max-width: 575px) {
    .vb-hero { padding: 18px 14px 18px 16px; gap: 12px; align-items: flex-start; }
    .vb-hero p { display: none; }
    .vb-hero__feature { flex-basis: 38%; border-radius: 14px; }
}

/* ── Nút lọc chủ đề: dính trên cùng khi cuộn, cuộn ngang trên điện thoại ── */
.vb-chips {
    position: sticky; top: 0; z-index: 20;
    display: flex; gap: 8px; overflow-x: auto;
    margin: 0 -12px 14px; padding: 10px 12px;
    background: rgba(248, 249, 250, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.vb-chips::-webkit-scrollbar { display: none; }
.vb-chip {
    flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
    border: 1px solid var(--border, #e5e7eb); background: #fff; color: #374151;
    font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s;
    text-decoration: none;
}
.vb-chip:hover { color: #121214; }
.vb-chip.is-active, .vb-chip.is-active:hover { background: #121214; border-color: #121214; color: #fff; }

/* ── Lưới thẻ video dọc ── */
.vb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
@media (min-width: 640px) { .vb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; } }
@media (min-width: 900px) { .vb-wrap:not(.vb-post) .vb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.vb-card { display: block; color: inherit; text-decoration: none; }
.vb-card[hidden] { display: none; }
.vb-card__media {
    position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden;
    border-radius: 18px; background: #121214;
    box-shadow: 0 6px 18px rgba(17, 24, 39, .12);
    transition: transform .18s ease, box-shadow .18s ease;
}
.vb-card:hover .vb-card__media { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(17, 24, 39, .2); }
.vb-card:active .vb-card__media { transform: scale(.98); }
.vb-card__media img, .vb-card__media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.vb-card__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }
/* Nút ▶ góc trên phải: giữa thẻ là chữ hook, dưới là dải tiêu đề của ảnh bìa — đừng che. */
.vb-card__play {
    position: absolute; right: 8px; top: 8px; z-index: 1;
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .92); color: #ea580c; font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.vb-card__cat {
    position: absolute; left: 8px; bottom: 8px; z-index: 1;
    padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55);
    color: #fff; font-size: .72rem; font-weight: 600;
}
.vb-card__title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 8px; font-size: .88rem; font-weight: 700; line-height: 1.35; color: #111827;
}

.vb-empty { padding: 40px 0; text-align: center; color: var(--text-muted, #6b7280); }

/* ── Nút ── */
.vb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 18px; border-radius: 14px;
    font-weight: 700; font-size: .95rem; text-decoration: none; border: 0; cursor: pointer;
    transition: transform .12s, background .15s;
}
.vb-btn:active { transform: scale(.97); }
.vb-btn--primary { background: var(--primary, #f97316); color: #fff; box-shadow: 0 6px 16px rgba(249, 115, 22, .35); }
.vb-btn--primary:hover { background: var(--primary-dark, #ea580c); color: #fff; }
.vb-btn--light { background: #fff; color: #121214; }
.vb-btn--light:hover { background: #fff7ed; color: #121214; }
.vb-btn--ghost { background: #fff; color: #111827; border: 1px solid var(--border, #e5e7eb); }

.vb-app-box {
    display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 16px;
    border-radius: 20px; background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa;
}
.vb-app-box img { border-radius: 14px; flex: 0 0 auto; box-shadow: 0 4px 12px rgba(234, 88, 12, .2); }
.vb-app-box div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vb-app-box span { font-size: .8rem; color: #6b7280; line-height: 1.4; }

/* ── Trang 1 video ── */
.vb-back { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 12px; color: #374151; font-weight: 600; text-decoration: none; }
.vb-player {
    margin: 0 auto; width: 100%; max-width: 420px; aspect-ratio: 9 / 16; max-height: 78vh;
    border-radius: 22px; overflow: hidden; background: #000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}
.vb-player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
@media (max-width: 575px) {
    /* Điện thoại: khung video tràn sát mép như app xem video ngắn. */
    .vb-player { margin: 0 -12px; width: calc(100% + 24px); max-width: none; border-radius: 0; max-height: 82vh; }
}

.vb-pager { display: flex; gap: 10px; margin: 12px auto 0; max-width: 420px; }
.vb-pager a {
    display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px;
    background: #fff; border: 1px solid var(--border, #e5e7eb); color: #374151; font-weight: 600; font-size: .88rem; text-decoration: none;
}
.vb-pager__next { flex: 1; min-width: 0; justify-content: flex-end; text-align: right; }
.vb-pager__next span { font-size: .75rem; color: #9ca3af; font-weight: 600; }
.vb-pager__next strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #111827; }
.vb-pager__next i { color: var(--primary, #f97316); }

.vb-post__body { margin-top: 18px; font-size: 1rem; line-height: 1.65; color: #1f2937; }
.vb-post__body h1 { font-size: clamp(1.3rem, 5vw, 1.75rem); font-weight: 900; line-height: 1.28; margin: 8px 0 8px; color: #111827; letter-spacing: -.01em; }
.vb-post__body h2 { font-size: 1.12rem; font-weight: 800; margin: 26px 0 12px; color: #111827; }
.vb-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--primary-50, #fff0e6); color: #c2410c; font-size: .78rem; font-weight: 700; }
.vb-lead { font-size: 1.02rem; color: #4b5563; }
.vb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }
.vb-actions .vb-btn--primary { flex: 1 1 200px; }

.vb-steps { list-style: none; counter-reset: vb; padding: 0; margin: 0; position: relative; }
.vb-steps li {
    counter-increment: vb; position: relative; padding: 12px 14px 12px 56px; margin-bottom: 10px;
    border-radius: 16px; background: #fff; border: 1px solid var(--border, #e5e7eb);
    display: flex; flex-direction: column; gap: 2px;
}
.vb-steps li::before {
    content: counter(vb); position: absolute; left: 14px; top: 12px;
    width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; font-weight: 800; font-size: .9rem;
}
.vb-steps strong { color: #111827; }
.vb-steps span { color: #4b5563; font-size: .95rem; }

.vb-tips { margin-top: 22px; padding: 14px 16px; border-radius: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.vb-tips h2 { margin: 0 0 8px; font-size: 1rem; color: #047857; }
.vb-tips ul { margin: 0; padding-left: 18px; }
.vb-tips li { margin-bottom: 4px; }

.vb-faq details { border-bottom: 1px solid var(--border, #e5e7eb); padding: 12px 0; }
.vb-faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.vb-faq summary::-webkit-details-marker { display: none; }
.vb-faq summary::after { content: '+'; font-weight: 800; color: var(--primary, #f97316); }
.vb-faq details[open] summary::after { content: '−'; }
.vb-faq p { margin: 8px 0 0; color: #4b5563; }

.vb-related { margin-top: 32px; }
.vb-related h2 { font-size: 1.12rem; font-weight: 800; margin-bottom: 12px; }
/* Video khác: hàng cuộn ngang trên điện thoại. */
@media (max-width: 639px) {
    .vb-grid--row {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
        margin: 0 -12px; padding: 0 12px 6px; scrollbar-width: none;
    }
    .vb-grid--row::-webkit-scrollbar { display: none; }
    .vb-grid--row .vb-card { flex: 0 0 42%; scroll-snap-align: start; }
}

/* Thanh tải app dính đáy — chỉ điện thoại; chừa chỗ để không che chân trang. */
.vb-sticky { display: none; }
@media (max-width: 767px) {
    .vb-sticky {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        display: flex; align-items: center; gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
        border-top: 1px solid var(--border, #e5e7eb); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
    }
    .vb-sticky img { border-radius: 10px; }
    .vb-sticky span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .78rem; color: #6b7280; line-height: 1.3; }
    .vb-sticky strong { color: #111827; font-size: .92rem; }
    .vb-sticky .vb-btn { min-height: 40px; padding: 0 16px; }
    body:has(.vb-sticky) { padding-bottom: 76px; }
}

/* ── "Xem liên tục": vuốt dọc toàn màn hình ── */
html.vb-feed-open, html.vb-feed-open body { overflow: hidden; }
.vb-feed { position: fixed; inset: 0; z-index: 2000; background: #000; }
.vb-feed[hidden] { display: none; }
.vb-feed__list { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.vb-feed__list::-webkit-scrollbar { display: none; }
.vb-feed__slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }
.vb-feed__slide video { width: 100%; height: 100%; max-width: calc(100dvh * 9 / 16); object-fit: contain; background: #000; }
.vb-feed__info {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px calc(22px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.75)); color: #fff; pointer-events: none;
}
.vb-feed__info > * { max-width: 460px; margin-left: auto; margin-right: auto; }
.vb-feed__info h2 { font-size: 1.05rem; font-weight: 800; line-height: 1.35; margin: 6px auto 12px; }
.vb-feed__cat { display: block; font-size: .78rem; font-weight: 700; color: #fdba74; }
.vb-feed__actions { display: flex; gap: 10px; pointer-events: auto; }
.vb-feed__actions .vb-btn { flex: 1; min-height: 42px; }
.vb-feed__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.vb-feed__progress span { display: block; height: 100%; width: 0; background: #f97316; }
.vb-feed__close, .vb-feed__sound {
    position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top));
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
    border: 0; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-weight: 700; font-size: .85rem;
    backdrop-filter: blur(6px);
}
.vb-feed__close { left: 12px; width: 40px; padding: 0; justify-content: center; font-size: 1.1rem; }
.vb-feed__sound { right: 12px; }
.vb-feed__hint {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
    padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .85rem; font-weight: 600;
    pointer-events: none; animation: vb-hint 2.4s ease 1s forwards; opacity: 0;
}
.vb-feed.is-scrolled .vb-feed__hint { display: none; }
@keyframes vb-hint { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }
