/* ============================================
   POST PAGE ISOLATED CSS - Sem conflitos
   Central de Notícias Brasil
   ============================================ */

/* ISOLAR COMPLETAMENTE A PÁGINA DE POST */
/* GARANTIR QUE BODY E HTML NÃO SEJAM LIMITADOS - HEADER PRECISA DE 100% DE LARGURA */
body.single-post,
body.single {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.single-post,
html.single {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
}

body.single-post main.post-page,
body.single main.post-page,
main.post-page {
    background: #f8fafc !important;
    padding: 0 0 60px !important;
    min-height: calc(100vh - 200px) !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    display: block !important;
    position: relative !important;
    clear: both !important;
    float: none !important;
}

/* Container do Post */
body.single-post main.post-page .post-container,
body.single main.post-page .post-container,
main.post-page .post-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
}

/* Layout Grid - FORÇAR EXIBIÇÃO */
body.single-post main.post-page .post-layout,
body.single main.post-page .post-layout,
main.post-page .post-layout {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 40px !important;
    margin-top: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: start !important;
    grid-auto-flow: row !important;
    position: relative !important;
}

/* Conteúdo Principal - FORÇAR EXIBIÇÃO */
body.single-post main.post-page .post-content,
body.single main.post-page .post-content,
main.post-page .post-content,
article.post-content {
    grid-column: 1 / 2 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    position: relative !important;
    float: none !important;
}

/* Sidebar - FORÇAR EXIBIÇÃO */
body.single-post main.post-page .post-sidebar,
body.single main.post-page .post-sidebar,
main.post-page .post-sidebar,
aside.post-sidebar {
    grid-column: 2 / 3 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
    width: 350px !important;
    min-width: 350px !important;
    max-width: 350px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* REMOVER QUALQUER LIMITAÇÃO DE LARGURA E CONFLITOS - APENAS DENTRO DO MAIN.POST-PAGE */
/* NÃO AFETAR ELEMENTOS FORA DO MAIN.POST-PAGE (header, footer, etc) */
body.single-post main.post-page .post-container *,
body.single main.post-page .post-container *,
main.post-page .post-container * {
    max-width: none !important;
}

/* REMOVER FLOATS E CLEARS QUE PODEM QUEBRAR O LAYOUT */
body.single-post main.post-page,
body.single main.post-page,
main.post-page {
    clear: both !important;
    float: none !important;
}

body.single-post main.post-page .post-layout,
body.single main.post-page .post-layout,
main.post-page .post-layout {
    clear: both !important;
    float: none !important;
}

body.single-post main.post-page .post-content,
body.single main.post-page .post-content,
main.post-page .post-content {
    clear: both !important;
    float: none !important;
}

body.single-post main.post-page .post-sidebar,
body.single main.post-page .post-sidebar,
main.post-page .post-sidebar {
    clear: both !important;
    float: none !important;
}

/* EXCETO para elementos específicos */
body.single-post main.post-page .post-container,
body.single main.post-page .post-container,
main.post-page .post-container {
    max-width: 1400px !important;
}

body.single-post main.post-page .post-sidebar,
body.single main.post-page .post-sidebar,
main.post-page .post-sidebar {
    max-width: 350px !important;
}

/* Widgets da Sidebar */
body.single-post main.post-page .sidebar-widget,
body.single main.post-page .sidebar-widget,
main.post-page .sidebar-widget,
.sidebar-widget {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    margin: 0 !important;
}

/* Banners da Sidebar */
body.single-post main.post-page .sidebar-ad,
body.single main.post-page .sidebar-ad,
main.post-page .sidebar-ad,
.sidebar-ad {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    background: #f1f5f9 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    min-height: 250px !important;
    margin: 0 !important;
}

/* RESPONSIVO */
@media (max-width: 992px) {
    body.single-post main.post-page .post-layout,
    body.single main.post-page .post-layout,
    main.post-page .post-layout {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Conteúdo primeiro no mobile */
    body.single-post main.post-page .post-content,
    body.single main.post-page .post-content,
    main.post-page .post-content {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 30px !important;
        grid-column: auto !important;
    }
    
    /* Sidebar depois do conteúdo no mobile */
    body.single-post main.post-page .post-sidebar,
    body.single main.post-page .post-sidebar,
    main.post-page .post-sidebar {
        order: 2 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        grid-column: auto !important;
        margin-top: 0 !important;
    }
    
    body.single-post main.post-page .sidebar-ad,
    body.single main.post-page .sidebar-ad,
    main.post-page .sidebar-ad {
        grid-column: span 2 !important;
    }
}

@media (max-width: 768px) {
    body.single-post main.post-page .post-layout,
    body.single main.post-page .post-layout,
    main.post-page .post-layout {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Conteúdo primeiro */
    body.single-post main.post-page .post-content,
    body.single main.post-page .post-content,
    main.post-page .post-content {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 30px !important;
    }
    
    /* Sidebar depois */
    body.single-post main.post-page .post-sidebar,
    body.single main.post-page .post-sidebar,
    main.post-page .post-sidebar {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important;
        margin-top: 0 !important;
    }
    
    body.single-post main.post-page .sidebar-ad,
    body.single main.post-page .sidebar-ad,
    main.post-page .sidebar-ad {
        grid-column: auto !important;
    }
}

