@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Styles */
body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background-color: #f9f9f9;
}

h1,
h2,
h3,
h4 {
    margin: 0;
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.news-grid {
    flex: 3;
    /* Chiếm khoảng 75% chiều rộng */
}

.sidebar {
    flex: 1;
    /* Chiếm khoảng 25% chiều rộng */
}

/* Main Title */
.main-title {
    font-size: 48px;
    color: #015871;
    text-align: center;
    margin: 40px 0;
    font-weight: bold;
    text-transform: uppercase;
}

.news-section {
    padding: 40px 20px;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    width: 100%;
    text-align: center;
    font-size: 36px;
    margin-bottom: 20px;
    color: #333;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    flex: 3;
    /* Ưu tiên lớn hơn sidebar */
}

.news-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-in-out;
    /* Animation khi load */
}

.news-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-title {
    font-size: 18px;
    margin: 16px;
    color: #333;
}

.news-description {
    font-size: 14px;
    margin: 0 16px 16px;
    color: #666;
}

/* Sidebar Styles */
.sidebar {
    flex: 1;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
    order: -1;
    /* Move sidebar to the left */
}

/* .sidebar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
} */

/* Search Box */
.search-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
}

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

.search-button {
    background-color: #6dcaf2;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #0056b3;
}

/* Sidebar Title */
.sidebar-title {
    font-size: 18px;
    color: #015871;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 2px solid #73c1f8;
    display: inline-block;
}

/* Categories List */
.categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    margin-bottom: 15px;
}

.categories a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.categories a:hover {
    background-color: #f1f1f1;
    color: #007bff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.pagination a {
    color: #015871;
    font-size: 14px;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.pagination a:hover {
    background: #015871;
    color: #ffffff;
    transform: scale(1.1);
}

.pagination a.active {
    background: #015871;
    color: #ffffff;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .news-image {
        height: 150px;
    }

    .news-title {
        font-size: 16px;
    }

    .news-description {
        font-size: 13px;
    }

    .main-title {
        font-size: 36px;
    }
}

/* Thẻ tin tức (News Card) với hiệu ứng Hover */
.news-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-in-out;
    /* Animation khi load */
}

.news-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Keyframes Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tùy chỉnh thêm cho hình ảnh */
.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.1);
    /* Zoom ảnh nhẹ khi hover */
}

.news-card:nth-child(1) {
    animation-delay: 0.1s;
}

.news-card:nth-child(2) {
    animation-delay: 0.2s;
}

.news-card:nth-child(3) {
    animation-delay: 0.3s;
}

.news-card:nth-child(4) {
    animation-delay: 0.4s;
}