/* Cân bằng chiều cao khu vực video nổi bật */
@media only screen and (min-width: 850px) {

    .vca-video-featured-layout {
        align-items: stretch !important;
    }

    .vca-video-featured-layout > .col {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        min-width: 0;
        padding-bottom: 0 !important;
    }

    .vca-video-featured-layout > .col > .col-inner {
        position: relative;
        flex: 1;
        width: 100%;
        min-height: 0;
    }

    /* Chiều cao video chính */
    .vca-video-featured-main .vcalib-single {
        margin: 0 !important;
    }

    /* Danh sách video bên phải */
    .vca-video-featured-list .vcalib-layout-list {
        position: absolute;
        inset: 0;
        width: 100%;
        margin: 0 !important;
    }

    .vca-video-featured-list .vcalib-layout-list .vcalib-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: minmax(0, 1fr);
        height: 100%;
        gap: 0;
        margin: 0;
    }

    /* Chia đều chiều cao từng video */
    .vca-video-featured-list .vcalib-layout-list .vcalib-card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
        min-width: 0;
        margin: 0 !important;
        padding: clamp(6px, 0.8vw, 16px) 0 !important;
        border: 0;
        border-bottom: 1px solid #D5E2E8;
        background: transparent;
        box-sizing: border-box;
    }

    .vca-video-featured-list .vcalib-layout-list .vcalib-card:first-child {
        justify-content: flex-start;
        padding-top: 0 !important;
    }

    .vca-video-featured-list .vcalib-layout-list .vcalib-card:last-child {
        justify-content: flex-end;
        padding-bottom: 0 !important;
        border-bottom: 0;
    }

    /* Căn giữa ảnh và tiêu đề trong mỗi video */
    .vca-video-featured-list .vcalib-layout-list .vcalib-card-link {
        display: grid;
        grid-template-columns: minmax(0, 43%) minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        gap: clamp(8px, 1vw, 16px);
        width: 100%;
        height: auto;
        min-height: 0;
        flex: 0 0 auto;
    }

    /* Thumbnail video */
    .vca-video-featured-list .vcalib-cover {
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
        align-self: center;
    }

    .vca-video-featured-list .vcalib-cover img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Tiêu đề video */
    .vca-video-featured-list .vcalib-card-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-self: center;
        height: auto;
        min-width: 0;
        min-height: 0;
        padding: 0 !important;
        overflow: hidden;
    }

    .vca-video-featured-list .vcalib-card h3 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
        font-size: clamp(13px, 1vw, 18px);
        line-height: 1.3;
        font-weight: 600;
        margin: 0 !important;
    }
}

/* Màn hình desktop nhỏ */
@media only screen and (min-width: 850px) and (max-width: 1199px) {

    .vca-video-featured-list .vcalib-card h3 {
        -webkit-line-clamp: 2;
    }

    .vca-video-featured-list .vcalib-play {
        width: 26px;
        height: 26px;
    }

    .vca-video-featured-list .vcalib-count {
        bottom: 4px;
        right: 4px;
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* Tối ưu video nổi bật trên tablet và mobile */
@media only screen and (max-width: 849px) {

    .vca-library-section .vca-library-content {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box;
    }

    .vca-video-featured-layout {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .vca-video-featured-layout > .col {
        flex-basis: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .vca-video-featured-layout > .col > .col-inner {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .vca-video-featured-layout > .vca-video-featured-main {
        margin-bottom: 20px !important;
    }

    .vca-video-featured-main .vcalib-single,
    .vca-video-featured-list .vcalib-layout-list {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .vca-video-featured-list .vcalib-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: auto;
        width: 100%;
        height: auto !important;
        margin: 0 !important;
        gap: 0;
    }

    .vca-video-featured-list .vcalib-card {
        width: 100%;
        min-width: 0;
        margin: 0 !important;
        padding: 14px 0 !important;
        border: 0;
        border-bottom: 1px solid #D5E2E8;
        box-shadow: none;
        background: transparent;
    }

    .vca-video-featured-list .vcalib-card:last-child {
        border-bottom: 0;
        padding-bottom: 0 !important;
    }

    .vca-video-featured-list .vcalib-card-link {
        display: grid;
        grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        width: 100%;
        height: auto !important;
    }

    .vca-video-featured-layout .vcalib-cover {
        width: 100% !important;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }

    .vca-video-featured-layout .vcalib-cover img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .vca-video-featured-list .vcalib-card-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-self: center;
        height: auto;
        min-width: 0;
        padding: 0 !important;
    }

    .vca-video-featured-list .vcalib-card h3 {
        font-size: 16px;
        line-height: 1.4;
        margin: 0 !important;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
}

/* Tối ưu riêng cho điện thoại */
@media only screen and (max-width: 549px) {

    .vca-video-featured-main .vcalib-card-body {
        padding: 15px !important;
    }

    .vca-video-featured-main h3 {
        font-size: 19px !important;
        line-height: 1.4;
    }

    .vca-video-featured-list .vcalib-card h3 {
        font-size: 14px !important;
        line-height: 1.4;
    }

    .vca-video-featured-list .vcalib-play {
        width: 30px;
        height: 30px;
    }

    .vca-video-featured-list .vcalib-count {
        font-size: 10px;
        padding: 3px 5px;
        right: 4px;
        bottom: 4px;
    }
}

/* Banner trên cùng Header */
#top-bar:has(.vca-header-banner) {
    padding: 0 !important;
}

#top-bar:has(.vca-header-banner) > .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

#top-bar .flex-center:has(.vca-header-banner) {
    flex: 1 1 100%;
    width: 100%;
}

#top-bar .vca-header-banner {
    width: 100%;
    padding: 0 !important;
}

.vca-header-banner .row {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.vca-header-banner .col {
    padding: 0 !important;
}

.vca-header-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Thu gọn banner Top Bar */
#top-bar:has(.vca-header-banner),
#top-bar:has(.vca-header-banner) .header-inner {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

.vca-header-banner,
.vca-header-banner .section-content,
.vca-header-banner .row,
.vca-header-banner .col,
.vca-header-banner .col-inner,
.vca-header-banner .img {
    padding: 0 !important;
    margin: 0 !important;
}

.vca-header-banner img {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* Footer VCA */
.vca-site-footer {
    --footer-primary: #00AEF0;
    --footer-hover: #008FC7;
    --footer-text: #102B40;
    --footer-muted: #526774;
    --footer-border: #DCE6EC;

    border-top: 3px solid var(--footer-primary);
    padding: 36px 0 10px !important;
    color: var(--footer-text);
}

.vca-site-footer .vca-footer-row {
    width: 100%;
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 0 20px;
}

.vca-site-footer .vca-footer-row > .col {
    padding: 0 20px 25px;
    min-width: 0;
}

/* Logo */
.vca-site-footer .vca-footer-brand .img {
    max-width: 195px;
    margin: 0 0 15px;
}

.vca-site-footer .vca-footer-brand img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.vca-site-footer .vca-footer-description {
    max-width: 240px;
    color: var(--footer-muted);
    font-size: 14px;
    line-height: 1.7;
}

.vca-site-footer .vca-footer-description p {
    margin: 0;
}

/* Tiêu đề các cột */
.vca-site-footer .vca-footer-heading {
    position: relative;
    margin: 0 0 20px !important;
    padding: 0 0 14px;
    color: var(--footer-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0;
}

.vca-site-footer .vca-footer-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    background: var(--footer-primary);
}

/* Thông tin liên hệ */
.vca-site-footer .vca-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.vca-site-footer .vca-footer-contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.vca-site-footer .vca-footer-contact-item strong {
    color: var(--footer-text);
    font-size: 14px;
    font-weight: 600;
}

.vca-site-footer .vca-footer-contact-item span,
.vca-site-footer .vca-footer-contact-item a {
    color: var(--footer-muted);
}

/* Menu Footer */
.vca-site-footer .ux-menu {
    margin: 0;
    padding: 0;
}

.vca-site-footer .ux-menu-link {
    margin: 0;
    border: 0 !important;
}

.vca-site-footer .ux-menu-link__link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 8px 0 8px 15px !important;
    border: 0 !important;
    color: var(--footer-text);
    background: transparent !important;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    transition: color 0.2s ease;
}

.vca-site-footer .ux-menu-link__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    width: 6px;
    height: 6px;
    border-top: 2px solid var(--footer-primary);
    border-right: 2px solid var(--footer-primary);
    transform: rotate(45deg);
}

.vca-site-footer .ux-menu-link__link:hover,
.vca-site-footer .vca-footer-contact-item a:hover {
    color: var(--footer-hover) !important;
}

/* Bản quyền */
#footer .absolute-footer {
    padding: 15px 20px !important;
    border-top: 1px solid #DCE6EC;
    background: #F0F7FA !important;
    color: #102B40 !important;
    font-size: 14px;
    line-height: 1.6;
}

#footer .absolute-footer .copyright-footer {
    color: #102B40 !important;
    text-align: center;
}

#footer .absolute-footer a {
    color: #102B40;
}

#footer .absolute-footer a:hover {
    color: #008FC7;
}

/* Tablet */
@media only screen and (min-width: 550px)
and (max-width: 1024px) {
    .vca-site-footer .vca-footer-row > .col {
        flex-basis: 50% !important;
        max-width: 50% !important;
        padding: 0 20px 30px;
    }

    .vca-site-footer .vca-footer-row {
        padding: 0 10px;
    }

    .vca-site-footer .vca-footer-heading {
        font-size: 17px;
    }

    .vca-site-footer .vca-footer-brand .img {
        max-width: 175px;
    }
}

/* Mobile */
@media only screen and (max-width: 549px) {
    .vca-site-footer {
        padding: 25px 0 5px !important;
    }

    .vca-site-footer .vca-footer-row {
        padding: 0 15px;
    }

    .vca-site-footer .vca-footer-row > .col {
        padding: 0 10px 25px;
    }

    .vca-site-footer .vca-footer-brand {
        text-align: center;
    }

    .vca-site-footer .vca-footer-brand .img {
        max-width: 150px;
        margin: 0 auto 12px;
    }

    .vca-site-footer .vca-footer-description {
        max-width: 280px;
        margin: 0 auto;
    }

    .vca-site-footer .vca-footer-heading {
        font-size: 16px;
        margin-bottom: 12px !important;
        padding-bottom: 12px;
    }

    .vca-site-footer .vca-footer-contact-item {
        font-size: 14px;
    }

    .vca-site-footer .ux-menu-link__link {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        font-size: 14px;
    }

    .vca-site-footer .ux-menu-link__link::before {
        top: 17px;
    }

    #footer .absolute-footer {
        padding: 12px 15px !important;
        font-size: 12px;
    }
}
