/* ============================================================
   1. KHUNG BAO NGOÀI & LAYOUT (Container)
   ============================================================ */
.main-page-wrapper {
    background-color: #fff;
    padding: 40px 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.container-custom {
    max-width: 1270px;
    margin: 0 auto;
    padding: 0 15px;
}

.content-flex-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

/* Khối nội dung chính (Trái) */
.content-card {
    flex: 1;
    background: #ffffff;
    padding: 0px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    min-width: 0; /* Chống vỡ layout khi nội dung bên trong quá rộng */
}

/* ============================================================
   2. CÁC THÀNH PHẦN PHỤ (Breadcrumb, Title Line)
   ============================================================ */
.breadcrumb-nav {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.breadcrumb-nav a { 
    color: #888; 
    text-decoration: none; 
}

.breadcrumb-nav a:hover { 
    color: #1a0dab; 
}

.breadcrumb-nav .sep { 
    margin: 0 5px; 
}

.title-line {
    height: 3px;
    background: #eeeeee;
    margin-bottom: 25px;
    width: 100%;
}

.pages-title {
    font-size: 25px;
    font-weight: 700;
    color: #10b981;
    text-transform: uppercase;
    margin-bottom: 10px;
    line-height: 1.2;
}

.main-title {
    font-size: 2.2rem;
    color: #10b981;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

/* ============================================================
   3. NỘI DUNG BÀI VIẾT (Article Content - TinyMCE)
   ============================================================ */
   
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #6b7280; /* Màu xám nhẹ */
    margin-bottom: 15px;
}

.post-meta .meta-item i {
    margin-right: 4px;
    font-size: 13px;
}

.post-meta .category a {
    font-weight: 600;
    text-decoration: none;
}

.post-meta .category a:hover {
    text-decoration: underline;
}

.post-meta .meta-sep {
    color: #d1d5db;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.classic-tag {
    display: inline-block;
    background-color: #ffffff;
    color: #125a98;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
    border: 2px solid #10b981;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;

    /* hiệu ứng mượt */
    position: relative;
    overflow: hidden;
}

/* Hover effect */
.classic-tag:hover {
    background-color: #10b981;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.25);
}

/* Khi click */
.classic-tag:active {
    transform: scale(0.96);
}

.desc {
    font-size: 17px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.3em;
}

/* Responsive cho điện thoại */
@media (max-width: 768px) {
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .post-meta .meta-sep {
        display: none; /* Ẩn dấu gạch đứng trên mobile để xuống dòng cho đẹp */
    }
}

.article-content {
    line-height: 1.8;
    color: #374151;
    font-size: 17px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Tiêu đề bên trong bài viết */
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h2 { 
    font-size: 1.75rem; 
    border-bottom: 1px solid #f0f0f0; 
    padding-bottom: 8px; 
}

.article-content h3 { font-size: 1.4rem; }
.article-content h4 { font-size: 1.2rem; }

/* Hiệu ứng rê chuột tiêu đề mục */
.article-content h2:hover {
    color: #10b981;
    transition: color 0.2s ease;
}

/* Đoạn văn bản */
.article-content p {
    margin-bottom: 1.5rem;
}

/* KHÔI PHỤC DẤU CHẤM VÀ SỐ THỨ TỰ (FIX LỖI HIỂN THỊ) */
.article-content ul {
    list-style-type: disc !important;
    margin-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-left: 10px !important;
    display: block !important;
}

.article-content ol {
    list-style-type: decimal !important;
    margin-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-left: 10px !important;
    display: block !important;
}

.article-content li {
    display: list-item !important;
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

/* Xử lý hình ảnh trong bài */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   4. TÌM KIẾM MOBILE
   ============================================================ */
#mobile-search-bar {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    padding: 0;
    margin: 0;
}

#mobile-search-bar.active {
    max-height: 100px;
    opacity: 1;
    padding-top: 10px;
    padding-bottom: 15px;
}

/* ============================================================
   5. RESPONSIVE (Tối ưu thiết bị di động)
   ============================================================ */

/* Tablet & Mobile Layout */
@media (max-width: 1024px) {
    .content-flex-layout {
        flex-direction: column;
    }
    .sidebar-card {
        width: 100%;
    }
    .content-card, .sidebar-card {
        padding: 25px 0px;
    }
}

/* Mobile Typography */
@media (max-width: 768px) {
    .main-title { font-size: 1.8rem; }
    .article-content { font-size: 16px; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content h3 { font-size: 1.3rem; }
    
    .main-page-wrapper {
        padding: 20px 0;
    }
}

/* Ẩn search bar mobile trên Desktop */
@media (min-width: 768px) {
    #mobile-search-bar {
        display: none !important;
    }
}

/* ============================================================
   5. KHỐI TIN TỨC CHO TRANG CHỦ
   ============================================================ */

.news-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 20px 0;
}

@media (min-width: 1024px) {
    .news-container {
        grid-template-columns: 7.5fr 4.5fr; /* Chỉnh tỉ lệ một chút để cân đối hơn */
        align-items: stretch; /* ĐẢM BẢO CHIỀU CAO HAI BÊN BẰNG NHAU */
    }
}

/* --- KHỐI BÊN TRÁI (BÀI VIẾT NỔI BẬT) --- */
.news-featured {
    background-color: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* Chiếm hết chiều cao container */
}

.featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-content-bottom {
    padding: 15px;
    flex-grow: 1; /* Đẩy nội dung chiếm hết phần còn lại */
}

.featured-sub-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 12px;
    text-decoration: none;
    display: block;
    line-height: 1.3;
    transition: color 0.3s;
}

.featured-excerpt {
    color: #444;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- KHỐI BÊN PHẢI (SIDEBAR) --- */
.news-sidebar {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    height: 100%; /* Đảm bảo bằng chiều cao khối trái */
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px; /* Tăng padding */
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    text-decoration: none !important;
    flex: 1; /* Giúp các mục tự giãn đều để lấp đầy chiều cao nếu cần */
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item:hover {
    background-color: #f5f5f5;
}

/* Ảnh thumbnail nhỏ - TĂNG KÍCH THƯỚC */
.sidebar-thumb {
    width: 130px; /* Tăng từ 100px lên 130px */
    height: 85px; /* Tăng từ 70px lên 85px */
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-info {
    flex: 1;
}

.sidebar-title {
    font-size: 16px; /* Tăng nhẹ font size */
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-desc {
    font-size: 13px;
    color: #777;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- HIỆU ỨNG KHI RÊ CHUỘT (HOVER) --- */
.news-featured:hover .featured-image img {
    transform: scale(1.1);
}

.sidebar-item:hover .sidebar-title {
    color: #10b981;
}

.news-featured:hover .featured-sub-title {
    color: #10b981;
}



/* ======================================================
   DANH SÁCH BÀI VIẾT
====================================================== */

.post-item-list {
    padding: 25px 0;
    border-bottom: 1px solid #e8e8e8;
}

/* Bỏ border bài cuối */
.post-item-list:last-child {
    border-bottom: none;
}

/* Ẩn hr cũ */
.article-pages hr {
    display: none;
}

/* ======================================================
   ROW
====================================================== */

.post-item-list .row {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
}

/* ======================================================
   CỘT ẢNH
====================================================== */

.post-item-list .col-md-4 {
    flex: 0 0 300px;
    max-width: 300px;
}

/* ======================================================
   THUMBNAIL
====================================================== */

.post-thumb {
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    position: relative;
}

/* Hiệu ứng zoom ảnh */
.post-thumb img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    border-radius: 4px;

    transition: transform 0.45s ease;
}

/* Hover phóng to ảnh */
.post-thumb:hover img {
    transform: scale(1.08);
}

/* ======================================================
   CỘT NỘI DUNG
====================================================== */

.post-item-list .col-md-8 {
    flex: 1;
    padding-left: 25px;
}

/* ======================================================
   TIÊU ĐỀ
====================================================== */

.post-title-list {
    margin: 0 0 14px;
    line-height: 1.4;
    font-size: 22px;
    font-weight: 700;
}

.post-title-list a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title-list a:hover {
    color: #d35400;
}

/* ======================================================
   MÔ TẢ
====================================================== */

.post-excerpt {
    color: #666;
    font-size: 17px;
    line-height: 1.8;
    margin: 0;
}

/* ======================================================
   RESPONSIVE TABLET + MOBILE
====================================================== */

@media (max-width: 768px) {

    .post-item-list .row {
        flex-direction: column;
    }

    .post-item-list .col-md-4,
    .post-item-list .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
    }

    .post-thumb {
        margin-bottom: 15px;
    }

    .post-thumb img {
        height: auto;
    }

    .post-title-list {
        font-size: 20px;
    }

    .post-excerpt {
        font-size: 15px;
        line-height: 1.7;
    }
}













/* Container tổng của Sidebar */
.sidebar-widget {
    background: #ffffff;
    padding: 10px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 350px; /* Chiều rộng chuẩn trên PC */
    box-sizing: border-box;
}

/* Tiêu đề lớn của Widget */
.widget-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #444444;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eeeeee;
}

/* Danh sách các bài viết */
.latest-posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Khoảng cách giữa các card */
}

/* Cấu trúc của từng Card bài viết */
.post-card {
    position: relative;
    width: 100%;
    margin-bottom: 5px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Hiệu ứng chuyển động cho toàn bộ thẻ */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Hiệu ứng nhấc nhẹ Card khi di chuột */
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.post-thumb-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3; /* Giữ tỉ lệ ảnh cố định */
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Hiệu ứng phóng to ảnh nhẹ khi hover */
    transition: transform 0.5s ease;
}

.post-card:hover .post-image {
    transform: scale(1.08);
}

/* Khối nội dung: Chỉ nằm ở phía dưới và có độ mờ chuyển tiếp */
.post-content-right {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px 15px 15px;
    box-sizing: border-box;
    z-index: 2;
    
    /* Tạo hiệu ứng dải màu đen mờ dần từ dưới lên trên (Gradient) */
    /* Điều này giúp ảnh phía trên luôn rõ nét */
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.9) 0%,    /* Đen đậm ở đáy */
        rgba(0, 0, 0, 0.7) 100%,   /* Mờ dần ở giữa */
        rgba(0, 0, 0, 0) 100%     /* Trong suốt ở đỉnh khối chữ */
    );
    
    transition: all 0.3s ease;
}

/* Tiêu đề bài viết */
.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* Thêm bóng cho chữ để dễ đọc */
}

/* Mô tả ngắn: Ẩn bớt nếu quá dài */
.latest-excerpt {
    font-size: 0.9rem;
    color: #eeeeee;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.85; /* Hơi mờ hơn tiêu đề một chút */
}

/* Hiệu ứng khi Hover vào card thì mô tả rõ nét hơn */
.post-card:hover .post-excerpt {
    opacity: 1;
}

/* --- TỐI ƯU CHIỀU RỘNG TRÊN ĐIỆN THOẠI --- */
@media screen and (max-width: 768px) {
    /* 1. Loại bỏ giới hạn chiều rộng của widget */
    .widget-title {
    margin-bottom: 15px;
    padding: 10px;
    }
    .sidebar-widget {
        max-width: 100% !important; 
        width: 100% !important;
        padding: 10px 0; /* Giảm padding lề để card rộng hơn */
        margin: 0;
    }

    /* 2. Ép các Card bài viết giãn hết 100% */
    .post-card {
        width: 100% !important;
        margin-left: 0;
        margin-right: 0;
        border-radius: 10;
    }

    /* 3. Đảm bảo container chứa card không bị bóp lề */
    .latest-posts-container {
        padding: 0 10px; /* Chỉ để một chút khoảng cách nhỏ với cạnh màn hình */
        width: 100%;
        box-sizing: border-box;
    }

    /* 4. Điều chỉnh lại tỷ lệ ảnh trên mobile để không bị quá cao */
    .post-thumb-wrapper {
        aspect-ratio: 16 / 9; /* Tỷ lệ màn hình ngang trên mobile sẽ đẹp hơn */
    }
}

/* Khung viền xanh ngoài cùng - Đã bỏ padding để ảnh tràn ra sát viền */
.product-preview-wrapper {
    border: 3px solid #10b981; /* Độ dày viền xanh chuẩn như hình */
    border-radius: 16px;       /* Bo tròn góc khung mượt mà */
    padding: 0;                /* 🔑 ĐÃ SỬA: Bằng 0 để sát viền, không còn khoảng trống trắng */
    background-color: #fff;
    overflow: hidden;          /* Giữ các góc ảnh bên trong tuân thủ theo bo tròn 16px của viền */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Đổ bóng tạo chiều sâu đổ khối */
}

/* Khung phụ bên trong */
.product-preview-inner {
    position: relative;
    width: 100%;
    height: 480px;             /* Chiều cao khung hiển thị, bạn có thể chỉnh lại tùy ý */
    overflow: hidden;          /* Giữ ảnh không bị tràn ra ngoài khi zoom */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Định dạng ảnh - Tràn viền và bo khít góc */
.img-product-main {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* 🔑 ĐÃ SỬA: Ép ảnh bao phủ kín toàn bộ diện tích khung, nằm sát viền */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); /* Hiệu ứng zoom cực kỳ mượt và cao cấp */
}

/* 🚀 Hiệu ứng đưa chuột vào phóng to nhưng vẫn nằm trọn trong viền xanh */
.product-preview-inner:hover .img-product-main {
    transform: scale(1.08);    /* Phóng to nhẹ nhàng 108% tạo độ tinh tế */
}

/* Hỗ trợ hiển thị mượt trên giao diện Mobile */
@media (max-width: 768px) {
    .product-preview-inner {
        height: 290px;
    }
    .product-preview-wrapper {
        border-radius: 12px; 
    }
}

/* Khung bọc bao ngoài */
.file-info-container {
    width: 100%;        /* Ép chiều rộng luôn là 100% trên điện thoại */
    max-width: 100%;    /* Đảm bảo không bị giới hạn trên màn hình nhỏ */
    background: #ffffff;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box; /* Giúp padding không làm tràn màn hình điện thoại */
}

/* Cấu hình riêng cho Máy tính (Desktop) */
@media (min-width: 768px) {
    .file-info-container {
        max-width: 350px; /* Khi lên màn hình lớn mới giới hạn lại 350px như cũ */
    }
}

/* Tiêu đề mục */
.file-info-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 15px;
    border-bottom: 2px solid #eeeeee;
    padding-bottom: 8px;
}

/* Định dạng danh sách thông tin */
.file-info-list {
    list-style: none;
    padding: 0;
}

.file-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #cccccc; /* Đường gạch đứt ngăn cách giữa các hàng giống ảnh */
    font-size: 0.95rem;
    color: #444444;
}

.file-info-list li:last-child {
    border-bottom: none; /* Hàng cuối cùng bỏ đường kẻ */
}

/* Màu sắc chữ linh hoạt */
.info-label {
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
}

.text-blue {
    color: #0066cc; /* Màu xanh đậm cho các liên kết dữ liệu */
}

.text-dark {
    color: #222222;
}

.fw-bold {
    font-weight: 700;
}

/* Khu vực khối tải về phía dưới */
.download-section {
    text-align: center;
    margin-top: 25px;
}

.download-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 15px;
}

/* Nút bấm tải về bo tròn đỏ rực rỡ */
.btn-download-gradient {
    display: inline-block;
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff0000 0%, #ff3300 100%); /* Hiệu ứng chuyển màu đỏ tươi sang cam đỏ */
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase; /* Ép chữ in hoa toàn bộ */
    letter-spacing: 0.5px;
    border-radius: 50px; /* Bo tròn hoàn toàn hai đầu nút bấm giống ảnh */
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2); /* Tạo đổ bóng mờ rực rỡ dưới chân nút */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hiệu ứng tương tác nhè nhẹ khi người dùng rê chuột vào nút */
.btn-download-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.35);
    color: #ffffff;
}