.listnews {
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.listnews ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Khoảng cách giữa các bài viết */
}

.listnews li {
    flex: 1 1 calc(25% - 20px); /* 4 bài trên 1 hàng, trừ khoảng cách */
    box-sizing: border-box;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listnews li:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.listnews a {
    text-decoration: none;
    color: #333;
    display: block;
    height: 100%;
}

.listnews img {
    max-width: 100%;
    height: 124px;
    object-fit: cover;
    display: block;
}

.listnews .title {
    font-size: 16px;
    font-weight: bold;
    margin: 10px;
    line-height: 1.4;
    max-height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.listnews small {
    display: block;
    font-size: 12px;
    color: #777;
    margin: 0 10px 10px;
}


.listnews p {
    text-align: center;
    color: #555;
    font-size: 16px;
    padding: 20px;
}


.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a[style*="font-weight:bold"] {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

@media (max-width: 800px) {
    .listnews li {
        flex: 1 1 calc(50% - 20px); 
    }
}

@media (max-width: 480px) {
    .listnews li {
        flex: 1 1 100%;
    }
}