/* ============================================
   CATEGORY GRID (Style sama dengan Pilihan Redaksi)
   ============================================ */
.category-grid-wrapper {
    background: #ffffff;
    margin-top: 24px;
}

.category-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.category-grid-title {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.category-grid-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #e60012;
    border-radius: 2px;
}

/* ============================================
   LINK "LIHAT SEMUA" DI HEADER (Asli Dipertahankan)
   ============================================ */
.category-grid-see-all {
    display: none; /* Hidden di mobile secara default */
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #464747;
    text-decoration: none;
    line-height: 1;
    transition: color 0.2s ease;
}

.category-grid-see-all:hover {
    color: #1557b0;
}

.category-grid-see-all .category-grid-arrow {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.2s ease;
}

.category-grid-see-all:hover .category-grid-arrow {
    transform: translateX(4px);
}

/* ============================================
   LAYOUT GRID & ITEM
   ============================================ */
.category-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
}

.category-grid-item {
    cursor: pointer;
}

.category-grid-image {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.category-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-grid-content {
    /* Tanpa padding */
}

/* ============================================
   LINK JUDUL POSTINGAN (Tetap tampil di mobile & desktop)
   ============================================ */
.category-grid-link {
    font-size: 13px;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: -0.2px;
}

.category-grid-link:hover {
    color: #e55225; /* WARNA ASLI DIPERTAHANKAN */
}

.category-grid-category {
    font-size: 11px;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
}

/* ============================================
   CATEGORY GRID - MOBILE MORE BUTTON (BARU)
   ============================================ */
.category-grid-mobile-more {
    display: flex; /* Tampil di mobile */
    justify-content: center;
    padding-top: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.category-grid-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    margin-bottom: 20px;
    background: #f8f8f8;
    color: #e55225; /* WARNA ASLI DIPERTAHANKAN */
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.category-grid-more-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.category-grid-more-arrow {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.category-grid-more-btn:hover .category-grid-more-arrow {
    transform: translateX(4px);
}

/* ============================================
   DESKTOP VERSION (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {
    body { max-width: 100%; }

    .category-grid-wrapper {
        max-width: 1024px;
        margin: 24px auto;
    }

    .category-grid-header {
        margin-bottom: 20px;
    }

    .category-grid-title {
        font-size: 20px;
    }

    .category-grid-title::before {
        display: none;
    }

    /* Desktop: Tampilkan link "Lihat semua" */
    .category-grid-see-all {
        display: inline-flex;
    }

    .category-grid-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .category-grid-image {
        height: 120px;
        border-radius: 6px;
        margin-bottom: 12px;
    }

    .category-grid-link {
        font-size: 13px;
        font-family: 'Manrope', sans-serif;
        line-height: 1.4;
        margin-bottom: 6px;
        -webkit-line-clamp: 3;
    }

    .category-grid-category {
        font-size: 12px;
        color: #e55225; /* WARNA ASLI DIPERTAHANKAN */
        font-weight: 700;
        text-transform: capitalize;
        margin-bottom: 4px;
    }

    /* Desktop: Sembunyikan tombol mobile more */
    .category-grid-mobile-more {
        display: none !important;
    }
}

/* ============================================
   MOBILE VERSION (max-width: 1023px)
   ============================================ */
@media (max-width: 1023px) {
    /* Mobile: Pastikan link "Lihat semua" di header tetap tersembunyi */
    .category-grid-see-all {
        display: none !important;
    }

    /* Mobile: Pastikan post ke-4 tampil */
    .category-grid .category-grid-item:nth-child(4) {
        display: block;
    }
}

/* ==========================================================================
   CATEGORY GRID VIDEO - RESPONSIVE LAYOUT
   ========================================================================== */

.category-grid-container {
    display: grid;
    /* Desktop: 3 Kolom */
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Desktop: Sembunyikan post ke-4 dan seterusnya */
.category-grid-container .category-grid-item:nth-child(n+4) {
    display: none;
}

/* ==========================================================================
   MOBILE ADJUSTMENTS (Layar ≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .category-grid-container {
        /* Mobile: 2 Kolom (sehingga 4 post akan membentuk grid 2x2) */
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Mobile: Tampilkan kembali post ke-4 yang tadi disembunyikan */
    .category-grid-container .category-grid-item:nth-child(n+4) {
        display: block;
    }
    
    /* Opsional: Sesuaikan ukuran font/spacing di mobile agar muat 4 post */
    .category-grid-title {
        font-size: 18px;
    }
    
    .category-grid-category {
        font-size: 11px;
    }
    
    .category-grid-link {
        font-size: 14px;
        line-height: 1.4;
        /* Batasi judul 2 baris di mobile */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}