/**
 * Homepage refined UI — scoped .home-refined
 */

.home-refined .homepage {
    padding-bottom: 2.5rem;
    --home-block-radius: 18px;
    --home-block-pad-x: 1.25rem;
    --home-block-pad-y: 1.25rem;
    --home-section-gap: 1.25rem;
}

/* ── Slider block ───────────────────────────────────────────── */
.home-refined .homepage-slider.top-videos-slider-section {
    max-width: none;
    width: 100%;
    margin: 0 auto var(--home-section-gap);
    padding: 0;
}

.home-refined .homepage-slider .top-videos-slider-wrapper {
    background: transparent !important;
    border: none !important;
    border-radius: var(--home-block-radius) !important;
    padding: var(--home-block-pad-y) 0 1rem !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.home-refined .homepage-slider .top-videos-slider-title h2 {
    font-size: clamp(1rem, 2.5vw, 1.2rem) !important;
    font-weight: 700 !important;
    color: #fff !important;
    padding-left: 12px !important;
    border-left: 3px solid #ff4757 !important;
    margin: 0 !important;
    gap: 8px !important;
    flex-wrap: wrap;
}

.home-refined .homepage-slider .title-subtitle {
    display: block !important;
    margin: 0.35rem 0 0 15px !important;
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.45) !important;
    line-height: 1.4;
}

.home-refined .homepage-slider .hot-badge {
    font-size: 0.6rem !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    vertical-align: middle;
}

.home-refined .homepage-slider .view-more-btn {
    /* đồng bộ với chip trong slider-redesign.css — trước đây set màu riêng ở
       đây (specificity cao hơn) làm chữ mờ hơn ý định trong slider-redesign.css */
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
}

.home-refined .homepage-slider .view-more-btn:hover,
.home-refined .homepage-slider .view-more-btn:active {
    color: #fff !important;
}

.home-refined .homepage-slider .splide__progress {
    margin-top: 12px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.home-refined .homepage-slider .splide__progress__bar {
    background: linear-gradient(90deg, #ff4757, #ff8a9b);
    border-radius: 999px;
}

/* ── Main layout ───────────────────────────────────────────── */
.home-refined .homepage-layout.video-layout-container {
    max-width: none;
    width: 100%;
    padding: 0 0 2rem;
    margin: 0;
}

.home-refined .homepage-layout .content-with-sidebar {
    max-width: none;
    width: 100%;
    margin: 0;
}

.home-refined .homepage-featured.featured {
    margin-top: 0;
    padding: var(--home-block-pad-y) var(--home-block-pad-x) 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--home-block-radius);
    box-shadow: none;
}

/* ── Search ──────────────────────────────────────────────────── */
.home-refined .homepage-featured-header {
    margin-bottom: 1.25rem;
}

.home-refined .homepage-search-container {
    margin-bottom: 1.25rem;
}

.home-refined .homepage-search-container .search-wrapper {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
}

.home-refined .homepage-search-form {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px 6px 6px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-refined .homepage-search-form:focus-within {
    border-color: rgba(255, 71, 87, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.home-refined .homepage-search-form .search-button {
    /* accent-strong: chữ trắng đạt AA contrast, thay vì #ff4757 trước đây ~3.3:1 */
    background: linear-gradient(135deg, var(--accent-strong, #C4293A), #A32330);
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
}

.home-refined .homepage-search-form .search-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ── Section title ───────────────────────────────────────────── */
.home-refined .homepage-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-refined .homepage-section-heading .section-heading {
    margin: 0 !important;
    padding-left: 12px;
    border-left: 3px solid #ff4757;
    font-size: clamp(1.15rem, 2.8vw, 1.45rem) !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* ── Video grid cards ────────────────────────────────────────── */
.home-refined .homepage-featured .featured-grid {
    gap: 14px;
}

.home-refined .homepage-featured .card.video-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg, 14px);
    border: 1px solid transparent;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background 0.22s ease;
}

/* Hover chuột — desktop */
@media (hover: hover) and (pointer: fine) {
    .home-refined .homepage-featured .card.video-card:hover {
        transform: translateY(-3px);
        border-color: rgba(255, 71, 87, 0.35);
        background: rgba(255, 255, 255, 0.04);
        /* glow đỏ nhạt thay vì bóng đen thuần — cảm giác "phát sáng thương hiệu" khi hover */
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 71, 87, 0.08), 0 8px 20px -6px rgba(255, 71, 87, 0.25);
    }

    .home-refined .homepage-featured .card.video-card:hover .meta .title a {
        color: #ff8a9b;
    }

    .home-refined .homepage-featured .card.video-card:hover .thumb img {
        transform: scale(1.04);
    }
}

.home-refined .homepage-featured .thumb {
    border-radius: var(--radius-md, 10px);
    overflow: hidden;
    background: #0a0c12;
}

.home-refined .homepage-featured .thumb-link {
    display: block;
    line-height: 0;
}

.home-refined .homepage-featured .thumb img {
    transition: transform 0.35s ease;
}

.home-refined .homepage-featured .thumb .category-chip {
    top: 8px;
    left: 8px;
    padding: 4px 9px;
    border-radius: var(--radius-sm, 6px);
    font-size: 10px;
    font-weight: 700;
    background: rgb(192 0 0 / 20%);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.home-refined .homepage-featured .meta {
    padding: 10px 4px 4px;
}

.home-refined .homepage-featured .meta .title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.home-refined .homepage-featured .meta .title a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Overlay badges on thumb */
.home-refined .homepage-featured .thumb [class*="overlay"],
.home-refined .homepage-featured .thumb [class*="badge"] {
    border-radius: 6px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.home-refined .homepage-pagination.pagination-section {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: none;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 768px) {
    .home-refined .homepage-featured .featured-grid {
        gap: 16px;
    }
}

@media (min-width: 992px) {
    /* Một cột nội dung — slider và phim mới cùng mép trái/phải */
    .home-refined .site-content > .container {
        max-width: 1320px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .home-refined .homepage-search-container .search-wrapper {
        max-width: none !important;
        width: 100%;
        margin: 0 !important;
    }

    .home-refined .homepage-search-form {
        width: 100%;
    }

    .home-refined .homepage-featured-header {
        padding-left: 0;
        padding-right: 0;
    }

    /* Bỏ fade mép slider — tránh cảm giác lệch so với ô search */
    .home-refined #topVideosSlider .splide__track {
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .home-refined .homepage-slider .top-videos-slider-header,
    .home-refined .homepage-section-heading {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (min-width: 1100px) {
    .home-refined .homepage-featured .featured-grid {
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .home-refined .site-main.homepage {
        padding-left: 0;
        padding-right: 0;
    }

    .home-refined .homepage-slider.top-videos-slider-section {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Container rộng sát mép — thumbnail 2 cột to hơn */
    .home-refined .homepage-layout.video-layout-container {
        max-width: 100% !important;
        width: 100%;
        padding: 0 4px 1.25rem !important;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .home-refined .homepage-featured.featured {
        padding: 0.85rem 4px 1rem !important;
        margin-top: 0 !important;
        border-radius: 12px;
        border-left: none;
        border-right: none;
    }

    .home-refined .homepage-featured .featured-grid {
        /* 8px (token space-2) thay vì 6px — 2 thẻ video sát nhau dễ chạm nhầm trên mobile */
        gap: 8px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .home-refined .homepage-featured .meta {
        padding: 8px 2px 2px;
    }

    .home-refined .homepage-featured .meta .title {
        font-size: 0.8rem;
    }

    .home-refined .homepage-featured-header {
        padding: 0 4px;
        margin-bottom: 1rem;
    }

    .home-refined .homepage-search-container {
        margin-bottom: 1rem;
    }

    .home-refined .homepage-slider .title-subtitle {
        margin-left: 0 !important;
        padding-left: 15px;
    }
}

@media (max-width: 480px) {
    .home-refined .homepage-layout.video-layout-container {
        padding: 0 2px 1rem !important;
    }

    .home-refined .homepage-featured.featured {
        padding: 0.75rem 2px 0.85rem !important;
        border-radius: 10px;
    }

    .home-refined .homepage-featured .featured-grid {
        gap: 8px !important;
    }

    .home-refined .homepage-featured .thumb {
        border-radius: 8px;
    }

    .home-refined .homepage-featured-header {
        padding: 0 2px;
    }

    .home-refined .homepage-search-form .search-button span {
        display: none;
    }

    .home-refined .homepage-search-form .search-button {
        padding: 10px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-refined .homepage-featured .card.video-card,
    .home-refined .homepage-featured .thumb img {
        transition: none;
    }

    .home-refined .homepage-featured .card.video-card:hover {
        transform: none;
    }
}
