/*
Theme Name: CCE Guru Pro
Author: CCE Guru Team
Description: High CPC, SEO-Optimized Magazine Theme with Sticky Ads & Load More.
Version: 5.0
*/

/* --- 1. RESET & VARIABLES --- */
:root {
    --brand-blue: #0A2C58;
    --brand-green: #2AAE8F;
    --brand-red: #d32f2f;
    --text-main: #2c2c2c;
    --bg-light: #f4f4f4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    padding-bottom: 100px; /* Space for Sticky Ad */
}

a { text-decoration: none; color: var(--brand-blue); transition: color 0.2s; }
a:hover { color: var(--brand-red); }
img { max-width: 100%; height: auto; display: block; }

/* --- 2. LAYOUT GRID SYSTEM --- */
.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 15px;
}

.site-content {
    display: grid;
    grid-template-columns: 70% 30%; /* Content vs Sidebar */
    gap: 30px;
    margin-top: 30px;
}

/* --- 3. HEADER & NAVIGATION --- */
.site-header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: relative; z-index: 500; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; }
.site-branding h1 { font-size: 28px; font-weight: 800; margin: 0; }

.main-navigation { background: var(--brand-blue); }
.main-navigation ul { list-style: none; display: flex; justify-content: center; margin: 0; padding: 0; }
.main-navigation ul li { position: relative; }

.main-navigation a { display: block; color: #fff; padding: 12px 20px; font-weight: 500; font-size: 15px; }
.main-navigation a:hover { background: rgba(255,255,255,0.1); }

/* Dropdown Menus */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    flex-direction: column;
    z-index: 999;
    border-top: 3px solid var(--brand-red);
}
.main-navigation ul li:hover > ul { display: flex; }
.main-navigation ul ul a { color: #333; padding: 12px 15px; border-bottom: 1px solid #eee; }
.main-navigation ul ul a:hover { background: #f9f9f9; color: var(--brand-red); }

/* --- 4. MAGAZINE SECTIONS --- */
.mag-section { background: #fff; padding: 25px; border-radius: 8px; margin-bottom: 30px; border-top: 4px solid var(--brand-blue); }
.section-title { 
    font-size: 22px; 
    margin-bottom: 20px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    display: flex; justify-content: space-between; align-items: center;
}
.view-all { font-size: 14px; font-weight: 600; color: var(--brand-red); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.post-card h3 { font-size: 17px; margin-top: 10px; line-height: 1.4; font-weight: 700; }
.post-thumb { height: 160px; width: 100%; object-fit: cover; border-radius: 6px; }

/* --- 5. SINGLE POST --- */
.single-content-box { background: #fff; padding: 30px; border-radius: 8px; }
.entry-title { font-size: 32px; line-height: 1.2; margin-bottom: 10px; color: #000; }
.entry-meta { color: #777; font-size: 14px; margin-bottom: 25px; border-bottom: 1px solid #eee; padding-bottom: 15px; }

.entry-content p { 
    font-size: 19px; 
    line-height: 1.8; 
    margin-bottom: 25px; 
    color: #333; 
}
.entry-content h2, .entry-content h3 { margin-top: 40px; margin-bottom: 15px; color: var(--brand-blue); }
.entry-content ul, .entry-content ol { padding-left: 20px; margin-bottom: 25px; font-size: 18px; }

/* Breadcrumbs & Related Posts */
.breadcrumbs { font-size: 13px; color: #666; margin: 20px 0; }
.breadcrumbs a { color: #666; }
.related-posts { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; }

/* --- 6. AD SLOTS & WIDGETS --- */
.ad-slot { 
    background: transparent; 
    border: none; 
    text-align: center; 
    margin: 20px auto; 
    padding: 0; 
    display: flex; justify-content: center; align-items: center; 
    position: relative;
    min-height: 250px; 
}

/* SIDEBAR STICKY */
aside { height: 100%; }
.sticky-widget { position: -webkit-sticky; position: sticky; top: 20px; z-index: 90; }

/* LOAD MORE BUTTON */
#cce_loadmore {
    background-color: var(--brand-blue);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#cce_loadmore:hover { background-color: var(--brand-red); transform: translateY(-2px); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }

/* --- 7. RESPONSIVE (EDGE-TO-EDGE ADS) --- */
@media (max-width: 800px) {
    /* Full Width Containers */
    .container { 
        padding-left: 0 !important; 
        padding-right: 0 !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        overflow-x: hidden; 
    }

    .site-content { 
        display: flex !important; 
        flex-direction: column; /* Stack Content then Sidebar */
        width: 100% !important; 
        margin-top: 0 !important; 
        gap: 0 !important;
    }

    /* Box Reset: No padding/margin for boxes so ads touch edge */
    .single-content-box, 
    .mag-section,
    .page .container { 
        padding: 10px 0 !important; 
        margin-bottom: 20px !important;
        border-radius: 0 !important;
        box-shadow: none !important; 
        width: 100% !important;
        background: #fff;
    }

    /* Text Safety: Padding ONLY for text elements */
    .entry-content > p, 
    .entry-content > h1, 
    .entry-content > h2, 
    .entry-content > h3, 
    .entry-content > h4, 
    .entry-content > ul, 
    .entry-content > ol,
    .entry-title,
    .entry-meta,
    .breadcrumbs,
    .section-title,
    .post-navigation {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Ads: Full Width & Visible */
    .ad-slot, .header-ad, .google-auto-placed {
        margin: 15px 0 !important;
        padding: 10px 0 !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        background: #f8f9fa;
        overflow: visible !important;
    }
    
    ins.adsbygoogle { width: 100% !important; min-width: 300px !important; }

    /* Sidebar: Visible at Bottom */
    aside { 
        display: block !important; 
        width: 100% !important;
        padding: 20px 0 !important;
        background: #fff;
        border-top: 5px solid #eee;
    }
    .sticky-widget { position: static !important; height: auto !important; }

    /* Navigation & Header */
    .header-inner { flex-direction: column; text-align: center; width: 100% !important; padding: 0 !important; }
    .site-branding { padding: 15px; }
    .main-navigation ul { flex-wrap: wrap; }
    .main-navigation ul li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); }
    
    /* Grid */
    .post-grid { padding: 0 10px !important; }
}

/* --- 8. STICKY FOOTER AD --- */
.cce-sticky-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 1px solid #ddd;
    animation: slideUp 0.5s ease-out;
    height: 110px; /* Mobile Default */
    padding-top: 5px;
}
@media (min-width: 800px) {
    .cce-sticky-ad-container { height: 100px; padding-top: 5px; }
}
.cce-sticky-close {
    position: absolute;
    top: -30px;
    right: 5px;
    background: #333;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }