/* ==========================================================================
   BLOCK: TEXT BLOCK & ARTICLE CONTENT (KHỐI VĂN BẢN & CHI TIẾT BÀI VIẾT)
   Path: light-ui/templates/sections/block-text/style.css
   Refactored using Global Design Tokens from assets/css/global.css
   ========================================================================== */

/* ==========================================================================
   CẤU TRÚC CHUNG & FULLWIDTH BREAKOUT (TƯƠNG THÍCH MỌI THEME)
   ========================================================================== */
.lui-scope {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.text-block {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-body, 'Nunito Sans', sans-serif);
    color: var(--text-primary, #333333);
}

/* Kỹ thuật Breakout 100vw chuẩn */
.text-block.crb-block-fullwidth,
.crb-block-fullwidth.text-block,
.lui-scope .text-block.crb-block-fullwidth,
.lui-scope .crb-block-fullwidth.text-block {
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box !important;
    clear: both !important;
}

/* Container chuẩn căn giữa */
.text-block__container {
    position: relative;
    max-width: var(--container-max-w, 1200px);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-pad-x, 20px);
    box-sizing: border-box;
}

/* ==========================================================================
   DẠNG 1: BÀI VIẾT CHI TIẾT (.text-block--article)
   ========================================================================== */
.text-block--article {
    background-color: var(--color-surface, #FFFFFF);
    padding-top: 40px;
    padding-bottom: 50px;
}

/* Tự động gỡ khoảng cách nếu đi liền kề breadcrumb */
.midori-breadcrumb-nav+.text-block--article,
.midori-breadcrumb-nav+main .text-block--article,
.page-blog-breadcrumb-container+.text-block--article {
    padding-top: 10px !important;
}

/* Tiêu đề bài viết H1 */
.text-block--article .text-block__title {
    font-family: var(--font-heading, 'Cormorant SC', serif);
    font-size: var(--fs-h2, 32px);
    font-weight: var(--fw-h2, 700);
    line-height: var(--lh-h2, 35px);
    color: var(--text-primary, #333333);
    margin: 0 0 16px 0;
    text-transform: none;
}

/* Khối Meta thông tin (Ngày đăng, chuyên mục) & Nút chia sẻ */
.text-block__meta-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: var(--fs-caption, 14px);
    color: #6B7280;
    flex-wrap: wrap;
    gap: 12px;
}

.text-block__meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.text-block__meta-left a {
    color: var(--color-primary-second, #456967);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-base, all 0.3s ease);
}

.text-block__meta-left a:hover {
    color: var(--color-primary-third, #74A59F);
}

.text-block__sep {
    color: #CBD5E1;
    user-select: none;
}

.text-block__meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-block__share-label {
    color: var(--text-primary, #333333);
    font-weight: 500;
}

.text-block__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base, all 0.3s ease), opacity var(--transition-base, all 0.3s ease);
    cursor: pointer;
    text-decoration: none;
}

.text-block__share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* Nội dung bài viết WYSIWYG (.text-block__wysiwyg) */
.text-block__wysiwyg {
    font-size: var(--fs-body-s, 16px);
    line-height: 1.85;
    color: var(--text-primary, #333333);
    font-weight: 400;
    word-break: break-word;
}

.text-block__wysiwyg p {
    margin-top: 0;
    margin-bottom: 1.5em;
}

.text-block__wysiwyg img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-atom, 6px);
    margin: 24px auto;
    display: block;
}

.text-block__wysiwyg h2,
.text-block__wysiwyg h3,
.text-block__wysiwyg h4 {
    font-family: var(--font-heading, 'Cormorant SC', serif);
    color: var(--text-primary, #333333);
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 16px;
    line-height: 1.35;
}

.text-block__wysiwyg h2 {
    font-size: var(--fs-h2, 28px);
}

.text-block__wysiwyg h3 {
    font-size: var(--fs-h3, 24px);
}

.text-block__wysiwyg h4 {
    font-size: var(--fs-h4, 20px);
}

.text-block__wysiwyg ul,
.text-block__wysiwyg ol {
    margin-bottom: 1.5em;
    padding-left: 24px;
}

.text-block__wysiwyg li {
    margin-bottom: 8px;
}

.text-block__wysiwyg blockquote {
    margin: 28px 0;
    padding: 18px 24px;
    border-left: 4px solid var(--color-primary-second, #456967);
    background-color: var(--color-surface, #F7F2EE);
    font-style: italic;
    color: var(--text-primary, #333333);
    border-radius: 0 var(--radius-atom, 6px) var(--radius-atom, 6px) 0;
}

.text-block__wysiwyg a {
    color: var(--color-primary-second, #456967);
    text-decoration: underline;
    transition: color var(--transition-base, all 0.3s ease);
}

.text-block__wysiwyg a:hover {
    color: var(--color-primary-third, #74A59F);
}

/* ==========================================================================
   DẠNG 2: KHỐI NỘI DUNG 2 TẦNG (.text-block--wave-content)
   ========================================================================== */
.text-block--wave-content {
    background-color: #FFFFFF;
    overflow: hidden;
}

/* Khối trên (Nền phẳng) */
.text-block--wave-content .text-block__top {
    position: relative;
    padding: 70px 0 40px 0;
    background-color: transparent;
    box-sizing: border-box;
}

.text-block--wave-content .text-block__content {
    max-width: 1050px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.text-block--wave-content .text-block__title--top {
    font-family: var(--font-heading, 'Cormorant SC', serif);
    font-size: var(--fs-h2, 32px);
    line-height: var(--lh-h2, 35px);
    font-weight: var(--fw-h2, 700);
    color: var(--text-primary, #333333);
    margin: 0 0 18px 0;
}

.text-block--wave-content .text-block__desc--top {
    font-size: var(--fs-body-s, 16px);
    line-height: 1.8;
    color: var(--text-primary, #333333);
}

.text-block--wave-content .text-block__desc p {
    margin: 0 0 16px 0;
}

.text-block--wave-content .text-block__desc p:last-child {
    margin-bottom: 0;
}

/* Khối dưới (Nền lượn sóng) */
.text-block--wave-content .text-block__wave-wrapper {
    position: relative;
    width: 100%;
    background: linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 35%, var(--color-surface, #F7F2EE) 80%, var(--color-surface, #F7F2EE) 100%);
    box-sizing: border-box;
}

.text-block--wave-content .text-block__wave-bg {
    position: relative;
    width: 100%;
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 130px 0 110px 0;
    color: #FFFFFF;
    box-sizing: border-box;
}

.text-block--wave-content .text-block__content--light {
    color: #FFFFFF !important;
}

.text-block--wave-content .text-block__title--wave {
    font-family: var(--font-heading, 'Cormorant SC', serif);
    font-size: var(--fs-h2, 32px);
    line-height: var(--lh-h2, 35px);
    font-weight: var(--fw-h2, 700);
    color: #FFFFFF !important;
    margin: 0 0 18px 0;
}

.text-block--wave-content .text-block__desc--wave {
    color: #FFFFFF !important;
    opacity: 0.95;
    font-size: var(--fs-body-s, 16px);
    line-height: 1.8;
}

.text-block--wave-content .text-block__desc--wave p {
    color: #FFFFFF !important;
}

/* ==========================================================================
   RESPONSIVE TABLET & MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .text-block--article {
        padding-top: 30px;
        padding-bottom: 35px;
    }

    .text-block__meta-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .text-block--wave-content .text-block__top {
        padding: 40px 0 25px 0;
    }

    .text-block--wave-content .text-block__wave-wrapper {
        background: var(--color-primary-second, #456967) !important;
    }

    .text-block--wave-content .text-block__wave-bg {
        background-image: none !important;
        background-color: var(--color-primary-second, #456967) !important;
        padding: 40px 0 !important;
    }
}