/* Category News Grid - Modern UI & Perfect Alignment - Version 1.5.0 */

/* --- GRID CONTAINER --- */
.cng-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
    font-family: 'Roboto', sans-serif; /* Font body dễ đọc */
    box-sizing: border-box;
}

.cng-grid-container * {
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .cng-grid-container.cng-grid-columns-2 {
        grid-template-columns: repeat(2, 1fr);
        align-items: stretch; 
    }
}

/* --- SECTION BOX --- */
.cng-section {
    background: #fff;
    padding: 25px 20px; /* Tăng padding trên dưới cho thoáng */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06); /* Bóng nhẹ tinh tế hơn */
    height: 100%; 
    display: flex;
    flex-direction: column;
    /* Viền trên cùng (Accent Border) */
    border-top: 4px solid #ddd; 
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cng-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

/* --- SECTION TITLE (TIÊU ĐỀ MỤC - UPDATE MỚI) --- */
.cng-section-title {
    /* Font Oswald hoặc Roboto Bold cho tiêu đề mạnh mẽ */
    font-family: 'Oswald', 'Roboto', sans-serif; 
    font-weight: 700;
    margin: 0 0 25px 0;
    padding-bottom: 0;
    
    /* Bỏ gạch chân cũ, dùng style hiện đại */
    border-bottom: none; 
    text-transform: uppercase;
    position: relative;
    line-height: 1.2;
    font-size: 22px; /* Kích thước lớn */
    letter-spacing: 0.5px; /* Giãn chữ nhẹ cho thoáng */
    
    display: flex;
    align-items: center; /* Căn giữa icon và chữ theo chiều dọc */
}

/* ICON CỘT DỌC HIỆN ĐẠI (Vertical Bar) */
.cng-section-title::before {
    content: '';
    display: inline-block;
    width: 6px; /* Độ dày của thanh */
    height: 24px; /* Chiều cao thanh (bằng hoặc cao hơn chữ chút) */
    background-color: currentColor; /* Lấy màu theo text */
    margin-right: 12px; /* Khoảng cách với chữ */
    border-radius: 3px; /* Bo tròn đầu thanh */
    flex-shrink: 0;
}


/* --- FEATURED POST --- */
.cng-featured-post {
    margin-bottom: 25px;
}

.cng-featured-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 15px;
    background-color: #f0f0f0;
}

.cng-featured-image-link img,
.cng-featured-image-link .cng-placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.cng-featured-image-link:hover img {
    transform: scale(1.05);
}

.cng-featured-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
    font-size: 19px;
}

.cng-featured-title a {
    text-decoration: none;
    transition: color 0.3s ease;
}


/* --- LIST POSTS --- */
.cng-list-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    margin-top: auto; 
}

/* --- LIST ITEM & ALIGNMENT FIX (CÂN CHỈNH ẢNH - CHỮ) --- */
.cng-list-item {
    display: flex;
    flex-direction: row; 
    
    /* [QUAN TRỌNG] Căn đỉnh trên cùng */
    align-items: flex-start; 
    
    gap: 12px;
}

.cng-list-item-image-link {
    display: block;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f5f5f5;
    
    /* Fix shadow nhẹ cho ảnh để nổi khối */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Layout Ảnh Vừa */
.cng-list-layout-image_left .cng-list-item-image-link {
    width: 80px;  
    height: 80px; /* Vuông */
}

/* Layout Ảnh Nhỏ */
.cng-list-layout-image_left_small .cng-list-item-image-link {
    width: 65px;
    height: 65px;
}

.cng-list-item-image-link img,
.cng-list-item-image-link .cng-placeholder-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.cng-list-item:hover .cng-list-item-image-link img {
    transform: scale(1.1);
}
.cng-list-layout-text_only .cng-list-item-image-link { display: none; }


/* --- NỘI DUNG BÀI PHỤ --- */
.cng-list-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* Đảm bảo không có padding thừa làm lệch dòng */
    padding: 0; 
}

.cng-list-item-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    margin: 0; /* Reset margin */
    
    /* [KỸ THUẬT CÂN BẰNG] */
    line-height: 1.3; /* Khoảng cách dòng vừa phải */
    
    /* Kéo text lên một chút để bù trừ khoảng trắng mặc định của font chữ */
    /* Giúp đỉnh chữ cái in hoa ngang bằng với mép trên của ảnh */
    margin-top: -3px; 
    
    font-size: 14px;
    display: block; 
}

.cng-list-item-title a {
    text-decoration: none;
    transition: color 0.2s;
}

/* --- NGÀY THÁNG --- */
.cng-post-meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px; /* Cách tiêu đề một chút */
    display: flex;
    align-items: center;
    font-weight: 400;
}

.cng-post-date {
    display: inline-flex;
    align-items: center;
}

.cng-post-date::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #aaa;
    border-radius: 50%;
    margin-right: 5px;
    background: 
        linear-gradient(to bottom, #aaa 50%, transparent 50%) no-repeat center 2px/1px 4px,
        linear-gradient(to right, #aaa 50%, transparent 50%) no-repeat 4px center/4px 1px;
}


/* --- RESPONSIVE MOBILE --- */
@media (max-width: 480px) {
    .cng-section {
        padding: 15px; /* Giảm padding */
        height: auto; 
    }
    
    /* Title trên mobile nhỏ lại chút */
    .cng-section-title {
        font-size: 18px !important;
        margin-bottom: 15px;
    }
    .cng-section-title::before {
        height: 20px;
        width: 5px;
    }

    .cng-list-posts {
        grid-template-columns: 1fr; /* 1 cột */
        gap: 15px;
    }
    
    .cng-list-layout-image_left .cng-list-item-image-link {
        width: 90px;
        height: 65px; /* Chữ nhật ngang nhẹ trên mobile cho dễ nhìn */
    }
    
    .cng-featured-title { font-size: 17px !important; }
    .cng-list-item-title { font-size: 14px !important; margin-top: -2px; }
}