/* ================================================ */
/* News Section Styles
/* ================================================ */

.news-slider-container {
    position: relative;
    margin-top: 40px;
}

.news-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.news-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.news-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 100;
    padding: 15px 20px;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
    backdrop-filter: blur(5px);
}

.news-slider-btn:hover {
    color: #000;
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.news-slider-prev {
    left: 10px;
}

.news-slider-next {
    right: 10px;
}

@media (max-width: 1200px) {
    .news-slider-prev {
        left: 5px;
    }
    .news-slider-next {
        right: 5px;
    }
    .news-slider-btn {
        font-size: 2rem;
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .news-slider-prev {
        left: 0;
    }
    .news-slider-next {
        right: 0;
    }
    .news-slider-btn {
        font-size: 2rem;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px 10px;
    }
}

.news-card {
    flex: 0 0 calc(33.333% - 20px);
    min-width: calc(33.333% - 20px);
    display: block;
    background-color: #fff;
    border-radius: 0; /* Sharp corners */
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.news-card-image {
    width: 100%;
    height: auto; /* Let aspect-ratio control the height */
    aspect-ratio: 4 / 3; /* Đổi từ 16/9 sang 4/3 để card nhỏ gọn hơn */
    overflow: hidden;
    background-color: #f5f5f5; /* Thêm background cho trường hợp hình không đủ kích thước */
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đổi lại thành cover để hình đầy đủ trong card */
    object-position: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.news-card-content {
    padding: 20px;
}

.news-card-date {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #222;
}

.news-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

/* Responsive for News Section */
@media (max-width: 1024px) {
    .news-card {
        flex: 0 0 calc(50% - 15px);
        min-width: calc(50% - 15px);
    }
}

@media (max-width: 768px) {
    .news-card {
        flex: 0 0 calc(100% - 30px);
        min-width: calc(100% - 30px);
    }
}

.no-news-message {
    flex: 1 0 100%; /* Make it span full width in flexbox */
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    padding: 50px 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
