/* ==========================================================================
   ĐỒNG BỘ TIÊU ĐỀ TRANG DANH MỤC (TIN TỨC) 
   ========================================================================== */
.category .page-title-inner,
.blog-archive .page-title-inner {
    display: block !important;
    text-align: center !important;
    padding: 30px 0 10px 0 !important;
}

.category .page-title h1,
.blog-archive .page-title h1 {
    font-size: 24px !important;
    text-transform: uppercase !important;
    color: #005cab !important; /* Màu xanh chủ đạo Bảo Việt */
    font-weight: bold !important;
    margin-bottom: 5px !important;
    letter-spacing: 1px;
}

.category .page-title p,
.blog-archive .page-title p {
    font-size: 15px !important;
    color: #4a4a4a !important;
    font-style: italic;
}

/* Ép buộc hiển thị dòng thông tin tags và danh mục bài viết */
.single-post footer.entry-meta {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

.has-shadow>.col>.col-inner {
    background-color: #fff;
    border: 1px solid #1e73be;
}

/* Khởi tạo hàng Flexbox chứa 3 cột */
.comment-fields-custom-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
    margin-bottom: 15px;
}

/* Chia đều mỗi cột chiếm chính xác 1/3 chiều rộng */
.comment-fields-custom-row .comment-field-col {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

/* Đảm bảo ô input giãn đều theo khung cột */
.comment-fields-custom-row .comment-field-col input {
    width: 100% !important;
    box-sizing: border-box;
}

/* Tự động chuyển về 1 hàng dọc khi xem trên Mobile để tránh bị bóp méo */
@media (max-width: 768px) {
    .comment-fields-custom-row .comment-field-col {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
}

/* Định dạng cho đoạn mô tả bài viết liên quan */
.blog-post-inner .post-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.5;
    margin-top: 10px;
    min-height: 42px; 
}

/* Tùy chỉnh khoảng cách tiêu đề và đường kẻ để bố cục thoáng hơn */
.blog-post-inner .post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    min-height: 46px; /* Giúp bài 1 dòng hay 2 dòng đều cao bằng nhau */
}

.blog-post-inner .is-divider {
    margin-top: 5px;
    margin-bottom: 10px;
}

.mb {
    margin-bottom: 30px;
    border: none;
    border-radius: 5px;
    background: white;
    padding: 15px;
}

#wrapper, #main {
    background-image: url("https://travel.baovietgiadinh.com.vn/wp-content/uploads/2026/05/nen-bao-hiem-bao-viet.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

/* ==========================================================================
   1. SỬA LỖI MASONRY &amp; ÉP CÁC BOX BẰNG NHAU (BẮT BUỘC)
   ========================================================================== */

/* Vô hiệu hóa tính năng dịch chuyển tuyệt đối vô lý của Masonry */
.row-masonry {
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

.row-masonry > .col {
    position: static !important; /* Hủy bỏ position absolute do JS tự tính toán */
    display: flex !important;
}

.row-masonry > .col > .col-inner {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1;
    height: 100%;
}

/* Thiết lập khung chứa bài viết thành Flexbox dọc */
.blog-archive .col .box-blog-post,
.box.box-normal.box-blog-post {
    display: flex !important;
    flex-direction: column !important;
    height: 100%; 
    border: 1px solid #1e73be;
    border-radius: 5px;
}

/* ==========================================================================
   2. FIX LỖI ẨN ẢNH (ÉP KHUNG ẢNH RỘNG 100%, KHÔNG BỊ CO TÍ HON)
   ========================================================================== */
.box.box-normal .box-image,
.product-small.box .box-image,
.blog-archive .box .box-image {
    padding: 10px;
    background: #fff;
    border-radius: 5px 5px 0 0;
    width: 100% !important;
    flex-shrink: 0 !important; 
}

/* ==========================================================================
   3. CẤU TRÚC PHẦN TEXT TỰ CO GIÃN ĐỀU ĐÁY
   ========================================================================== */
.box.box-normal .box-text,
.product-small.box .box-text,
.blog-archive .box .box-text {
    padding: 5px 20px 20px 20px;
    background: #fff;
    border-radius: 0 0 5px 5px;
    flex-grow: 1; 
    display: flex !important;
    flex-direction: column !important;
}

/* Giới hạn tiêu đề tối đa 2 dòng */
.box.box-normal .box-text h5 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 45px;
}

/* Khống chế đoạn mô tả ngắn gọn tối đa 3 dòng */
.box.box-normal .box-text p {
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   4. CÁC THÀNH PHẦN GIAO DIỆN KHÁC (GIỮ NGUYÊN)
   ========================================================================== */
.single-post .article-inner, .comments-area {
    border: none;
    border-radius: 5px;
    background: white;
    padding: 15px;
}

.box.box-normal .cat-label {
    text-transform: inherit;
    opacity: 1;
    font-size: 14px;
    position: absolute;
    top: -35px;
    color: #fff;
}

.box.box-normal:hover h5 {
    color: var(--primary-color);
}

.ez-toc-counter nav ul li a::before {
    color: #005baa;
}

/* Ẩn search và social icons trong menu mobile */
#main-menu .searchform-wrapper, 
#main-menu .social-icons {
    display: none !important;
}

/* 1. Đổi nền xanh gradient cho toàn bộ menu mobile */
#main-menu.mobile-sidebar {
    background: -webkit-linear-gradient(0deg, rgb(0, 121, 192) 0%, rgb(0, 177, 225) 100%);
    width: 100% !important;
    max-width: 100% !important;
}

/* 2. Căn giữa danh sách menu */
#main-menu .sidebar-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
}

/* 3. Style cho các mục chữ (Trang chủ, Tổng quan...) */
#main-menu .sidebar-menu li a {
    color: #ffd237 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none !important;
    padding: 15px 0 !important;
    margin-left: 20px;
}

/* 4. Tùy chỉnh nút Close (Dấu X) */
#main-menu .mfp-close {
    color: #fff !important;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: 20px !important;
    right: 20px !important;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.col, .columns, .gallery-item {
    margin: 0;
    padding: 0px 10px 10px;
    position: relative;
    width: 100%;
}

span.widget-title {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 0;
    background: linear-gradient(90deg, #005cab 0%, #006cb9 30%, #0082cb 60%, #0093d9 100%) !important;
    padding: 15px;
    color: #fff;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: block;
    text-align: center;
}

input[type="submit"] {
    height: 40px;
    background: linear-gradient(180deg, #FEC626 0%, #CCA126 100%);
    color: #FFF;
    box-shadow: 0 3px 0 0 #337cbb;
    text-align: center;
    margin-bottom: 4px;
    border: 1px #ecc09a solid;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    width: max-content;
}

input[type="submit"]:hover {
    background-image: -webkit-linear-gradient(0deg, rgb(0, 121, 192) 0%, rgb(0, 177, 225) 100%);
    border-color: #06748c;
    color: #fff;
    -webkit-box-shadow: 0 3px 0 0 #1a1446;
    box-shadow: 0 3px 0 0 #1a1446;
}

.select-resize-ghost, .select2-container .select2-choice, .select2-container .select2-selection, input[type=date], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=url], select, textarea {
    background-color: #fff;
    border-radius: 5px;
    height: 2.507em;
    padding: 0 .75em;
    width: 100%;
    border: 1px solid #ecc09a;
    color: #1e73be;
}

.cf-container {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}

.cf-col-1, .cf-col-2, .cf-col-3, .cf-col-4, .cf-col-5, .cf-col-6, .cf-col-7, .cf-col-8, .cf-col-9, .cf-col-10, .cf-col-11, .cf-col-12 {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 5px;
    padding-left: 5px;
}

@media ( min-width: 576px ) {
    .cf-col-1 {
        -ms-flex: 0 0 8.333333%;
        flex: 0 0 8.333333%;
        max-width: 8.333333%;
    }
    .cf-push-1 { margin-left: 8.333333%; }
    .cf-col-2 {
        -ms-flex: 0 0 16.66667%;
        flex: 0 0 16.66667%;
        max-width: 16.66667%;
    }
    .cf-push-2 { margin-left: 16.66667%; }
    .cf-col-3 {
        -ms-flex: 0 0 25%;
        flex: 0 0 25%;
        max-width: 25%;
    }
    .cf-push-3 { margin-left: 25%; }
    .cf-col-4 {
        -ms-flex: 0 0 33.33333%;
        flex: 0 0 33.33333%;
        max-width: 33.33333%;
    }
    .cf-push-4 { margin-left: 33.33333%; }
    .cf-col-5 {
        -ms-flex: 0 0 41.66667%;
        flex: 0 0 41.66667%;
        max-width: 41.66667%;
    }
    .cf-push-5 { margin-left: 41.66667%; }
    .cf-col-6 {
        -ms-flex: 0 0 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
    .cf-push-6 { margin-left: 50%; }
    .cf-col-7 {
        -ms-flex: 0 0 58.33333%;
        flex: 0 0 58.33333%;
        max-width: 58.33333%;
    }
    .cf-push-7 { margin-left: 58.33333%; }
    .cf-col-8 {
        -ms-flex: 0 0 66.66667%;
        flex: 0 0 66.66667%;
        max-width: 66.66667%;
    }
    .cf-push-8 { margin-left: 66.66667%; }
    .cf-col-9 {
        -ms-flex: 0 0 75%;
        flex: 0 0 75%;
        max-width: 75%;
    }
    .cf-push-9 { margin-left: 75%; }
    .cf-col-10 {
        -ms-flex: 0 0 83.33333%;
        flex: 0 0 83.33333%;
        max-width: 83.33333%;
    }
    .cf-push-10 { margin-left: 83.33333%; }
    .cf-col-11 {
        -ms-flex: 0 0 91.66667%;
        flex: 0 0 91.66667%;
        max-width: 91.66667%;
    }
    .cf-push-11 { margin-left: 91.66667%; }
    .cf-col-12 {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}