﻿/* Bố cục chính cho phần Tin tức và Sidebar */
.news-container {
    display: flex;
    gap: 30px; /* Khoảng cách giữa danh sách tin tức và sidebar */
    height: 100%;
}

.main-news-list {
    flex: 3; /* Cột chính chiếm khoảng 66.6% */
}

.news-sidebar {
    flex: 1; /* Sidebar chiếm khoảng 33.3% */
    padding-top: 5px; /* Điều chỉnh để căn chỉnh với tin tức đầu tiên */
}

/* Đặt chiều cao và scroll riêng cho mỗi cột */
.main-news-list,
.news-sidebar {
    height: 100%; /* chiếm đầy chiều cao cha */
    overflow-y: auto; /* scroll dọc khi nội dung vượt */
}

/* --- Định kiểu cho từng bài viết trong danh sách chính --- */
.post-item {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee; /* Đường kẻ phân cách giữa các bài viết */
    padding-bottom: 40px;
}

    /* Layout cho bài viết thường (ảnh bên trên, nội dung bên dưới) */
    .post-item:not(.full-width-banner) .post-image-wrap {
        margin-bottom: 20px;
    }

    .post-item img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

/* Định kiểu cho tiêu đề */
.post-title {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 10px;
}

    .post-title a {
        color: #333;
        text-decoration: none;
        transition: color 0.3s;
    }

        .post-title a:hover {
            color: #C21F61; /* Màu hồng/đỏ đậm */
        }

/* Định kiểu cho phần meta (tác giả, ngày tháng, comment) */
.post-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

    .post-meta span {
        margin-right: 15px;
        display: inline-block;
    }

/* Định kiểu cho tóm tắt */
.post-excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

/* Định kiểu cho nút "Read More" */
.read-more-button {
    display: inline-block;
    color: #fff;
    background-color: #C21F61; /* Màu nền nút */
    padding: 8px 18px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    border-radius: 4px;
}

    .read-more-button:hover {
        background-color: #a01a50; /* Màu nền khi hover */
    }

/* --- Định kiểu cho Sidebar --- */

.widget {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #eee; /* Viền nhẹ cho widget */
    border-radius: 5px;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #C21F61; /* Đường gạch chân màu nổi bật */
    padding-bottom: 8px;
}

/* Widget Tìm kiếm */
.widget-search {
    border: none;
    padding: 0;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}

.search-field {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

.search-submit {
    background-color: #C21F61;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .search-submit:hover {
        background-color: #a01a50;
    }

/* Widget Danh mục */
.widget-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-categories li a {
    display: block;
    padding: 8px 0;
    color: #555;
    text-decoration: none;
    border-bottom: 1px dotted #eee;
    transition: color 0.3s;
}

.widget-categories li:last-child a {
    border-bottom: none;
}

.widget-categories li a:hover {
    color: #C21F61;
}

/* Widget Tin gần đây */
.widget-recent-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-post-link {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    border-bottom: 1px dotted #eee;
}

.widget-recent-posts li:last-child .recent-post-link {
    border-bottom: none;
}

.recent-post-thumb {
    width: 60px;
    height: 60px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

    .recent-post-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.recent-post-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.recent-post-content .post-date {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.recent-post-link:hover .recent-post-content p {
    color: #C21F61;
}

/* Tối ưu responsive */
@media (max-width: 1024px) {
    .news-container {
        flex-direction: column;
        height: auto; /* khi xuống mobile không scroll riêng */
    }

    .main-news-list,
    .news-sidebar {
        height: auto;
        overflow: visible;
    }
}
