/**
 * VNEconomics Custom Header Styles
 * Matches the design of vneconomics.com
 */

/* Wrapper để group tất cả header sections - Sticky từ top header */
.vneconomics-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 10000;
    width: 100%;
    background-color: #ffffff; /* Fallback background */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Top Header Bar - Blue Background */
.vneconomics-top-header {
    background-color: #0066cc;
    color: #ffffff;
    padding: 12px 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative; /* Relative vì wrapper đã sticky */
}

.vneconomics-top-header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.vneconomics-top-header-left {
    flex: 0 0 auto;
    min-width: 0;
    flex-shrink: 0;
}

.vneconomics-social-icons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.vneconomics-social-icons a {
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    filter: brightness(1.2) contrast(1.1) !important;
    background: none !important;
    border: none !important;
}

.vneconomics-social-icons a:hover {
    opacity: 0.9 !important;
    transform: scale(1.1) !important;
    filter: brightness(1.3) contrast(1.2) !important;
}

.vneconomics-social-icons .fa,
.vneconomics-social-icons .fab,
.vneconomics-social-icons .fas,
.vneconomics-social-icons i {
    font-size: 16px !important;
    font-weight: normal !important;
    opacity: 1 !important;
    color: inherit !important;
    background: transparent !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
}

.vneconomics-top-header-center {
    flex: 1;
    text-align: center;
    padding: 0 20px;
    min-width: 0;
    overflow: visible;
}

.vneconomics-tagline {
    color: #ffffff;
    font-size: 14px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.4;
    text-align: center;
}

.vneconomics-top-header-right {
    flex: 0 0 auto;
    min-width: 0;
    flex-shrink: 0;
}

.vneconomics-top-search {
    position: relative;
}

.vneconomics-top-search .search-form {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-radius: 25px;
    padding: 0;
    overflow: hidden;
}

.vneconomics-top-search .search-field {
    background: transparent;
    border: none;
    padding: 8px 15px;
    width: 200px;
    max-width: 100%;
    font-size: 14px;
    outline: none;
    color: #333;
    box-sizing: border-box;
}

.vneconomics-top-search .search-submit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vneconomics-top-search .fa-search {
    font-size: 16px;
    color: #0066cc;
}

/* Navigation/Action Bar - White Background */
.vneconomics-action-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    width: 100%;
    position: relative;
    z-index: 9999;
}

.vneconomics-action-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    gap: 20px;
}

.vneconomics-action-bar-left {
    flex: 0 0 auto;
}

.vneconomics-logo {
    display: flex;
    align-items: center;
}

/* Custom logo size reduction */
.vneconomics-logo img,
.vneconomics-logo .custom-logo,
.vneconomics-logo a img {
    max-width: 100px;
    max-height: 35px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.vneconomics-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0066cc;
}

/* Extra HuongNghiepDuLieu logo next to main logo */
.vneconomics-logo-extra {
    display: inline-flex;
    align-items: center;
    margin-left: 14px;
}

.vneconomics-logo-extra img {
    max-width: 110px;
    max-height: 32px;
}

.vneconomics-logo-icon {
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    background-color: #0066cc;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-book {
    font-size: 12px;
    display: block;
    line-height: 1;
}

.logo-q,
.logo-b {
    position: absolute;
    font-size: 6px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1;
}

.logo-q {
    top: 3px;
    left: 4px;
}

.logo-b {
    bottom: 3px;
    right: 4px;
}

.vneconomics-logo-text {
    font-size: 16px;
    font-weight: bold;
    color: #0066cc;
    white-space: nowrap;
}

.vneconomics-action-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    min-width: 0; /* Allow flexbox to shrink */
}

.vneconomics-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

.vneconomics-action-buttons-row {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* First row - 3 blue buttons */
.vneconomics-action-buttons-row:first-child {
    justify-content: center;
}

/* Second row - 2 red buttons, centered */
.vneconomics-action-buttons-row:last-child {
    justify-content: center;
}

.vneconomics-action-btn {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    line-height: 1.3;
}

.vneconomics-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.vneconomics-btn-blue {
    background-color: #0066cc;
}

.vneconomics-btn-red {
    background-color: #cc0000;
}

.vneconomics-action-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.vneconomics-contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333333;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.vneconomics-contact-link:hover {
    color: #0066cc;
    background-color: #f5f5f5;
}

.vneconomics-contact-link .fa-envelope {
    font-size: 18px;
}

/* Main Navigation Menu */
.vneconomics-main-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 9998;
}

.vneconomics-main-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    gap: 20px;
}

.vneconomics-nav-menu {
    flex: 1;
    min-width: 0;
}

.vneconomics-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.vneconomics-menu li {
    position: relative;
    margin: 0;
}

.vneconomics-menu a {
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    line-height: 1.4;
}

.vneconomics-menu a:hover {
    color: #0066cc;
}

.vneconomics-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0066cc;
    transition: width 0.3s ease;
}

.vneconomics-menu a:hover::before {
    width: 100%;
}

.vneconomics-menu .menu-item-has-children > a {
    padding-right: 0;
    display: inline-block;
}

.vneconomics-menu .menu-item-has-children > a::after {
    content: ' ▼';
    font-size: 9px;
    margin-left: 4px;
    position: static;
    background: none;
    width: auto;
    height: auto;
    display: inline;
    vertical-align: middle;
    line-height: 1;
}

/* Hide ColorMag's default submenu toggle icon (SVG) */
.vneconomics-menu .cm-submenu-toggle {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Submenu - Hidden by default */
.vneconomics-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    border-top: 3px solid #0066cc;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
}

/* Show submenu on hover */
.vneconomics-menu li:hover > .sub-menu,
.vneconomics-menu li.menu-item-has-children:hover > .sub-menu {
    display: block;
}

/* Submenu items styling */
.vneconomics-menu .sub-menu li {
    position: relative;
    width: 100%;
}

.vneconomics-menu .sub-menu a {
    padding: 10px 20px;
    color: #333333;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.vneconomics-menu .sub-menu a::after {
    display: none;
}

.vneconomics-menu .sub-menu a:hover {
    background-color: #f8f9fa;
    color: #0066cc;
    padding-left: 25px;
}

.vneconomics-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* Multi-level submenu (submenu of submenu) */
.vneconomics-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 5px;
}

/* Arrow for submenu items that have children */
.vneconomics-menu .sub-menu .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vneconomics-menu .sub-menu .menu-item-has-children > a::after {
    content: ' ▶';
    font-size: 10px;
    margin-left: auto;
    margin-right: 0;
    position: static;
    background: none;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.vneconomics-nav-right {
    flex: 0 0 auto;
}

.vneconomics-login-btn {
    background-color: #0066cc;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.vneconomics-login-btn:hover {
    background-color: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.3);
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .vneconomics-top-header-container {
        padding: 0 20px;
    }
    
    .vneconomics-tagline {
        font-size: 13px;
    }
    
    .vneconomics-top-search .search-field {
        width: 180px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    /* Top Header Responsive */
    .vneconomics-top-header {
        padding: 10px 0;
    }
    
    .vneconomics-top-header-container {
        flex-direction: column;
        gap: 12px;
        padding: 0 15px;
    }
    
    .vneconomics-top-header-left,
    .vneconomics-top-header-center,
    .vneconomics-top-header-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .vneconomics-top-header-center {
        order: -1;
        padding: 0;
    }
    
    .vneconomics-tagline {
        font-size: 11px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
        line-height: 1.4;
        padding: 0 10px;
    }
    
    /* Social icons - smaller on mobile */
    .vneconomics-social-icons {
        justify-content: center;
        gap: 6px;
    }
    
    .vneconomics-social-icons a {
        width: 28px;
        height: 28px;
    }
    
    .vneconomics-social-icons .fa {
        font-size: 14px;
    }
    
    /* Search bar - smaller on mobile */
    .vneconomics-top-search {
        width: 100%;
        max-width: 300px;
    }
    
    .vneconomics-top-search .search-field {
        width: 100%;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .vneconomics-top-search .search-submit {
        padding: 6px 10px;
    }
    
    .vneconomics-top-search .fa-search {
        font-size: 14px;
    }
    
    .vneconomics-action-bar-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
    }
    
    .vneconomics-action-bar-left,
    .vneconomics-action-bar-center,
    .vneconomics-action-bar-right {
        width: 100%;
        justify-content: center;
    }
    
    .vneconomics-logo {
        justify-content: center;
    }
    
    .vneconomics-action-buttons {
        width: 100%;
        max-width: 100%;
    }
    
    .vneconomics-action-buttons-row {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .vneconomics-action-btn {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }
    
    .vneconomics-contact-link {
        justify-content: center;
        width: 100%;
        padding: 10px;
    }
    
    .vneconomics-main-nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .vneconomics-menu {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }
    
    .vneconomics-menu li {
        width: 100%;
    }
    
    /* Mobile: Submenu always visible when parent is clicked */
    .vneconomics-menu .sub-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e0e0e0;
        margin-top: 5px;
        padding-left: 20px;
    }
    
    .vneconomics-menu .sub-menu .sub-menu {
        position: static;
        margin-left: 0;
        padding-left: 20px;
    }
    
    .vneconomics-login-btn {
        width: 100%;
        text-align: center;
    }
}

/* Homepage Hero Section */
.vneconomics-hero-section {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: #ffffff;
    padding: 80px 20px;
    text-align: center;
    width: 100%;
}

.vneconomics-hero-container {
    max-width: 1200px;
    margin: 0 auto;
}

.vneconomics-hero-headline {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
    line-height: 1.2;
}

.vneconomics-hero-description {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .vneconomics-hero-headline {
        font-size: 32px;
    }
    
    .vneconomics-hero-description {
        font-size: 16px;
    }
}

/* Embedded Content Styles */
.vneconomics-embedded-content {
    width: 100%;
    min-height: 800px;
    margin: 20px 0;
    position: relative;
}

.vneconomics-embedded-content iframe {
    width: 100%;
    height: 100vh;
    min-height: 800px;
    border: none;
    display: block;
}

@media (max-width: 768px) {
    .vneconomics-embedded-content {
        min-height: 600px;
    }
    
    .vneconomics-embedded-content iframe {
        min-height: 600px;
        height: 100vh;
    }
}

/* Crypto Price Table Styles */
.vneconomics-crypto-price-table {
    width: 100%;
    margin: 30px 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.crypto-price-header {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: #ffffff;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crypto-price-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.last-update {
    font-size: 14px;
    opacity: 0.9;
}

.crypto-table-wrapper {
    overflow-x: auto;
}

.crypto-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.crypto-price-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.crypto-price-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
}

.crypto-price-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #333333;
}

.crypto-price-table tbody tr:hover {
    background-color: #f8f9fa;
}

.crypto-price-table .price {
    font-weight: 600;
    color: #0066cc;
    font-size: 15px;
}

.crypto-price-table .change {
    font-weight: 600;
}

.crypto-price-table .change.positive {
    color: #28a745;
}

.crypto-price-table .change.negative {
    color: #dc3545;
}

.crypto-price-table .change.neutral {
    color: #6c757d;
}

@media (max-width: 768px) {
    .crypto-price-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .crypto-price-header h2 {
        font-size: 20px;
    }
    
    .crypto-price-table {
        font-size: 12px;
    }
    
    .crypto-price-table th,
    .crypto-price-table td {
        padding: 10px 8px;
    }
}

/* Embedded Content Styles */
.vneconomics-embedded-content {
    width: 100%;
    min-height: 800px;
    margin: 20px 0;
}

.vneconomics-iframe-container {
    width: 100%;
    min-height: 800px;
    margin: 20px 0;
}

.vneconomics-iframe-container iframe {
    width: 100%;
    height: 100vh;
    min-height: 800px;
    border: none;
    display: block;
}

/* Fetched Content Styles */
.vneconomics-fetched-content {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.vneconomics-fetched-content img {
    max-width: 100%;
    height: auto;
}

.vneconomics-fetched-content table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.vneconomics-fetched-content a {
    color: #0066cc;
    text-decoration: underline;
}

.vneconomics-fetched-content a:hover {
    color: #0052a3;
}

/* Desktop: Homepage Primary với margin cho sidebar */
@media (min-width: 769px) {
    #cm-primary.vneconomics-homepage-primary {
        margin-left: 270px !important;
        margin-right: 270px !important;
        padding: 0 30px !important;
        max-width: none !important;
        width: calc(100% - 540px) !important;
    }
    
    @media (max-width: 1600px) {
        #cm-primary.vneconomics-homepage-primary {
            margin-left: 260px !important;
            margin-right: 260px !important;
            width: calc(100% - 520px) !important;
        }
    }
    
    @media (max-width: 1400px) {
        #cm-primary.vneconomics-homepage-primary {
            margin-left: 250px !important;
            margin-right: 250px !important;
            width: calc(100% - 500px) !important;
        }
    }
}

/* Homepage Left Banner - Đảm bảo luôn ở bên trái */
.vneconomics-homepage-left-banner,
body .vneconomics-homepage-left-banner,
html .vneconomics-homepage-left-banner,
#page .vneconomics-homepage-left-banner,
.cm-content .vneconomics-homepage-left-banner,
.cm-row .vneconomics-homepage-left-banner,
body #page .vneconomics-homepage-left-banner {
    position: fixed !important;
    left: 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    transform: none !important;
    right: auto !important;
    float: none !important;
    text-align: left !important;
    display: block !important;
}

/* Đảm bảo không có container nào center banner */
body.home .vneconomics-homepage-left-banner,
body.home-page .vneconomics-homepage-left-banner {
    left: 0 !important;
    position: fixed !important;
}

/* Right Banner Styles for Homepage - CHỈ áp dụng cho homepage */
body.home .vneconomics-homepage-right-banner,
body.home-page .vneconomics-homepage-right-banner {
    position: fixed !important;
    right: 0 !important;
    margin-right: 0 !important;
    margin-left: auto !important;
    transform: none !important;
    left: auto !important;
    float: none !important;
    text-align: left !important;
    display: block !important;
}

/* Ẩn banner homepage trên các trang khác (không phải homepage) */
body:not(.home):not(.home-page) .vneconomics-homepage-right-banner,
body:not(.home):not(.home-page) .vneconomics-homepage-left-banner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

/* Layout 3 cột đều nhau cho homepage */
.home #cm-primary .cm-posts.col-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
}

.home #cm-primary .cm-posts.col-3 article {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* Đảm bảo các bài viết trong 3 cột có kích thước đều nhau */
.home #cm-primary .cm-posts.col-3 .cm-post-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (max-width: 1400px) {
    .home #cm-primary .cm-posts.col-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 1200px) {
    .home #cm-primary .cm-posts.col-3 {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   RESPONSIVE MOBILE CHO TRANG CHỦ
   ============================================ */
@media (max-width: 768px) {
    /* Ẩn left và right banner trên mobile - với specificity cao */
    .vneconomics-homepage-left-banner,
    body .vneconomics-homepage-left-banner,
    html .vneconomics-homepage-left-banner,
    #page .vneconomics-homepage-left-banner,
    .cm-content .vneconomics-homepage-left-banner,
    .cm-row .vneconomics-homepage-left-banner,
    body #page .vneconomics-homepage-left-banner,
    body.home .vneconomics-homepage-left-banner,
    body.home-page .vneconomics-homepage-left-banner,
    .vneconomics-homepage-right-banner,
    body .vneconomics-homepage-right-banner,
    html .vneconomics-homepage-right-banner,
    #page .vneconomics-homepage-right-banner,
    .cm-content .vneconomics-homepage-right-banner,
    .cm-row .vneconomics-homepage-right-banner {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Điều chỉnh layout homepage trên mobile - Override inline styles */
    body.home #cm-primary,
    body.home-page #cm-primary,
    .home #cm-primary,
    body.home #cm-primary.vneconomics-homepage-primary,
    body.home-page #cm-primary.vneconomics-homepage-primary,
    .home #cm-primary.vneconomics-homepage-primary,
    #cm-primary.vneconomics-homepage-primary[style] {
        padding: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body.home #cm-primary .cm-posts,
    body.home-page #cm-primary .cm-posts,
    .home #cm-primary .cm-posts {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body.home #cm-primary .cm-posts.col-3,
    body.home-page #cm-primary .cm-posts.col-3,
    .home #cm-primary .cm-posts.col-3 {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        display: grid !important;
    }
    
    /* Điều chỉnh homepage sections wrapper */
    .vneconomics-homepage-sections-wrapper {
        padding: 0 15px !important;
        margin: 20px auto !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .vneconomics-homepage-sections-wrapper > div:last-child {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        display: grid !important;
    }
    
    /* Override inline styles cho h2 - với specificity cao nhất */
    .vneconomics-homepage-sections-wrapper h2,
    .vneconomics-homepage-sections-wrapper h2[style],
    div[style] .vneconomics-homepage-sections-wrapper h2,
    .vneconomics-homepage-sections-wrapper > div[style] h2,
    .vneconomics-homepage-sections-wrapper > div:first-child[style] h2 {
        font-size: 24px !important;
        margin-bottom: 20px !important;
        padding: 0 10px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        color: #333 !important;
        font-weight: bold !important;
    }
    
    /* Override inline styles cho div wrapper */
    .vneconomics-homepage-sections-wrapper > div[style],
    .vneconomics-homepage-sections-wrapper > div:first-child[style] {
        text-align: center !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
    }
    
    /* Override inline styles cho wrapper chính */
    .vneconomics-homepage-sections-wrapper[style],
    div.vneconomics-homepage-sections-wrapper[style] {
        max-width: 100% !important;
        margin: 20px auto !important;
        padding: 0 15px !important;
    }
    
    /* Override inline styles cho grid 2 cột */
    .vneconomics-homepage-sections-wrapper > div:last-child[style],
    .vneconomics-homepage-sections-wrapper > div[style][style*="grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        align-items: stretch !important;
    }
    
    /* Course card và sponsored card trên mobile */
    .vneconomics-course-card,
    .vneconomics-sponsored-card {
        margin-bottom: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Đảm bảo nội dung không bị che */
    body.home .cm-row,
    body.home-page .cm-row,
    .home .cm-row {
        margin: 0 !important;
        padding: 0 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body.home #cm-primary .cm-posts article,
    body.home-page #cm-primary .cm-posts article,
    .home #cm-primary .cm-posts article {
        margin-bottom: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Header sections trên mobile */
    .vneconomics-homepage-sections-wrapper .vneconomics-course-card h3,
    .vneconomics-homepage-sections-wrapper .vneconomics-sponsored-card h3 {
        font-size: 18px !important;
        padding: 20px 15px 15px !important;
        line-height: 1.3 !important;
    }
    
    /* Đảm bảo sidebar không hiển thị trên mobile homepage */
    body.home #cm-secondary,
    body.home-page #cm-secondary,
    .home #cm-secondary {
        display: none !important;
    }
    
    /* Full width cho content trên mobile */
    body.home #cm-primary,
    body.home-page #cm-primary,
    .home #cm-primary {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
}

/* ============================================
   STYLING CHO TRANG CHI TIẾT BÀI VIẾT (SINGLE POST)
   ============================================ */

/* Container chính cho single post */
.single-post #cm-primary,
.single #cm-primary {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 50px 40px !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-top: 30px !important;
    margin-bottom: 50px !important;
}

/* Featured Image */
.single-post .cm-featured-image,
.single .cm-featured-image {
    margin: -50px -40px 40px -40px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    position: relative;
}

.single-post .cm-featured-image::after,
.single .cm-featured-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
}

.single-post .cm-featured-image img,
.single .cm-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.single-post .cm-featured-image:hover img,
.single .cm-featured-image:hover img {
    transform: scale(1.02);
}

/* Post Content Wrapper */
.single-post .cm-post-content,
.single .cm-post-content {
    background: #ffffff;
    padding: 32px 40px;
    border-radius: 18px;
    border: 1px solid #e5e8ff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    margin-bottom: 56px;
}

/* Tăng độ thoáng tổng thể cho khu vực bài viết */
body.single-post #cm-primary,
body.single #cm-primary {
    background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 40%, #f5f7ff 100%);
    padding-top: 32px;
    padding-bottom: 48px;
}

/* Giới hạn độ rộng nội dung để dễ đọc hơn */
body.single-post #cm-primary .cm-posts,
body.single #cm-primary .cm-posts {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Đảm bảo iframe tràn ra ngoài max-width container - Sát viền màn hình */
body.single-post #cm-primary .cm-posts .cm-entry-summary iframe,
body.single #cm-primary .cm-posts .cm-entry-summary iframe,
body.page #cm-primary .cm-posts .cm-entry-summary iframe,
body.page-template #cm-primary .cm-posts .cm-entry-summary iframe,
body.single-post #cm-primary .cm-posts .cm-entry-summary embed,
body.single #cm-primary .cm-posts .cm-entry-summary embed,
body.page #cm-primary .cm-posts .cm-entry-summary embed,
body.page-template #cm-primary .cm-posts .cm-entry-summary embed,
body.single-post #cm-primary .cm-posts .cm-entry-summary object,
body.single #cm-primary .cm-posts .cm-entry-summary object,
body.page #cm-primary .cm-posts .cm-entry-summary object,
body.page-template #cm-primary .cm-posts .cm-entry-summary object {
    position: relative;
    left: calc(50% - 50vw) !important;
    right: calc(50% - 50vw) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Sticky Recent Posts widget on single post (desktop only) */
@media (min-width: 1024px) {
    body.single-post #cm-secondary .widget_recent_entries {
        position: sticky;
        top: 110px;
        z-index: 10;
    }
}

/* Category Badge */
.single-post .cm-post-categories,
.single .cm-post-categories {
    margin-bottom: 20px;
}

.single-post .cm-post-categories a,
.single .cm-post-categories a {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.single-post .cm-post-categories a:hover,
.single .cm-post-categories a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Post Title */
.single-post .cm-entry-title,
.single .cm-entry-title {
    font-size: 42px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    margin: 0 0 30px 0 !important;
    padding-bottom: 25px;
    border-bottom: 3px solid #e8eaf6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.single-post .cm-entry-title a,
.single .cm-entry-title a {
    color: #1a1a1a !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.single-post .cm-entry-title a:hover,
.single .cm-entry-title a:hover {
    color: #667eea !important;
}

/* Post Meta */
.single-post .cm-below-entry-meta,
.single .cm-below-entry-meta {
    font-size: 15px;
    color: #555;
    margin-bottom: 35px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e8eaf6;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.single-post .cm-below-entry-meta .cm-author a,
.single .cm-below-entry-meta .cm-author a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.single-post .cm-below-entry-meta .cm-author a:hover,
.single .cm-below-entry-meta .cm-author a:hover {
    color: #764ba2;
}

.single-post .cm-below-entry-meta .cm-post-views,
.single .cm-below-entry-meta .cm-post-views {
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
}

.single-post .cm-below-entry-meta svg,
.single .cm-below-entry-meta svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Post Content */
.single-post .cm-entry-summary,
.single .cm-entry-summary {
    font-size: 19px;
    line-height: 1.85;
    color: #2c3e50;
    margin-bottom: 50px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.single-post .cm-entry-summary p,
.single .cm-entry-summary p {
    margin-bottom: 20px;
}

.single-post .cm-entry-summary h2,
.single .cm-entry-summary h2 {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 45px 0 25px 0;
    padding: 18px 22px;
    border-left: 6px solid #667eea;
    background: linear-gradient(to right, #f8f9ff, transparent);
    border-radius: 0 8px 8px 0;
    letter-spacing: -0.3px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.12);
}

.single-post .cm-entry-summary h3,
.single .cm-entry-summary h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 30px 0 15px 0;
}

.single-post .cm-entry-summary h4,
.single .cm-entry-summary h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 25px 0 12px 0;
}

.single-post .cm-entry-summary ul,
.single .cm-entry-summary ul,
.single-post .cm-entry-summary ol,
.single .cm-entry-summary ol {
    margin: 20px 0 24px 32px;
    padding: 0;
}

.single-post .cm-entry-summary li,
.single .cm-entry-summary li {
    margin-bottom: 12px;
    line-height: 1.8;
    position: relative;
}

/* Tạo bullet rõ hơn, hiện đại hơn */
.single-post .cm-entry-summary ul li::marker,
.single .cm-entry-summary ul li::marker {
    color: #667eea;
    font-size: 1.1em;
}

.single-post .cm-entry-summary a,
.single .cm-entry-summary a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.single-post .cm-entry-summary a:hover,
.single .cm-entry-summary a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.single-post .cm-entry-summary img,
.single .cm-entry-summary img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Iframe/Embed tràn ra ngoài viền - sát viền màn hình - Áp dụng cho TẤT CẢ các trang */
.cm-post-content,
.cm-entry-summary,
.entry-content,
.post-content,
.page-content,
.wp-block-embed,
.wp-block-embed__wrapper {
    overflow: visible !important;
}

/* Iframe/Embed trong bài viết, trang, và tất cả nội dung - Tràn sát viền màn hình */
.cm-entry-summary iframe,
.entry-content iframe,
.post-content iframe,
.page-content iframe,
.cm-post-content iframe,
.wp-block-embed iframe,
.wp-block-embed__wrapper iframe,
.cm-entry-summary embed,
.entry-content embed,
.post-content embed,
.page-content embed,
.cm-post-content embed,
.wp-block-embed embed,
.cm-entry-summary object,
.entry-content object,
.post-content object,
.page-content object,
.cm-post-content object,
.wp-block-embed object {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    border-radius: 0 !important;
    display: block;
    position: relative;
    left: 0;
    right: 0;
    transform: translateX(0);
}

/* Wrapper cho iframe để đảm bảo tràn ra ngoài */
.cm-entry-summary,
.entry-content,
.post-content,
.page-content,
.cm-post-content {
    position: relative;
}

/* Tràn ra ngoài container cha - Áp dụng cho tất cả */
html,
body {
    overflow-x: visible !important;
}

#cm-primary .cm-posts,
#cm-primary,
.cm-row,
.cm-container,
.site-content,
.content-area,
#page,
.site {
    overflow: visible !important;
    overflow-x: visible !important;
}

/* Đặc biệt cho page - đảm bảo iframe tràn ra ngoài */
body.page .cm-entry-summary,
body.page-template .cm-entry-summary,
.page .cm-entry-summary,
.page-template .cm-entry-summary {
    overflow: visible !important;
}

body.page #cm-primary,
body.page-template #cm-primary,
.page #cm-primary,
.page-template #cm-primary {
    overflow: visible !important;
}

body.page .cm-row,
body.page-template .cm-row,
.page .cm-row,
.page-template .cm-row {
    overflow: visible !important;
}

/* Đảm bảo article wrapper cũng cho phép overflow */
body.page article,
body.page-template article,
.page article,
.page-template article {
    overflow: visible !important;
}

/* Responsive: trên mobile giữ nguyên padding */
@media (max-width: 768px) {
    .cm-entry-summary iframe,
    .entry-content iframe,
    .post-content iframe,
    .page-content iframe,
    .cm-post-content iframe,
    .wp-block-embed iframe,
    .wp-block-embed__wrapper iframe,
    .cm-entry-summary embed,
    .entry-content embed,
    .post-content embed,
    .page-content embed,
    .cm-post-content embed,
    .wp-block-embed embed,
    .cm-entry-summary object,
    .entry-content object,
    .post-content object,
    .page-content object,
    .cm-post-content object,
    .wp-block-embed object {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 8px !important;
    }
}

.single-post .cm-entry-summary blockquote,
.single .cm-entry-summary blockquote {
    border-left: 5px solid #667eea;
    padding: 25px 30px;
    margin: 30px 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #444;
    font-size: 20px;
    line-height: 1.7;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    position: relative;
}

.single-post .cm-entry-summary blockquote::before,
.single .cm-entry-summary blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 60px;
    color: #667eea;
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

.single-post .cm-entry-summary code,
.single .cm-entry-summary code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 16px;
    color: #e83e8c;
}

.single-post .cm-entry-summary pre,
.single .cm-entry-summary pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    font-size: 15px;
    line-height: 1.6;
}

.single-post .cm-entry-summary pre code,
.single .cm-entry-summary pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Tags */
.single-post .cm-tags,
.single .cm-tags {
    margin: 50px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e8eaf6;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.single-post .cm-tags a,
.single .cm-tags a {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f7ff;
    color: #667eea;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    margin: 5px 5px 5px 0;
    transition: all 0.3s ease;
}

.single-post .cm-tags a:hover,
.single .cm-tags a:hover {
    background: #667eea;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Related Posts */
.single-post .cm-related-posts,
.single .cm-related-posts {
    margin: 50px 0;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 12px;
}

.single-post .cm-related-posts h3,
.single .cm-related-posts h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

/* Comments Section */
.single-post #comments,
.single #comments {
    margin-top: 50px;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.single-post #comments h3,
.single #comments h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Social Share Buttons (nếu có) */
.single-post .cm-entry-summary .social-share,
.single .cm-entry-summary .social-share {
    margin: 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    text-align: center;
}

/* Reading Progress Bar */
.single-post::before,
.single::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    z-index: 99999;
    transition: width 0.1s ease;
}

/* Responsive cho Single Post */
@media (max-width: 768px) {
    .single-post #cm-primary,
    .single #cm-primary {
        padding: 30px 20px !important;
        margin-top: 20px !important;
        border-radius: 12px;
    }
    
    .single-post .cm-featured-image,
    .single .cm-featured-image {
        margin: -30px -20px 30px -20px;
        border-radius: 12px 12px 0 0;
    }
    
    .single-post .cm-entry-title,
    .single .cm-entry-title {
        font-size: 32px !important;
        line-height: 1.3 !important;
    }
    
    .single-post .cm-entry-summary,
    .single .cm-entry-summary {
        font-size: 17px;
        line-height: 1.75;
    }
    
    .single-post .cm-entry-summary h2,
    .single .cm-entry-summary h2 {
        font-size: 26px;
        padding-left: 15px;
    }
    
    .single-post .cm-entry-summary h3,
    .single .cm-entry-summary h3 {
        font-size: 22px;
    }
    
    .single-post .cm-below-entry-meta,
    .single .cm-below-entry-meta {
        padding: 15px 20px;
        font-size: 14px;
    }
}

