/* Begin: Dung cho cac trang khong can keo menu */
header.scrolled .header__top {
    display: none !important;
}
header#header {
    background: #fff;
}
.header--gradient .header__menu > .menu-item > .menu-link {
    color: #207d57;
}
img.logoFixed {
    display: block !important;
}
.header__main {
    padding-top: 20px !important;
    border-bottom: 1px solid #207d57;
}
.header__logo img.logoRelative {
    display: none;
}

.header.fixed .header__top {
    margin-top: 0px !important;
}

.header.fixed .header__main .header__tools {
    /* display: none !important; */
    margin-bottom: 16px;
}
/* End: Dung cho cac trang khong can keo menu */


.social-sharing-network ul {
    padding: 24px 0;
    list-style: none;
    display: flex;
    gap: 30px;
}

.icon_fb,
.icon_x,
.icon_in,
.icon_link {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.icon_fb:hover,
.icon_x:hover,
.icon_in:hover,
.icon_link:hover {
    transform: scale(1.1);
}

.banner {
    margin-top: 132px;
}
/* Nội dung */
.post-text {
    padding-right: 50px;
}

h2 {
    font-size: 18px;
}

.post-text h1 {
    color: var(--mLOGO, #207d57);
    font-feature-settings: "liga" off, "clig" off;
    font-family: Montserrat;
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.5px;
}

/* Mục lục */
.toc-container {
    width: 100%;
    border: 2px solid #c2c5c1;
    border-radius: 8px;
    overflow: hidden;
    font-family: Montserrat;
    color: #1c7d56;
    background: rgba(35, 127, 87, 0.06);
    padding: 20px;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 0px 20px;
    margin-bottom: 8px;
    cursor: pointer;
}

.toc-title {
    display: flex;
    align-items: center;
}

.toc-title svg {
    font-size: 18px;
    margin-right: 10px;
}

.toc-header h3 {
    margin: 0;
    font-size: 22px;
    color: #1c7d56;
    font-weight: 700;
    margin-left: 10px;
}

.toc-list {
    list-style-type: none !important;
}

.toc-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
}

.toc-list li::before {
    position: absolute;
    left: 0;
    color: #207d57;
    margin: 4px 0;
}

.toc-h1 {
    margin-left: 0;
}
.toc-h2 {
    margin-left: 25px;
}
.toc-h3 {
    margin-left: 50px;
}
.toc-h4 {
    margin-left: 75px;
}
.toc-h5 {
    margin-left: 100px;
}

.toc-list a {
    text-decoration: none;
    display: inline-block;
    padding: 3px 0;
    color: #207d57;
    font-size: 14px;
    font-weight: 400;
}

.toc-list a:hover {
    color: #207d57;
}

#post-content {
    margin-top: 24px;
}
/* Định dạng cho toàn bộ section */
.fullwidth-block {
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.block-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
}

.block-wrapper:first-child {
    margin-bottom: 0;
}

.image-side {
    flex: 0 0 55%;
    position: relative;
    overflow: hidden;
}

.image-side img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-side {
    flex: 0 0 45%;
    padding: 30px 40px;
    box-sizing: border-box;
}

.text-wrapper p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.block-wrapper.reverse {
    flex-direction: row-reverse;
    /* background-color: #f7f7f7; */
}

.block-wrapper.reverse .text-side {
    order: 2;
}

.block-wrapper.reverse .image-side {
    order: 1;
}

    /* Định dạng cho toàn bộ section hero */
.hero-block {
    position: relative;
    width: 100%;
    /* Thiết lập ảnh nền đã được cung cấp trong HTML inline style: background-image: url(...) */
    background-size: cover; /* Đảm bảo ảnh phủ hết khu vực */
    background-position: center; /* Căn giữa ảnh nền */
    background-repeat: no-repeat;
    min-height: 400px; /* Thiết lập chiều cao tối thiểu cho block */
    display: flex; /* Dùng flex để căn giữa lớp phủ (overlay) */
    align-items: center; /* Căn giữa theo chiều dọc */
    justify-content: center; /* Căn giữa theo chiều ngang */
    text-align: center; /* Căn giữa nội dung text */
}

/* Lớp phủ (Overlay) để làm mờ ảnh nền và làm nổi bật chữ */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Màu overlay: Màu xám đậm mờ (giống trong hình) */
    background-color: rgba(60, 70, 80, 0.7); /* Ví dụ: xám đậm với độ trong suốt 70% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Tiêu đề chính */
.overlay h2 {
    color: #fff; /* Màu chữ trắng */
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 25px; /* Khoảng cách với nội dung text */
    text-transform: capitalize;
}

/* Container chứa nội dung text */
.hero-content {
    margin: 0 auto; /* Căn giữa container nội dung */
}

/* Định dạng cho các đoạn văn bản */
.hero-content p {
    color: #ccc; /* Màu chữ trắng nhạt hơn cho nội dung */
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0; /* Khoảng cách giữa các đoạn */
}

/* Căn chỉnh text trong nội dung */
.hero-content {
    text-align: center; /* Đảm bảo nội dung text được căn giữa */
}

/* list tin */

.section-title {
    margin: 30px 0px;
    color: var(--mLOGO, #207d57);
    font-family: Montserrat;
    font-size: 25px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: -1px;
}

.related-posts {
    width: 100%;
    background: #fff;
}

.card {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 470px;
}

.card-image img {
    width: 100%;
    align-self: stretch;
    height: auto;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-content {
    display: flex;
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    align-self: stretch;
    background: #fff;
}

.card-content a {
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4em;
    max-height: calc(1.4em * 4);
}

.card-content p {
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4em;
    max-height: calc(1.4em * 3);
}

.card-title {
    color: var(--mLOGO, #207d57);
    font-feature-settings: "liga" off, "clig" off;
    font-family: Montserrat;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: -0.5px;
}

.card-desc {
    margin-bottom: 10px;
    line-height: 1.4em;
    color: var(--mLOGO, #207d57);
    font-size: 16px;
    font-weight: 400;
}

.card-link {
    display: inline-block;
    color: #237f57;
    font-size: 16px;
    text-decoration: none;
}

.card-date {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--Mlogo, #207d57);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
}

/* Khối cuối trang */
.banner-section {
    position: relative;
    width: 100%;
    height: 620px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    margin-top: 70px;
}

.banner-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        85deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0) 52.05%
    );
}

.banner-section .banner-box-content {
    position: relative;
    left: 240px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    max-width: 100%;
    z-index: 1;
    bottom: 250px;
}

.banner-section .banner-box-content h3 {
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 34px;
    font-weight: 600;
    margin: 0;
}

.banner-section .banner-box-content p {
    margin: 0px;
}

/* Nút */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
}

.btn-outline {
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
}

.btn-outline:hover {
    background: #fff;
    color: #000;
}

.btn-green {
    background: #207d57;
    color: #fff;
    border: none;
}

.btn-green:hover {
    background: #145c3e;
}

.toc-floating-btn {
    position: fixed;
    bottom: 40px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: #ffffff;
    border: 2px solid #207D57;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}
.toc-floating-btn:hover {
    background-color: #207D57;
}
.toc-floating-btn:hover svg path {
    fill: #fff;
}
.toc-floating-btn.show {
    opacity: 1;
    visibility: visible;
}

/* Tablet (<= 991px) */
@media (max-width: 991px) {
    .post-text {
        padding-right: 20px;
    }

    .toc-header h3 {
        font-size: 18px;
    }

    .toc-list a {
        font-size: 14px;
    }

    /* Khối Split-Screen */
    .text-side {
        padding: 30px 25px; /* Giảm padding ngang */
    }
    .text-wrapper p {
        font-size: 14px;
    }
    .block-wrapper.reverse .text-wrapper::before {
        font-size: 20px;
    }

    /* Khối Hero */
    .hero-block {
        min-height: 380px;
    }
    .overlay h2 {
        font-size: 36px;
    }
    .hero-content p {
        /* Reset margin để đảm bảo tính toán max-height chính xác */
        margin: 5px 0 5px 0; /* Giảm khoảng cách giữa các đoạn */
        padding: 0;

        /* Thiết lập hiển thị cho webkit (Chrome, Safari, Edge) */
        display: -webkit-box !important; /* Dùng !important để ưu tiên */
        -webkit-line-clamp: 5; /* GIỚI HẠN 5 DÒNG */
        -webkit-box-orient: vertical;

        /* Cần thiết lập line-height cụ thể và overflow để kích hoạt cắt nội dung */
        line-height: 1.6;
        font-size: 15px; /* Giữ kích thước font */

        /* Áp dụng các thuộc tính cắt nội dung */
        overflow: hidden !important;
        text-overflow: ellipsis;
        white-space: normal;

        /* Tính toán max-height (1.6em * 5 dòng) để hỗ trợ fallback và tăng độ ổn định */
        max-height: calc(1.6em * 5);
    }

    /* Khối cuối trang */
    .banner-section {
        height: 480px;
    }
    .banner-section .banner-box-content {
        left: 60px;
        bottom: 180px;
        max-width: 80%;
    }
    .banner-section .banner-box-content h3 {
        font-size: 26px;
    }
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    /* Khối cuối trang */
}

@media (max-width: 768px) {
    /* Khối Split-Screen: Chuyển sang bố cục CỘT */
    .block-wrapper,
    .block-wrapper.reverse {
        flex-direction: column;
    }

    .image-side,
    .text-side {
        flex: 0 0 100%; /* Chiếm 100% chiều rộng */
        width: 100%;
    }

    .image-side {
        height: 350px; /* Chiều cao cố định cho ảnh trên mobile */
    }

    /* Đảm bảo thứ tự chuẩn cho khối Reverse trên mobile: Ảnh trên, Text dưới */
    .block-wrapper.reverse .image-side {
        order: 1;
    }
    .block-wrapper.reverse .text-side {
        order: 2;
        background-color: #f7f7f7; /* Giữ màu nền xám */
    }

    /* Khối Hero */
    .hero-block {
        min-height: 300px;
    }
    .overlay h2 {
        font-size: 30px;
        margin-bottom: 20px;
    }
}

/* Mobile (<= 575px) */
@media (max-width: 575px) {
    .toc-list {
        padding-left: 20px;
    }
    .toc-list li {
        padding-left: 0px;
    }
    .post-text {
        padding-right: 0;
    }

    .toc-container {
        margin: 20px 0;
        font-size: 14px;
        padding: 0;
    }

    .toc-header {
        padding: 10px 15px;
    }

    .toc-header h3 {
        font-size: 18px;
    }

    .toc-title svg {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }

    .toc-list a {
        font-size: 13px;
        padding: 2px 0;
    }

    #post-content {
        margin-top: 16px;
    }

    /* Khối Split-Screen */
    .image-side {
        height: 250px;
    }
    .text-side {
        padding: 20px;
    }
    .block-wrapper.reverse .text-wrapper::before {
        font-size: 18px;
    }

    /* Khối Hero */
    .hero-block {
        min-height: 250px;
    }
    .overlay h2 {
        font-size: 18px;
    }
    .hero-content p {
        -webkit-line-clamp: 4; /* Giảm xuống 4 dòng để tránh tràn trên mobile nhỏ */
        max-height: calc(1.6em * 4);
        font-size: 14px;
        line-height: 1.5;
    }
    /* Khối cuối trang */
    .banner-section {
        height: auto;
        min-height: 360px;
        display: flex;
        background-position: top center;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    .banner-section .banner-box-content {
        position: relative;
        left: 0;
        bottom: 0;
        text-align: center;
        align-items: center;
        gap: 16px;
        max-width: 100%;
    }
    .banner-section .banner-box-content h3 {
        font-size: 18px;
        line-height: 1.4;
    }
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
        font-size: 10px;
    }
    /* Khối cuối trang */
}
