.post-page .dark-text-title-content{font-family: var(--font-family);font-size: var(--heading-font-size);color:var(--content-color) !important}
.post-page .dark-text-content{color:var(--content-color) !important}

/* Article container */
.post-article{max-width:1200px;margin:0 auto}
.post-grid{display:grid;grid-template-columns:1fr 360px;gap:24px;align-items:start}
.post-grid.no-sidebar{grid-template-columns:1fr}
@media (max-width:991.98px){.post-grid{grid-template-columns:1fr}}

.post-card{border-radius:8px}

.post-content{font-family: var(--font-family);font-size:var(--content-font-size);color:var(--content-color)}
.post-content img{max-width:100%;height:auto;border-radius:8px;margin:10px 0;box-shadow:0 2px 10px rgba(0,0,0,.08)}

/* Sidebar */
.post-sidebar{position:sticky;top:40px}

/* Sections */
.cml-breadcrumb{background:transparent}
.project-title h1{color:var(--heading-color)}

/* Related posts */
.related-wrap{margin-top:24px}

/* Toggle helper */
.more-text{display:block}
.more-text.hidden{display:none !important}

/* ==========================================================================
   KAI HOUSE AI CONTENT STYLES
   (Dùng cho các bài viết được tạo tự động từ n8n)
   ========================================================================== */

/* 1. Khung Intro (Mở bài) */
.intro-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #eee;
    border-left: 5px solid #1976d2;
    position: relative;
}

.intro-text-wrapper {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    max-height: 120px; /* Mặc định đóng gọn trên mobile */
    overflow: hidden;
    transition: max-height 0.5s ease;
    position: relative;
}

/* Class mở rộng (khi bấm xem thêm) */
.intro-text-wrapper.expanded {
    max-height: 3000px; /* Đủ lớn để hiện hết nội dung */
}

/* Hiệu ứng mờ ở đuôi khi đóng */
.intro-text-wrapper:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(248,249,250,1), rgba(248,249,250,0));
    pointer-events: none;
}

/* Nút xem thêm Intro */
.toggle-intro-btn {
    color: #1976d2;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    user-select: none;
}
.toggle-intro-btn:hover {
    text-decoration: underline;
    background-color: rgba(25, 118, 210, 0.05);
    border-radius: 4px;
}

/* 2. Khung Hình ảnh (Gallery) */
.kai-image-block {
    margin-bottom: 40px;
}

.kai-image-block img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: block;
    transition: transform 0.3s ease;
}

/* Nội dung dưới ảnh */
.kai-image-content {
    margin-top: 15px;
    padding: 0 5px;
}

.kai-image-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem !important;
    color: #2c3e50;
    font-weight: 700;
    border-left: 4px solid #d4a373;
    padding-left: 10px;

}

.footer-text {
    text-align: center;
    margin-top: 50px;
    background: #2c3e50;
    color: #fff;
    padding: 30px 20px;
    border-radius: 8px;
}

/* =========================================
   RESPONSIVE RULES (QUAN TRỌNG)
   ========================================= */

/* Giao diện MOBILE & TABLET (< 992px) */
@media (max-width: 991px) {
    /* Ẩn mô tả ảnh để lướt nhanh */
    .kai-hide-on-mobile { display: none !important; }
    
    /* Tiêu đề ảnh căn giữa, bỏ viền trái */
    .kai-image-title {
        font-size: var(--content-font-size);
        text-align: left;
        border-left: none;
        padding-left: 0;
        color: #444;
    }
    
    /* Thu gọn khoảng cách giữa các ảnh */
    .kai-image-block { margin-bottom: 25px; }
    
    /* Hiển thị nút xem thêm Intro */
    .toggle-intro-btn { display: inline-block; }
}

/* Giao diện DESKTOP (>= 992px) */
@media (min-width: 992px) {
    /* Luôn hiện mô tả ảnh */
    .kai-hide-on-mobile { display: block !important; }
    
    /* Intro luôn mở full, ẩn nút xem thêm */
    .intro-text-wrapper { max-height: none !important; }
    .intro-text-wrapper::after { display: none !important; }
    .toggle-intro-btn { display: none !important; }
}

/* =========================================
   FIX LỖI NÚT XEM THÊM (RESPONSIVE)
   ========================================= */

/* 1. MẶC ĐỊNH (MOBILE & TABLET < 992px) */
/* Giữ nguyên trạng thái thu gọn và hiện nút */
.intro-text-wrapper {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}
.intro-text-wrapper.expanded {
    max-height: none;
}
.toggle-intro-btn {
    display: inline-block; /* Hiện nút trên mobile */
    margin-top: 10px;
    color: #1976d2;
    cursor: pointer;
    font-weight: 600;
}

/* 2. DESKTOP (Màn hình >= 992px) */
@media (min-width: 992px) {
    /* Luôn hiện full nội dung */
    .intro-text-wrapper {
        max-height: none !important; 
        overflow: visible !important;
    }
    
    /* Ẩn hiệu ứng mờ */
    .intro-text-wrapper::after {
        display: none !important;
    }

    /* Ẩn nút xem thêm */
    .toggle-intro-btn {
        display: none !important;
    }
}