/* =======================================================
   TRANG TIN TỨC / BLOG
======================================================= */

.blog-page-wrapper {
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
}

a { text-decoration: none !important; }

/* Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- TITLE & HEADINGS --- */
.section-heading {
    border-bottom: 2px solid #eaecf0;
    padding-bottom: 8px;
}

.heading-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0159a0;
    margin: 0;
    position: relative;
    display: inline-block;
}

.heading-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
}

/* --- HERO SECTION (TOP) --- */
.hero-post-card {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.hero-post-card .post-thumb {
    width: 100%;
    height: 100%;
    background: #000;
}

.hero-post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.hero-post-card:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    z-index: 2;
}

.hero-large { height: 400px; }
.hero-small { height: 122px; } /* Tính toán cho 3 ảnh nhỏ bằng 1 ảnh to (400 - 16*2)/3 */

.hero-large .post-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.hero-small .post-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.post-cate {
    display: inline-block;
    background: #d32f2f;
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}

.post-meta { font-size: 13px; color: #ccc; }

/* --- MAIN NEWS FEED (CỘT TRÁI) --- */
.feed-item {
    display: flex;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eaecf0;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-thumb {
    flex: 0 0 260px;
    height: 160px;
    margin-right: 20px;
    border-radius: 6px;
    overflow: hidden;
}

.feed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.feed-item:hover .feed-thumb img {
    transform: scale(1.05);
}

.feed-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.feed-cate {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.feed-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.feed-title a { color: #333; transition: color 0.2s; }
.feed-title a:hover { color: #0159a0; }

.feed-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: auto; /* Đẩy meta xuống đáy */
}

.feed-meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

.feed-meta .author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 6px;
}

.feed-meta .date { margin-left: 15px; }


/* --- SIDEBAR WIDGETS (CỘT PHẢI) --- */
.blog-sidebar {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f1f1f1;
}

/* Xem nhiều */
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.trend-rank {
    flex: 0 0 32px;
    height: 32px;
    line-height: 32px;
    background: #e9ecef;
    color: #495057;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
}

.trend-rank.rank-1 { background: #cb1c22; color: #fff; }
.trend-rank.rank-2 { background: #ff9800; color: #fff; }
.trend-rank.rank-3 { background: #4caf50; color: #fff; }
.trend-rank.rank-4 { background: #664caf; color: #fff; }

.trend-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    transition: color 0.2s;
    margin-top: 5px;
}

.trend-title:hover { color: #0159a0; }

/* Khuyến mãi */
.promo-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 6px;
    padding: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.promo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.promo-thumb {
    flex: 0 0 90px;
    height: 65px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
}

.promo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
}


/* --- CUSTOM PAGINATION --- */
.custom-pagination .page-link {
    color: #555;
    border: 1px solid #eaecf0;
    margin: 0 3px;
    border-radius: 4px;
    font-weight: 600;
}

.custom-pagination .page-item.active .page-link {
    background-color: #0159a0;
    border-color: #0159a0;
    color: #fff;
}


/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .hero-large { height: 250px; }
    .hero-small { height: 180px; }
    
    .feed-item {
        flex-direction: column;
    }
    
    .feed-thumb {
        flex: 1 1 100%;
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .blog-sidebar {
        padding: 15px 0;
        background: transparent;
        border: none;
        border-top: 2px solid #eaecf0;
        border-radius: 0;
    }
}
/* --- TÁCH 2 KHỐI CỘT --- */

/* =======================================================
   XỬ LÝ CỘT PHẢI: XÓA KHOẢNG TRẮNG & BẬT SCROLL (STICKY)
======================================================= */

/* 1. NGĂN CHẶN BOOTSTRAP KÉO DÃN 2 CỘT BẰNG NHAU */
.blog-content-row {
    align-items: flex-start !important; /* Chìa khóa đây: Ép cột nào nội dung tới đâu thì cao tới đó */
}

@media (min-width: 992px) {
    
    /* 2. Ép cột phải bám dính vào màn hình khi lăn chuột */
    .blog-right-col {
        position: -webkit-sticky;
        position: sticky;
        top: 30px; /* Cách mép trên màn hình 80px (bạn có thể tăng/giảm tùy theo độ dày của thanh Header menu trang web bạn) */
        z-index: 1;
    }

    /* 3. Khối màu trắng bên trong cột phải */
    .blog-sidebar-scroll {
        height: auto; /* Cắt bỏ khoảng trắng, nội dung tới đâu khối trắng tới đó */
        overflow-y: auto; /* Bật thanh cuộn nếu nội dung bên trong dài hơn max-height */
        overflow-x: hidden;
    }
    
    /* Tút lại thanh cuộn cho mỏng, đẹp, tinh tế */
    .blog-sidebar-scroll::-webkit-scrollbar {
        width: 5px; 
    }
    .blog-sidebar-scroll::-webkit-scrollbar-track {
        background: #f1f1f1; 
        border-radius: 5px;
    }
    .blog-sidebar-scroll::-webkit-scrollbar-thumb {
        background: #c1c1c1; 
        border-radius: 5px;
    }
    .blog-sidebar-scroll::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8; 
    }
}

/* =======================================================
   CUSTOM PHÂN TRANG LARAVEL (PAGINATION)
======================================================= */

/* Ép thẻ ul căn giữa, có khoảng cách giữa các nút và tự rớt dòng trên mobile */
.custom-laravel-pagination .pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px; /* Khoảng cách giữa các nút */
    margin: 0;
    padding: 0;
}

/* Tẩy định dạng thừa của Bootstrap */
.custom-laravel-pagination .page-item {
    margin: 0;
}

/* Định dạng cơ bản cho mỗi ô số (kể cả thẻ a và thẻ span) */
.custom-laravel-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #474c51;
    background-color: #fff;
    border: 1px solid #eaecf0;
    border-radius: 8px !important; /* Xóa bo góc dị của Bootstrap, ép bo góc tròn đều */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    text-decoration: none;
}

/* Hiệu ứng khi Hover chuột vào các nút (Loại trừ nút đang chọn và nút bị mờ) */
.custom-laravel-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #f4f6f8;
    color: #0159a0; /* Đổi sang màu xanh logo */
    border-color: #d1e1f0;
    transform: translateY(-2px); /* Bay nhẹ lên */
    box-shadow: 0 4px 8px rgba(1, 89, 160, 0.1);
}

/* Định dạng cho trang hiện tại đang đứng (Active) */
.custom-laravel-pagination .page-item.active .page-link {
    background-color: #0159a0;
    color: #fff;
    border-color: #0159a0;
    box-shadow: 0 4px 10px rgba(1, 89, 160, 0.3);
    z-index: 1;
}

/* Định dạng cho các nút bị vô hiệu hóa (Ví dụ nút "..." hoặc nút "<" khi ở trang 1) */
.custom-laravel-pagination .page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #f8f9fa;
    border-color: #eaecf0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none; /* Khóa hiệu ứng bay */
}

/* Tối ưu kích thước trên màn hình điện thoại nhỏ */
@media (max-width: 576px) {
    .custom-laravel-pagination .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 8px;
    }
    .custom-laravel-pagination .pagination {
        gap: 4px;
    }
}

/* =======================================================
   STYLE CHO CHI TIẾT BÀI VIẾT (ARTICLE DETAIL)
======================================================= */

.article-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
}

.article-meta {
    font-size: 14px;
    color: #777;
}

.article-content {
    font-size: 16px;
    line-height: 1.7;
    color: #242424;
}

/* Ép tất cả các thẻ Heading trong bài viết đẹp hơn */
.article-content h2 { font-size: 22px; font-weight: bold; margin-top: 25px; margin-bottom: 15px; color: #0159a0; }
.article-content h3 { font-size: 20px; font-weight: bold; margin-top: 20px; margin-bottom: 10px; }

/* FIX LỖI VỠ LAYOUT TRÊN MOBILE DO NGƯỜI DÙNG UP ẢNH TO */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px; /* Bo góc nhẹ ảnh trong bài viết cho hiện đại */
    margin: 15px 0;
    display: block;
}

/* FIX LỖI TRÀN TABLE (BẢNG) BỀ NGANG */
.article-content table {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
    display: table;
    overflow-x: auto; /* Bật thanh trượt ngang cho bảng trên điện thoại */
    -webkit-overflow-scrolling: touch;
}

.article-content table td, .article-content table th {
    padding: .75rem;
    vertical-align: top;
    border: 1px solid #dee2e6;
}

.article-content table p {
    margin-bottom: 0; /* Xóa khoảng trống thừa trong table */
}

.article-content ul, .article-content ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.article-content li {
    margin-bottom: 8px;
}

/* Tối ưu chữ trên Mobile */
@media (max-width: 768px) {
    .article-title {
        font-size: 22px;
    }
    .article-content {
        font-size: 15px; /* Giảm size chữ bài viết xíu để dễ đọc trên đt */
    }
}
/* =======================================================
   FIX LỖI HEADER CHE NỘI DUNG TRÊN MOBILE & TABLET
======================================================= */

/* Dành cho Tablet (iPad...) */
@media (max-width: 1024px) {
    .blog-page-wrapper,
    .blog-detail-page {
        /* Đẩy nội dung xuống một khoảng bằng chiều cao Menu Tablet */
        margin-top: 120px !important; 
    }
}

/* Dành riêng cho Điện thoại (Màn hình nhỏ hơn) */
@media (max-width: 768px) {
    .blog-page-wrapper,
    .blog-detail-page {
        /* Menu điện thoại thường co lại gọn hơn một chút */
        margin-top: 105px !important; 
    }
}