:root {
    --dmi-green: #008000;
    --dark: #1a1a1a;
    --gray: #666;
    --white: #ffffff;
}

/* Tambahkan ini di bagian atas/global CSS Anda untuk keamanan */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* Mencegah scroll ke samping sama sekali */
}

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    margin: 0; padding: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }

/* FIX UTAMA: min-width: 0 mencegah slider merusak grid */
.main-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px; 
    gap: 40px;
    align-items: start;
}

/* Slider Style */
.headline-slider {
    width: 100%;
    height: 480px;
    border-radius: 16px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden; /* Mencegah slide menyamping terlihat */
}

.slide-card {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.slide-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.slide-card:hover img { transform: scale(1.05); }

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, transparent 70%);
    display: block;
}
.slide-overlay-inner{
   position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px; /* Jarak aman dari tepi slider */
    text-align: left;
}

.tag-slider {
   display: inline-block;
    background: var(--dmi-green);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 4px;
    margin-bottom: 12px; /* Jarak tetap ke judul di bawahnya */
    text-transform: uppercase;
}

.slide-overlay h2 {
    color: white;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0; /* Hapus margin default agar tidak merusak posisi anchor */
    /* Batasi agar judul yang sangat panjang tidak menutupi seluruh gambar */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.slide-overlay:hover h2 { color: #30ac30; opacity: 0.8; }
.slide-overlay-inner:hover {  transform: translateY(-5px); transition: 0.3s ease-in-out;}

/* Grid Berita */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.news-card { text-decoration: none; color: inherit; }
.news-img { 
    width: 100%; 
    aspect-ratio: 16/10; 
    border-radius: 12px; 
    overflow: hidden; 
    margin-bottom: 12px; 
}
.news-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.4s; }
.news-card:hover img { transform: scale(1.1); }
.news-card:hover h3 { color: var(--dmi-green); }

.category { color: var(--dmi-green); font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; display: block; }
.news-info h3 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.4; transition: 0.3s; }

/* Sidebar */
.sidebar { border-top: 4px solid var(--dmi-green); }
.sidebar-header h2 { font-size: 20px; font-weight: 800; margin: 20px 0; }
.trending-item { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid #eee; text-decoration: none; color: #000;}
/* Sidebar Ranking - Terlihat sebelum hover */
/* Sidebar Ranking - Sangat Jelas Saat Statis */
.rank {
    font-size: 32px;
    font-weight: 900;
    color: #000; /* Gunakan Hijau DMI langsung */
    opacity: 0.7; /* Beri sedikit transparansi agar tidak terlalu 'menusuk' mata */
    line-height: 1;
    transition: all 0.3s ease;
    min-width: 45px; /* Memberikan jarak yang pasti antara angka dan teks */
    display: flex;
    justify-content: center;
}

/* Saat Item di-Hover, Angka Menjadi Full Solid & Menonjol */
.trending-item:hover .rank {
    opacity: 1; /* Menjadi sangat jelas */
    color: var(--dmi-green);
    transform: scale(1.2); /* Sedikit membesar agar interaktif */
}


.trend-content h4 { font-size: 14px; font-weight: 700; margin: 0 0 5px 0; transition: 0.2s; }
.trending-item:hover h4 { color: var(--dmi-green); }

.btn-more {
    display: flex; align-items: center; gap: 8px; margin-top: 25px;
    color: var(--dmi-green); font-weight: 800; font-size: 13px; text-decoration: none;
}
.btn-more:hover { transform: translateX(5px); }

/* ============================================================
   RESPONSIVE STRATEGY (MEDIA QUERIES)
   ============================================================ */

/* 1. Tablet & Desktop Kecil (Layar < 1024px) */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr; /* Kolom sidebar pindah ke bawah */
        display: block; /* Mengamankan layout agar tidak meluber */
    }

    .sidebar {
        margin-top: 50px; /* Jarak antara berita utama dan sidebar di bawahnya */
        border-top: 4px solid var(--dmi-green);
        padding-top: 20px;
    }
}

/* 2. Mobile (Layar < 768px) - 2 KOLOM AKTIF */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px; /* Mengurangi padding luar agar konten lebih luas */
    }

    /* Slider Adjustment */
    .headline-slider {
        height: 300px; /* Memperpendek tinggi slider agar pas di layar HP */
        margin-bottom: 25px;
    }

    .slide-overlay {
        padding: 20px;
    }

    .slide-overlay-inner {
        padding: 20px;
    }
    .tag-slider {
        font-size: 10px;
        font-weight: 700;
    }

    .slide-overlay h2 {
        font-size: 20px; /* Ukuran teks headline slider di HP */
        font-weight: 700;
        line-height: 1.2;
    }

    /* News Grid 2 Kolom */
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* Memaksa 2 kolom */
        gap: 15px; /* Jarak antar berita di HP */
    }

    .news-card {
        padding: 5px 7px;
    }

    .news-img {
        border-radius: 8px; /* Sudut gambar lebih halus di layar kecil */
    }

    /* Tipografi News Info */
    .news-info h3 {
        /* Ukuran font 18px agar proporsional di 2 kolom mobile */
        font-size: 18px; 
        line-height: 1.3;
        
        /* Memastikan teks terpotong rapi maksimal 3 baris */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .category {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .rank {
        font-size: 28px; /* Mengecilkan angka ranking populer */
    }
}

/* 3. Layar Sangat Kecil (Layar < 480px) */
@media (max-width: 480px) {
    .news-grid {
        gap: 10px; /* Jarak lebih rapat untuk HP layar kecil */
    }

    .news-info h3 {
        font-size: 15px; /* Sedikit dikecilkan agar judul tidak terlalu panjang */
    }

    .headline-slider {
        height: 240px;
    }

    .tag-slider {
        font-size: 10px;
        padding: 2px 8px;
    }
}
/* =========================================================== */
/*                          SECTION BARU                  */

/* ==========================================================================
   WARTA NEWS SECTION - MODERN BENTO & INTERACTIVE
   ========================================================================== */

:root {
    --dmi-green: #215a28;
    --dmi-light: #f0fdf4;
    --glass-white: rgba(255, 255, 255, 0.15);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.latest-news-section {
    padding: 80px 0;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
}

.container-fluid-custom {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- 1. HEADER & SEARCH --- */
.warta-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    gap: 20px;
}

.badge-accent {
    display: inline-block;
    padding: 6px 14px;
    background: var(--dmi-light);
    color: var(--dmi-green);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-main-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(135deg, var(--dmi-green), #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- 2. CARDS --- */
.news-card-refined {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #1e293b;
}

.card-anchor-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.card-thumb {
    width: 100%;
    height: 100%;
    position: relative;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

/* Efek Gelap Gradasi (Glass Overlay) */
.card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.3) 50%, transparent 100%);
    color: #fff;
    z-index: 2;
}

.category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--glass-white);
    backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.date-meta {
    font-size: 0.75rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.title-refined {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    transition: 0.3s;
}

.btn-read-more-minimal {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

/* HOVER EFFECTS */
.news-card-refined:hover .card-thumb img {
    transform: scale(1.08);
}

.news-card-refined:hover .btn-read-more-minimal {
    opacity: 1;
    transform: translateY(0);
}

.news-card-refined:hover .title-refined {
    color: #4ade80;
}

/* --- 3. CAROUSEL BERITA TERKINI --- */
.terkini-carousel {
    margin-bottom: 60px;
    padding-bottom: 40px;
}

.terkini-carousel .swiper-slide {
    height: auto;
}

.terkini-carousel .news-card-refined {
    height: 360px;
    border-radius: 20px;
}

.terkini-carousel .title-refined {
    font-size: 0.85rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.terkini-carousel .btn-read-more-minimal {
    opacity: 1;
    transform: none;
    font-size: 0.7rem;
}

.terkini-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.terkini-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    opacity: 1;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.terkini-pagination .swiper-pagination-bullet-active {
    background: var(--dmi-green);
    width: 24px;
}

.terkini-carousel .swiper-button-next,
.terkini-carousel .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--dmi-green);
    transition: all 0.3s ease;
}

.terkini-carousel .swiper-button-next:hover,
.terkini-carousel .swiper-button-prev:hover {
    background: var(--dmi-green);
    color: #fff;
    box-shadow: 0 6px 16px rgba(33,90,40,0.3);
}

.terkini-carousel .swiper-button-next::after,
.terkini-carousel .swiper-button-prev::after {
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- ARCHIVE LIST --- */
.section-divider {
    border: 0;
    height: 1.5px;
    background: #f1f5f9;
    margin: 60px 0;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.archive-title { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
.view-all-link {
    font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
    text-decoration: none; transition: 0.3s;
}
.view-all-link:hover { color: var(--dmi-green); }

.list-wrapper-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-item-link { text-decoration: none; }
.archive-item-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #f1f5f9;
    gap: 18px;
    box-shadow: 0 10px 10px #00000014;
    transition: var(--transition);
}

.item-thumb-mini {
    width: 65px; height: 65px; flex-shrink: 0;
    border-radius: 12px; overflow: hidden;
}
.item-thumb-mini img { width: 100%; height: 100%; object-fit: cover; }

.item-meta-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.item-category { font-size: 0.65rem; font-weight: 800; color: var(--dmi-green); text-transform: uppercase; }
.item-dot { color: #cbd5e1; }
.item-date { font-size: 0.75rem; color: var(--text-muted); }

.item-title-bold {
    font-size: 1.05rem; font-weight: 700; color: var(--text-main);
    margin: 0 0 6px 0; line-height: 1.3;
}

.item-read-link {
    font-size: 0.75rem; font-weight: 800; color: var(--dmi-green);
    display: inline-flex; align-items: center; gap: 5px;
}

.archive-item-link:hover .archive-item-card {
    box-shadow: 0 10px 10px #0000003a;
    background: #f8fafc;
    transform: translateX(10px);
}
.archive-item-link:active .archive-item-card {
    transform: scale(0.95);
}

/* --- 4. RESPONSIVE --- */
@media (max-width: 768px) {
    .warta-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .section-main-title {
        font-size: 1.5rem;
    }

    .terkini-carousel .news-card-refined {
        height: 280px;
    }

    .terkini-carousel .card-content {
        padding: 14px;
    }

    .terkini-carousel .title-refined {
        font-size: 0.9rem;
    }

    .terkini-carousel .swiper-button-next,
    .terkini-carousel .swiper-button-prev {
        display: none;
    }

    .archive-item-card {
        padding: 10px;
        gap: 10px;
        border-radius: 12px;
    }

    .item-thumb-mini {
        width: 60px;
        height: 60px;
    }

    .item-title-bold {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .item-meta-row {
        font-size: 0.6rem;
    }

    .item-read-link {
        display: none;
    }
}

@media (max-width: 480px) {
    .terkini-carousel .news-card-refined {
        height: 240px;
    }

    .terkini-carousel .card-content {
        padding: 12px;
    }

    .terkini-carousel .title-refined {
        font-size: 0.85rem;
    }
}

/* ============================= */
/*      PAGE SEMUA BERITA         */
/* ============================= */
/* ALL NEWS SECTION */
.all-news-section {
    padding: 10px 0;
    background-color: #fff;
}

/* Header Layout: Sejajar di Desktop */
.news-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    margin-bottom: 25px;
}

.header-left { flex: 1; }

.subtitle {
    display: block;
    color: var(--dmi-green);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.main-title {
    font-size: 42px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.1;
    margin: 0;
}

.main-title span { color: var(--dmi-green); }

.header-left p {
    color: #666;
    margin-top: 12px;
    max-width: 550px;
}

/* Search Box Style */
.header-right { flex-shrink: 0; }

.search-box {
    display: flex;
    background: #f4f7f4;
    padding: 6px;
    border-radius: 50px;
    border: 2px solid transparent;
    transition: 0.3s;
    width: 380px;
}

.search-box:focus-within {
    border-color: var(--dmi-green);
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,128,0,0.08);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 18px;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background: var(--dmi-green);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.divider { border: none; height: 1px; background: #eee; margin: 40px 0; }

/* Grid Berita 3 Kolom */
.all-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Card Styling */
.compact-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: 0.4s;
}

.compact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: var(--dmi-green);
}

.card-link { text-decoration: none; color: inherit; }

.card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.compact-card:hover .card-img img { transform: scale(1.1); }

.card-tag {
    text-transform: uppercase;
    position: absolute;
    background: var(--dmi-green);
    color: white;
    padding: 4px 16px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 4px;
}

.card-body { padding: 25px; }

.meta-info {
    display: flex;
    gap: 15px;
    color: #999;
    font-size: 12px;
    margin-bottom: 12px;
}

.card-body h3 {
    font-size: 22px; /* Ukuran font sesuai request */
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: 0.3s;
}

.compact-card:hover h3 { color: var(--dmi-green); }

.card-body p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-size: 13px;
    font-weight: 800;
    color: var(--dmi-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 80px;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
}

.pagination-wrapper .page-item {
    margin: 0;
}

.pagination-wrapper .page-item .page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #777;
    font-weight: 600;
    font-size: 15px;
    border-radius: 50%;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.pagination-wrapper .page-item .page-link:hover {
    background: #f0f0f0;
    color: var(--dmi-green);
}

.pagination-wrapper .page-item.active .page-link {
    background: var(--dmi-green);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 128, 0, 0.3);
}

.pagination-wrapper .page-item.active .page-link:hover {
    background: var(--dmi-green);
    color: white;
}

.pagination-wrapper .page-item.disabled .page-link {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    color: #aaa;
}

.pagination-wrapper .page-item:first-child .page-link,
.pagination-wrapper .page-item:last-child .page-link {
    width: 45px;
    height: 45px;
    background: #f4f7f4;
    color: var(--dmi-green);
}

.pagination-wrapper .page-item:first-child .page-link:hover,
.pagination-wrapper .page-item:last-child .page-link:hover {
    background: var(--dmi-green);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 128, 0, 0.2);
}

.pagination-wrapper .page-item:first-child.disabled .page-link,
.pagination-wrapper .page-item:last-child.disabled .page-link {
    opacity: 0.3;
    cursor: not-allowed;
    background: #eee;
    color: #aaa;
    transform: none;
    box-shadow: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .all-news-section {
        padding: 20px 0px;
    }
    /* 1. Header tetap center sesuai request sebelumnya */
    .news-page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    /* 2. Grid tetap 1 kolom tapi dengan gaya compact */
    .all-news-grid {
        grid-template-columns: 1fr;
        gap: 15px; /* Jarak antar card dipersempit */
    }

    /* 4. Tipografi yang lebih padat */
    .card-body h3 {
        font-size: 15px; /* Font lebih kecil agar compact */
        margin-bottom: 5px;
        line-height: 1.2;
        -webkit-line-clamp: 2; /* Maksimal 2 baris saja */
    }

    .meta-info {
        font-size: 10px;
        margin-bottom: 5px;
        gap: 10px;
    }

    /* 5. Pagination yang lebih kecil */
    .pagination-wrapper {
        margin-top: 30px;
    }

    .pagination-wrapper .pagination {
        gap: 4px;
        padding: 8px 12px;
    }

    .pagination-wrapper .page-item .page-link {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .pagination-wrapper .page-item:first-child .page-link,
    .pagination-wrapper .page-item:last-child .page-link {
        width: 40px;
        height: 40px;
    }

    /* Sembunyikan beberapa angka di mobile agar tetap 1 baris */
    .pagination-wrapper .page-item:nth-child(3),
    .pagination-wrapper .page-item:nth-last-child(2) {
        display: none;
    }
}   

/* Tambahan untuk layar sangat kecil agar teks tidak terlalu raksasa */
@media (max-width: 480px) {
    .main-title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 11px;
    }

    .search-box {
        width: 100%;
        max-width: 320px;
    }
}