﻿/* --- CSS RIÊNG CHO TRANG TIN TỨC (BLOG) --- */
/* Lưu ý: Các biến màu var(--primary), var(--text-main)... đã có trong Site.css nên dùng luôn */

/* Wrapper chính */
.blog-standard-wrapper, .detail-wrapper {
    background-color: #fff;
    padding: 60px 0;
}

/* Container riêng cho Blog (nếu cần khác container chung) */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- 1. HEADER TRANG TIN --- */
.blog-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.blog-page-title {
    font-family: 'Playfair Display', serif; /* Font tiêu đề sang trọng */
    font-size: 40px;
    font-weight: 700;
    color: var(--primary); /* Dùng biến từ Site.css */
    margin-bottom: 12px;
}

.blog-page-desc {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
}

/* --- 2. LAYOUT CHÍNH (2 CỘT) --- */
.blog-layout {
    display: grid;
    grid-template-columns: 8fr 4fr; /* Tỉ lệ 2/3 - 1/3 */
    gap: 40px;
}

/* --- 3. DANH SÁCH BÀI VIẾT (CỘT TRÁI) --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cột bài viết */
    gap: 30px;
}

.post-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px; /* Bo góc mềm mại */
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .post-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
        border-color: var(--primary);
    }

.post-thumb {
    height: 220px;
    overflow: hidden;
    position: relative;
}

    .post-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

.post-card:hover .post-thumb img {
    transform: scale(1.05);
}

.post-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-tag {
    color: var(--primary);
    font-weight: 800;
    margin-right: 5px;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em;
}

    .post-title a:hover {
        color: var(--primary);
    }

.post-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.btn-read {
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

    .btn-read:hover {
        gap: 10px;
        text-decoration: underline;
    }

/* Phân trang */
.pagination-row {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
    font-weight: 600;
    transition: 0.2s;
}

    .page-btn.active, .page-btn:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* --- 4. SIDEBAR (CỘT PHẢI) --- */
.sidebar-widget {
    margin-bottom: 40px;
    background: #fff;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

/* Input Tìm kiếm */
.search-input-wrap {
    position: relative;
}

    .search-input-wrap input {
        width: 100%;
        padding: 12px 16px;
        padding-right: 40px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        outline: none;
        font-size: 14px;
        background: #f9fafb;
    }

        .search-input-wrap input:focus {
            background: #fff;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.1);
        }

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Danh mục */
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: 0.2s;
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
}

    .cat-item:hover {
        background: #f0fdf4; /* Nền xanh nhạt */
        color: var(--primary);
        padding-left: 16px;
    }

.cat-count {
    background: #f3f4f6;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    color: var(--text-muted);
    font-weight: 700;
}

.cat-item:hover .cat-count {
    background: #fff;
    color: var(--primary);
}

/* Bài nổi bật Sidebar */
.pop-post {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.pop-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

    .pop-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.pop-info h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

    .pop-info h4 a {
        color: var(--text-main);
    }

        .pop-info h4 a:hover {
            color: var(--primary);
        }

.pop-date {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}


/* --- 5. TRANG CHI TIẾT (DETAIL) --- */
.breadcrumb-custom {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

    .breadcrumb-custom a {
        color: var(--text-muted);
        text-decoration: none;
    }

        .breadcrumb-custom a:hover {
            color: var(--primary);
        }

.reading-container {
    max-width: 800px; /* Rộng 800px chuẩn đọc */
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.article-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding: 16px 0;
    margin-bottom: 40px;
}

.meta-item i {
    color: var(--primary);
    margin-right: 5px;
}

.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: #374151;
}

    .article-body p {
        margin-bottom: 24px;
        text-align: justify;
    }

    .article-body h2 {
        font-size: 26px;
        font-weight: 800;
        color: var(--primary);
        margin-top: 40px;
        margin-bottom: 16px;
    }

    .article-body img {
        border-radius: 12px;
        margin: 30px auto;
        display: block;
        max-width: 100%;
        height: auto !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }

    .article-body blockquote {
        border-left: 4px solid var(--primary);
        padding: 16px 24px;
        margin: 32px 0;
        background: #f9fafb;
        font-style: italic;
        font-size: 18px;
        color: var(--text-main);
    }

/* Tin liên quan dưới bài viết */
.related-sec {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid #e5e7eb;
}

.related-head {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-main);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.rel-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
}

    .rel-card:hover {
        transform: translateY(-5px);
        border-color: var(--primary);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }

.rel-img-box {
    height: 180px;
    overflow: hidden;
}

    .rel-img-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: 0.5s;
    }

.rel-card:hover .rel-img-box img {
    transform: scale(1.05);
}

.rel-body {
    padding: 20px;
}

.rel-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rel-card:hover .rel-title {
    color: var(--primary);
}

.rel-desc {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* --- 6. RESPONSIVE MOBILE (QUAN TRỌNG) --- */
@media (max-width: 768px) {
    /* 1. Layout chính thành 1 cột */
    .blog-layout {
        grid-template-columns: 1fr; /* Sidebar rớt xuống dưới */
        gap: 40px;
    }

    /* 2. Grid Bài viết: VẪN GIỮ 2 CỘT TRÊN MOBILE (Theo yêu cầu) */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px; /* Giảm khoảng cách cho vừa màn hình nhỏ */
    }

    /* Tinh chỉnh Card trên Mobile */
    .post-thumb {
        height: 140px;
    }
    /* Ảnh thấp hơn */
    .post-body {
        padding: 12px;
    }

    .post-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .post-meta {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .post-excerpt {
        display: none;
    }
    /* Ẩn mô tả để gọn */
    .btn-read {
        font-size: 11px;
    }

    /* 3. Chi tiết bài viết */
    .article-header h1 {
        font-size: 26px;
    }

    .article-body {
        font-size: 16px;
    }

    /* 4. Tin liên quan: Chuyển thành 2 cột trên Mobile */
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .rel-img-box {
        height: 120px;
    }

    .rel-title {
        font-size: 14px;
    }

    .rel-desc {
        display: none;
    }
}
