/**
 * Main CSS for Berita Kobar Theme 
 * Edition: Magazine Edition & Social Media Support
 * Production & Managed by: PT. Kobar Digital Nusantara
 * Update Fix: Strict Mobile Overflow Lock, Logo Auto-Resize & Dark Mode Removal
 */

/* ==========================================================================
   --- 0. Strict Mobile Reset & Overflow Lock ---
   ========================================================================== */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
    margin: 0;
    padding: 0;
}

img, video, iframe, canvas {
    max-width: 100% !important;
    height: auto;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: border-box;
}

/* --- 1. Root Variables & Brand Colors --- */
:root {
    --primary-green: #008a3d;
    --secondary-red: #ff0000;
    --bg-light: #fdfdfd;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.33s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- 2. Base Style & Typography --- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}

/* --- 3. Header & Navigation --- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.main-nav, .main-navigation {
    background: var(--primary-green);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

.nav-list li a {
    color: #fff;
    padding: 15px 20px;
    display: block;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-list li a:hover {
    background: rgba(0,0,0,0.1);
}

/* --- 4. Tickers (News & IDX) --- */
.kobar-market-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

/* --- 5. News Grid & Professional Card --- */
.professional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-card-item {
    transition: var(--transition);
}

.news-card-item:hover {
    transform: translateY(-5px);
}

.card-inner {
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.post-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card-item:hover .post-thumbnail-wrapper img {
    transform: scale(1.08);
}

/* --- 6. Sidebar (Book Effect & Social) --- */
.sidebar-book-wrapper {
    background: var(--white);
    border-left: 6px solid var(--primary-green);
    box-shadow: -1px 0 0 var(--border-color), -4px 0 0 var(--white), -10px 0 0 #d5d5d5, var(--shadow-md);
}

.widget-title {
    color: var(--text-dark);
    border-bottom: 3px solid var(--secondary-red);
}

.sidebar-social-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- 7. Decorations (Waves) --- */
.kobar-wave-separator {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background: var(--white);
}

/* --- 8. Ads & Popups --- */
.video-ad-overlay {
    backdrop-filter: blur(8px);
}

.ad-placeholder {
    background: var(--bg-light);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
}

/* ==========================================================================
   --- 9. Responsiveness ---
   ========================================================================== */

@media (max-width: 1200px) {
    .main-content-wrapper { gap: 25px; }
}

@media (max-width: 1024px) {
    .main-content-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .professional-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .sidebar-sticky-container, .sticky-sidebar { position: relative !important; top: 0 !important; }
    .sidebar-book-wrapper {
        border-left: none;
        border-top: 4px solid var(--primary-green);
        box-shadow: var(--shadow-sm) !important;
        padding-top: 20px;
    }
}

@media (max-width: 768px) {
    .site-header, .logo-wrapper, .site-branding {
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px 10px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        display: block !important;
        text-align: center !important;
    }

    .logo-wrapper img, .site-header img, .site-branding img, header img {
        max-width: 85% !important;
        width: auto !important;
        height: auto !important;
        max-height: 55px !important;
        display: block !important;
        margin: 0 auto 10px auto !important;
    }

    .logo-wrapper + div, .site-header div:has(.goog-te-gadget), header .container > div:last-child {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        margin: 5px auto 0 auto !important;
        max-width: 100% !important;
    }

    .main-nav, .main-navigation { max-width: 100% !important; overflow: hidden !important; }
    .container { padding: 0 15px; max-width: 100% !important; width: 100% !important; }
    .professional-grid { grid-template-columns: 1fr; gap: 25px; }
    .nav-list { padding-bottom: 5px; width: 100%; -webkit-overflow-scrolling: touch; }
    .nav-list li a { padding: 12px 15px; font-size: 12px; }
    .site-header { padding: 10px 0; }
    .logo-wrapper h1 { font-size: 22px !important; }
    .kobar-wave-separator svg { height: 30px; width: 100% !important; }
    .d-none-mobile { display: none !important; }
}

/* ==========================================================================
   --- 10. Renovasi Tambahan & Optimasi Layout (Integrasi index.php) ---
   ========================================================================== */
.site-content { background-color: #fdfdfd; padding-bottom: 25px; width: 100%; overflow: hidden; }
.site-content-inner { width: 100%; }
.main-content-wrapper { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: flex-start; max-width: 100%; }
.site-main { min-width: 0; max-width: 100%; }

/* Styling Judul Section - Lebih Ringkas & Elegan */
.section-header { margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 8px; }
.section-title { 
    border-left: 5px solid var(--primary-green); 
    padding-left: 12px; margin: 0; color: #333; 
    font-weight: 900; text-transform: uppercase; 
    font-size: 15px; letter-spacing: 0.5px;
    display: inline-block;
}
.section-title .title-highlight { color: var(--secondary-red); }

/* Kunci mutlak dekorasi gelombang */
.kobar-wave-separator {
    margin: -1px 0 20px 0;
}
.kobar-wave-separator svg {
    display: block;
    width: 100%;
    height: 40px;
}

/* Overwrite Sempurna Lebar Grid Berita Agar Lebih Padat */
.professional-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-width: 100%;
}

/* Penataan Khusus Postingan Pertama (Berita Utama/Sorotan) */
.professional-grid > article:first-of-type {
    grid-column: 1 / -1;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 5px;
}
.professional-grid > article:first-of-type img {
    max-height: 320px;
}
.professional-grid > article:first-of-type .entry-title,
.professional-grid > article:first-of-type h2,
.professional-grid > article:first-of-type h1 {
    font-size: 20px !important; 
    line-height: 1.3 !important;
    font-weight: 800 !important;
}

/* Kontrol Ketat Ukuran Tulisan Semua Artikel Grid Supaya Padat */
.professional-grid article {
    max-width: 100%;
}
.professional-grid article img { 
    width: 100%; height: auto; border-radius: 6px; 
    object-fit: cover; display: block; margin-bottom: 10px; 
    transition: transform 0.3s ease;
}
.professional-grid article:hover img {
    transform: scale(1.02);
}

.professional-grid article .entry-title,
.professional-grid article h2,
.professional-grid article h3,
.professional-grid article h4 {
    font-size: 14.5px !important; 
    line-height: 1.4 !important;
    font-weight: 700 !important;
    margin: 8px 0 6px 0 !important;
}
.professional-grid article .entry-title a,
.professional-grid article h2 a,
.professional-grid article h3 a {
    color: #222 !important;
    text-decoration: none !important;
}
.professional-grid article .entry-title a:hover {
    color: var(--primary-green) !important;
}

/* Ukuran Ringkasan Berita */
.professional-grid article .entry-summary,
.professional-grid article .entry-content,
.professional-grid article p {
    font-size: 12.5px !important; 
    line-height: 1.5 !important;
    color: #555 !important;
    margin-bottom: 8px !important;
}

/* Ukuran Meta Data */
.professional-grid article .entry-meta,
.professional-grid article .post-meta,
.professional-grid article span,
.professional-grid article small {
    font-size: 10.5px !important; 
    color: #888 !important;
}

/* Iklan & Sosial Sidebar */
.full-width-ad { grid-column: 1 / -1; max-width: 100%; }
.ad-label { font-size: 9px; color: #aaa; display: block; margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; font-weight: bold; }
.ads-top-wrapper { margin-bottom: 20px; text-align: center; max-width: 100%; overflow: hidden; }
.ad-img-top { max-width: 100%; width: auto; height: auto; border-radius: 4px; box-shadow: var(--shadow-sm); }
.in-feed-ad { background: #fff; border: 1px solid #eee; margin-top: 5px; padding: 15px; text-align: center; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); max-width: 100%; }
.sidebar-ad-box { margin-bottom: 20px; background: #fff; padding: 12px; border-radius: 8px; border: 1px solid #eee; box-shadow: 0 2px 10px rgba(0,0,0,0.02); max-width: 100%; }
.sidebar-social-wrapper { margin-bottom: 20px; max-width: 100%; }
.ad-img-sidebar { max-width: 100%; height: auto; border-radius: 6px; }

/* Placeholder Boks Iklan Kosong */
.ad-placeholder-top { background: #f9f9f9; border: 1px dashed #ddd; padding: 15px; font-size: 11px; color: #999; border-radius: 4px; }
.ad-placeholder-feed { background: #f9f9f9; border: 1px dashed #ddd; padding: 15px; font-size: 11px; color: #999; border-radius: 4px; }
.ad-placeholder-sidebar { background: #f9f9f9; border: 1px dashed #ddd; padding: 15px; font-size: 11px; color: #999; border-radius: 4px; }

/* Manajemen Sticky Sidebar Tunggal */
.sidebar-sticky-container { position: sticky; top: 80px; }

/* Kustomisasi Navigasi Paginasi */
.pagination-wrapper { margin: 30px 0; border-top: 1px solid #eee; padding-top: 20px; text-align: center; }
.pagination-wrapper .nav-links { display: inline-flex; gap: 6px; font-size: 12px; list-style: none; padding: 0; justify-content: center; }
.pagination-wrapper .page-numbers { padding: 5px 10px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #333; background: #fff; }
.pagination-wrapper .page-numbers.current { background: var(--primary-green); color: #fff; border-color: var(--primary-green); font-weight: bold; }

@media (max-width: 1024px) { 
    .main-content-wrapper { grid-template-columns: 1fr; gap: 0; max-width: 100%; } 
    .sidebar-wrapper { margin-top: 35px; width: 100%; max-width: 100%; }
    .sidebar-sticky-container { position: relative !important; top: 0 !important; }
}

@media (max-width: 768px) {
    .main-content-wrapper, .site-main, .professional-grid {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .professional-grid article {
        width: 100% !important;
        margin-bottom: 20px;
    }
    .professional-grid > article:first-of-type img {
        max-height: 220px;
    }
    .professional-grid > article:first-of-type .entry-title,
    .professional-grid > article:first-of-type h2 {
        font-size: 16px !important;
    }
}