/* ==========================================================================
   HEADER GRACAK.COM - VERSI FINAL BERSIH (STICKY & SEARCH ICON)
   ========================================================================== */

/* 1. Pengaturan Global & Reset */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    /* Sticky butuh overflow visible agar bisa mengunci posisi */
    overflow-x: visible !important; 
}

/* 2. Struktur Header Sticky */
#sticky-header {
    position: -webkit-sticky !important; /* Safari */
    position: sticky !important;
    top: 0 !important;
    z-index: 99999 !important;
    background: #ffffff !important;
    width: 100% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

/* 3. Top Bar (Teks Paling Atas) */
.top-bar {
    border-bottom: 1px solid #eee;
    background: #fff;
}

.top-bar-content {
    font-size: 11px;
    padding: 5px 0;
    color: #666;
}

/* 4. Area Logo & Search (Flexbox Sejajar) */
.header-flex {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 0;
}

.logo img { 
    height: 40px !important; 
    width: auto; 
    display: block;
}

/* 5. Pencarian (Hanya Ikon Sesuai Request) */
.search-wrapper .search-input {
    display: none !important; /* Benar-benar disembunyikan */
}

.search-icon-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    color: #333;
    transition: color 0.3s;
}

.search-icon-btn:hover {
    color: #d00;
}

/* 6. Navigasi Abu-abu (Klasik) */
.main-nav {
    background-color: #cccccc !important;
    border-top: 2px solid #333 !important;
    border-bottom: 2px solid #333 !important;
    width: 100%;
}

.main-nav .container {
    padding: 0 !important;
}

.main-nav ul {
    list-style: none !important;
    display: flex !important;
    margin: 0;
    padding: 0;
    overflow-x: auto !important; /* Scroll horizontal di HP */
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
}

.main-nav ul::-webkit-scrollbar {
    display: none;
}

.main-nav ul li a {
    display: block;
    padding: 12px 18px;
    color: #000000 !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 14px;
    text-transform: uppercase;
    transition: background 0.3s;
}

.main-nav ul li a:hover,
.main-nav ul li.active a {
    background-color: #999999 !important;
}

/* 7. Judul Kategori (Garis Merah Samping) */
.section-title {
    border-left: 4px solid #d00;
    padding-left: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
    border-top: none !important; 
    font-weight: bold;
}

/* 8. Optimasi Tampilan HP (Mobile) */
@media (max-width: 768px) {
    .logo img { 
        height: 28px !important; 
    }

    .header-flex {
        padding: 5px 0 !important;
    }

    /* Tipiskan garis navigasi agar tidak terlalu lebar di layar kecil */
    .main-nav {
        border-top: 1px solid #444 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    .main-nav ul li a {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    .search-icon-btn svg {
        width: 18px;
        height: 18px;
    }
}
/* ==========================================================================
   2.Footer
   ========================================================================== */

/* Container Utama Footer */
footer {
    background-color: #f8f8f8; /* Abu-abu sangat muda agar bersih */
    width: 100%;               /* Memastikan footer memenuhi lebar layar */
    margin: 0;
    padding: 40px 0 20px 0;    /* Atas 40px, bawah 20px */
    font-family: Arial, sans-serif;
    border-top: 4px solid #cc0000;
}

/* Wrapper Konten - Inilah kunci agar teks memenuhi sisi samping */
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 5%;            /* Memberi jarak aman 5% di kiri dan kanan */
    gap: 40px;
    flex-wrap: wrap;          /* Agar responsif di HP */
}

/* Pengaturan Kolom */
.footer-column {
    flex: 1;                  /* Membagi lebar kolom secara rata */
    min-width: 250px;
}

/* Kolom Tentang (Lebih lebar sedikit) */
.footer-column.about {
    flex: 2;
}

.footer-column h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid #cc0000;
    display: inline-block;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    text-decoration: none;
    color: #444;
    transition: 0.3s;
}

.footer-column ul li a:hover {
    color: #cc0000;
}

/* Bagian Media Sosial */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons img {
    width: 30px;
    height: 30px;
}

/* Garis Pembatas Bawah */
.footer-divider {
    border-top: 1px solid #ddd;
    margin: 30px 5% 20px 5%; /* Menyelaraskan dengan padding konten */
}

/* Navigasi Bawah & Copyright */
.footer-bottom {
    text-align: center;
    padding: 0 5%;
}

.bottom-links {
    font-weight: bold;
    margin-bottom: 10px;
}

.bottom-links a {
    text-decoration: none;
    color: #000;
    margin: 0 10px;
}

.copyright {
    font-size: 12px;
    color: #888;
}

/* Pastikan ini ada di file CSS utama Anda */
.footer-container {
    display: flex;
    justify-content: space-between;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column {
    flex: 1;
    margin: 0 15px;
}

.footer-divider {
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

.footer-bottom {
    text-align: center;
    padding-bottom: 20px;
}
/* ==========================================================================
   3. Tampilan Home
   ========================================================================== */
/* 1. RESET & BASIC STYLES */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.6; background-color: #f9f9f9; color: #333; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; overflow-x: hidden; }

/* 2. TOP ROW (Headline & Trending) */
.top-row { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; margin-top: 20px; }
.headline-container { position: relative; width: 100%; height: 400px; overflow: hidden; background: #333; }
.slider-wrapper { display: flex; width: 100%; height: 100%; transition: 0.5s; }
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; bottom: 0; width: 100%; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: #fff; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); cursor: pointer; background: rgba(0,0,0,0.5); border: none; padding: 10px; color: white; z-index: 10; }
.prev { left: 10px; } .next { right: 10px; }

.trending-box { border: 1px solid #ddd; padding: 15px; background: #fff; }
.section-title {
    font-weight: bold;
    margin-bottom: 20px;
    border-left: 4px solid red;
    padding-left: 10px;
    color: #ff0000;
    font-size: 18px;
    text-transform: none;
}
.trending-list { list-style: none; }
.trending-list li { margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #eee; font-size: 14px; }
.trending-list li a { text-decoration: none; color: #000; font-weight: 500; }

/* 3. ARTIKEL TERBARU */
.latest-section { margin-top: 30px; background: #fff; padding: 20px; border: 1px solid #ddd; }
.latest-list { display: grid; gap: 15px; }
.latest-item { display: flex; align-items: flex-start; border-bottom: 1px solid #eee; padding-bottom: 15px; gap: 15px; }
.latest-text { flex: 2; }
.latest-text a { text-decoration: none; color: #000; font-weight: bold; font-size: 16px; display: block; margin-bottom: 5px; }
.latest-thumb { flex: 1; max-width: 150px; min-width: 100px; }
.latest-thumb img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; }

/* 4. REKOMENDASI */
.recom-section { margin-top: 30px; padding: 20px; border: 1px solid #ddd; background: #fff; }
.recom-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.recom-item a { text-decoration: none; color: #000; font-size: 13px; font-weight: bold; display: block; margin-top: 8px; }
.recom-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; }

/* 5. VIDEO */
.video-section { margin-top: 40px; padding: 20px; background: #333; color: #fff; }
.video-container { position: relative; }
.v-wrapper { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: thin; }
.v-card { min-width: 220px; }
.v-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 4px; }
.v-card p { font-size: 12px; margin-top: 8px; font-weight: bold; }

.cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.more-link { color: #ffffff; text-decoration: none; font-weight: bold; font-size: 14px; transition: 0.3s; }
.more-link:hover { color: #ff0000; }

/* 6. KATEGORI NASIONAL */
.category-block { max-width: 1200px; margin: 30px auto; padding: 0 15px; }
    
    .section-title { 
        font-weight: bold; 
        font-size: 22px; 
        border-left: 5px solid red; 
        padding-left: 10px; 
        text-transform: uppercase; 
    }

    /* Layout Utama: Kiri (Headline) & Kanan (Grid) */
    .cat-layout { 
        display: flex; 
        gap: 25px; 
    }

    /* Headline (Bagian Kiri) */
    .cat-headline { flex: 1.5; }
    .cat-headline img { width: 100%; height: 350px; object-fit: cover; border-radius: 4px; }
    .cat-headline h3 { font-size: 24px; margin: 15px 0 10px; line-height: 1.3; }
    .cat-headline p { color: #555; line-height: 1.6; font-size: 15px; }

    /* Grid List (Bagian Kanan 2x2) */
    .cat-sub-list { 
        flex: 1; 
        display: grid; 
        grid-template-columns: repeat(2, 1fr); /* Membuat 2 Kolom */
        gap: 20px; 
        align-content: start;
    }

    .sub-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; }
    .sub-item h4 { font-size: 14px; margin: 8px 0 5px; line-height: 1.3; color: #000; }
    .sub-item p { font-size: 12px; color: #777; line-height: 1.4; }
    
    .cat-headline a, .sub-item a { text-decoration: none; color: inherit; }
    .cat-headline a:hover h3, .sub-item a:hover h4 { color: red; }

    .meta-info { font-size: 12px; color: #999; margin-top: 10px; }

    /* Responsif Mobile */
    @media (max-width: 768px) {
        .cat-layout { flex-direction: column; }
        .cat-sub-list { grid-template-columns: repeat(1, 1fr); }
        .cat-headline img { height: 220px; }
    }
/* 7. PAGINATION */
.pagination-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.pagination-container a { padding: 8px 16px; border: 1px solid #ddd; text-decoration: none; color: #333; border-radius: 4px; background: #fff; }
.pagination-container a.active { background: #ff0000; color: #fff; border-color: #ff0000; }

/* --- RESPONSIVE FIX (UNTUK HP) --- */
@media (max-width: 992px) { 
    .recom-grid { grid-template-columns: repeat(2, 1fr); } 
    .cat-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    /* Mengecilkan area caption agar tidak terlalu tinggi */
    .slide-caption {
        padding: 15px 20px !important;
        background: linear-gradient(transparent, rgba(0,0,0,0.9)) !important;
    }

    /* Mengecilkan ukuran tulisan judul headline */
    .slide-caption h2 {
        font-size: 14px !important; /* Ukuran tulisan lebih kecil */
        line-height: 1.3 !important;
        margin: 0 !important;
        font-weight: bold !important;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Membatasi maksimal 2 baris agar rapi */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Penyesuaian tinggi slider di HP agar seimbang */
    .headline-container {
        height: 220px !important; 
    }
}
@media (max-width: 768px) {
    /* Membuat container utama menjadi satu aliran vertikal */
    .main-content {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Mengatur urutan tampilan */
    .top-row { 
        display: flex !important;
        flex-direction: column !important;
        order: 1; /* Headline tetap paling atas */
    }

    .latest-section { 
        order: 2; /* Artikel Terbaru muncul kedua */
    }

    .trending-box { 
        order: 3; /* Berita Trending pindah ke bawah Artikel Terbaru */
        width: 100% !important;
        margin-top: 20px !important;
    }
    
    .recom-section { order: 4; }
    .video-section { order: 5; }
    .category-block { order: 6; }
}
@media (max-width: 768px) {
    /* 1. Kategori Nasional: Headline tetap di atas penuh */
    .cat-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* 2. Sub-list (4 Berita): 2 di samping, 2 di bawah */
    .cat-sub-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* Membuat 2 kolom */
        gap: 10px !important;
    }

    /* 3. Atur tampilan item berita kecil di HP */
    .sub-item {
        display: flex !important;
        flex-direction: column !important; /* Gambar di atas teks untuk tiap kotak kecil */
        background: #fff;
        padding: 5px;
        border: 1px solid #eee;
    }

    .sub-item img {
        height: 100px !important; /* Sesuaikan tinggi gambar agar seragam */
        width: 100% !important;
        object-fit: cover !important;
    }

    .sub-content h4 {
        font-size: 12px !important;
        margin-top: 5px !important;
        line-height: 1.3 !important;
    }

    /* Hilangkan ringkasan berita di HP agar tidak terlalu penuh */
    .sub-content p {
        display: none !important; 
    }
}
@media (max-width: 768px) {
    /* Membuat grid menjadi 2 kolom saja di HP */
    .recom-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        gap: 15px !important;
        padding: 0 5px !important;
    }

    .recom-item {
        display: flex !important;
        flex-direction: column !important;
        margin-bottom: 10px !important;
    }

    /* Mengatur gambar agar seragam dan tidak gepeng */
    .recom-item img {
        width: 100% !important;
        height: 110px !important; /* Tinggi gambar yang ideal untuk 2 kolom */
        object-fit: cover !important;
        border-radius: 8px !important; /* Membuat sudut sedikit bulat agar modern */
    }

    /* Mengatur tulisan judul di bawah gambar */
    .recom-item a {
        font-size: 13px !important;
        line-height: 1.4 !important;
        margin-top: 8px !important;
        font-weight: 600 !important;
        color: #333 !important;
        /* Membatasi teks maksimal 3 baris agar rapi */
        display: -webkit-box !important;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Menetralkan semua judul agar mengikuti ketikan di database */
h2, h3, h4, 
.latest-text a, 
.trending-list li a, 
.recom-item a, 
.v-card p,
.slide-caption h2 {
    text-transform: none !important; /* Menghapus paksaan kapital */
}

/* Jika ingin otomatis huruf besar di awal kata saja (contoh: Judul Berita) */
/* Ganti 'none' di atas menjadi 'capitalize' */