/* ================= CẤU HÌNH BIẾN MÀU SẮC ================= */
:root {
    --primary-color1: #e40e00;      /* Màu đỏ chủ đạo */
    --secondary-color1: #003366;    /* Màu xanh đậm logo */
    --price-color1: #25ae88;       /* Màu giá tiền */
    --text-gray1: #777;
    --border-color1: #eee;
    --bg-light1: #f9f9f9;
    --hover-color1: #4caf50;       /* Màu khi hover */
}
/* Ép toàn bộ website dùng font Lexend */
* {
    font-family: 'Lexend', Arial, sans-serif !important;
}

/* Đảm bảo các thẻ tiêu đề vẫn giữ được độ đậm (fontWeight) */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', Arial, sans-serif !important;
    font-weight: 700 !important;
}

/* Đảm bảo các nút bấm và ô nhập liệu cũng tuân theo */
button, input, select, textarea {
    font-family: 'Lexend', Arial, sans-serif !important;
}
/* Reset nhẹ để tránh lỗi font và khoảng cách */
* { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* ================= HEADER DESKTOP1 ================= */
.header-desktop1 {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    display: none; /* Hiện trên PC qua media query */
}
.header-container1 {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}
.logo-area1 { display: flex; align-items: center; gap: 10px; }
.logo-area1 img { height: 80px; width: auto; }
.logo-text1 div:first-child { font-weight: 700; font-size: 22px; color: var(--secondary-color1); }
.logo-text1 div:last-child { font-size: 11px; color: var(--primary-color1); font-style: italic; }

.nav-links1 { display: flex; gap: 20px; font-weight: 500; font-size: 14px; background: transparent; }
.nav-links1 a { position: relative; padding: 5px 0; color: #333; }
.nav-links1 a:hover, .nav-links1 a.active { color: var(--hover-color1); }
.nav-links1 a.has-dot1::after {
    content: ''; position: absolute; top: -2px; right: -8px; 
    width: 7px; height: 7px; background: var(--primary-color1); border-radius: 50%;
}

.auth-buttons1 { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.btn-post1 { 
    background: #4caf50; color: #fff !important; 
    padding: 8px 18px; border-radius: 5px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-post1:hover { background: #43a047; }

/* ================= HEADER MOBILE1 ================= */
.header-mobile1 {
    background: #fff;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    position: sticky; top: 0; z-index: 1000;
}
.mobile-left1 { display: flex; gap: 18px; font-size: 24px; color: var(--secondary-color1); cursor: pointer; }
.mobile-logo-group1 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
    justify-content: center;
}
.mobile-logo-group1 img { height: 65px; width: auto; }
.logo-text-mobile1 .main-txt1 { font-size: 15px; font-weight: 800; color: var(--secondary-color1); }
.logo-text-mobile1 .sub-txt1 { font-size: 8px; color: var(--primary-color1); font-style: italic; white-space: nowrap; }

@media (max-width: 480px) {
    .mobile-logo-group1 {
        flex: 1;              /* giảm độ chiếm ngang */
        gap: 2px;             /* thu hẹp khoảng cách */
        justify-content: center;
    }

    .mobile-logo-group1 img {
        height: 42px;         /* giảm chiều cao logo */
    }

    .logo-text-mobile1 .main-txt1 {
        font-size: 12px;
    }

    .logo-text-mobile1 .sub-txt1 {
        font-size: 7px;
    }
}



/* ================= MOBILE DRAWER1 ================= */
.drawer-overlay1 {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1001;
    display: none;
}
.mobile-drawer1 {
    position: fixed; top: 0; left: -300px; width: 300px; height: 100%;
    background: #fff; z-index: 1002;
    transition: 0.3s ease-in-out; overflow-y: auto; padding: 20px 15px;
}
.mobile-drawer1.active { left: 0; }

.drawer-auth1 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.btn-auth-m1 { border: 1px solid #ddd; padding: 10px; text-align: center; border-radius: 5px; font-weight: 500; font-size: 14px; }
.btn-post-m1 { background: #4caf50; color: #fff; padding: 12px; text-align: center; border-radius: 5px; margin-bottom: 10px; font-weight: 700; display: block; }
.btn-deposit-m1 { border: 1px solid #4caf50; color: #4caf50; padding: 10px; text-align: center; border-radius: 25px; margin-bottom: 20px; display: block; font-weight: 700; }

.banner-member1 {
    background: linear-gradient(135deg, #1e90ff, #00bfff);
    padding: 15px; border-radius: 10px; color: #fff; margin-bottom: 20px;
}
.banner-member1 h4 { font-size: 16px; margin-bottom: 5px; margin-top: 5px; }
.banner-member1 p { font-size: 12px; opacity: 0.9; margin-bottom: 10px; }
.btn-learn-more1 { background: rgba(255,255,255,0.2); padding: 5px 12px; border-radius: 4px; display: inline-block; font-size: 11px; border: 1px solid #fff; color: #fff; }

.drawer-menu-list1 { list-style: none; padding: 0; }
.drawer-menu-list1 li { border-bottom: 1px solid #f5f5f5; }
.drawer-menu-list1 a { display: flex; align-items: center; justify-content: space-between; padding: 14px 5px; font-weight: 500; color: #333; font-size: 15px; }

/* ================= LAYOUT CHUNG ================= */
.container1 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    display: flex;
    gap: 30px;
}
.main-content1 { flex: 3; min-width: 0; }
.sidebar1 { flex: 1; min-width: 300px; }

/* --- TAB NAVIGATION --- */
.tab-navigation1 {
    display: flex; border-bottom: 2px solid #eee;
    margin-bottom: 20px; overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tab-navigation1::-webkit-scrollbar { display: none; }
.tab-item1 {
    padding: 12px 11px; cursor: pointer; font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -2px; color: #555;
}
.tab-item1.active {
    color: var(--primary-color1);
    border-bottom: 2px solid var(--primary-color1);
    font-weight: 700;
}

/* --- TAB PANE --- */
.tab-pane1 { display: none; }
.tab-pane1.active { display: block; animation: fadeIn1 0.5s ease; }
@keyframes fadeIn1 { from { opacity: 0; } to { opacity: 1; } }

.article-item1 { display: flex; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color1); }
.article-item1:last-child { border-bottom: none; }
.article-image-wrapper1 { flex: 0 0 130px; overflow: hidden; border-radius: 6px; }
.article-image1 { width: 130px; height: 90px; object-fit: cover; display: block; transition: 0.5s; }
.article-item1:hover .article-image1 { transform: scale(1.1); }
.article-title1 { font-size: 15px; font-weight: 500; line-height: 1.4; color: #333; transition: 0.3s; }
.article-title1 a:hover { color: var(--primary-color1); }
.article-meta1 { font-size: 12px; color: var(--text-gray1); margin-top: 6px; }

/* --- SIDEBAR --- */
.sidebar-title1 {
    font-size: 16px; font-weight: 700;
    border-left: 4px solid var(--primary-color1);
    padding-left: 10px; margin-bottom: 20px; text-transform: uppercase;
    color: var(--secondary-color1);
}
.side-post1 { display: flex; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed #ddd; }
.side-post-thumb1 { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.side-post-title1 { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 5px; color: #333; transition: 0.3s; }
.side-post-title1:hover { color: var(--primary-color1); }
.side-post-price1 { color: var(--price-color1); font-weight: 700; font-size: 13px; margin-right: 10px; }
.side-post-area1 { color: var(--secondary-color1); font-weight: 500; font-size: 13px; }

/* ================= RESPONSIVE ================= */

/* DESKTOP (> 768px) */
@media (min-width: 769px) {
    .header-desktop1 { display: block; }
    .header-mobile1 { display: none; }
    
    .tab-content-grid1 { display: flex; gap: 25px; }
    .main-article-wrapper1 { flex: 2; }
    .related-list-wrapper1 { flex: 1; border-left: 1px solid #f0f0f0; padding-left: 20px; }

    /* Layout bài chính to bên trái */
    .main-article-wrapper1 .article-item1 { flex-direction: column; border-bottom: none; }
    .main-article-wrapper1 .article-image-wrapper1 { flex: none; width: 100%; height: 320px; }
    .main-article-wrapper1 .article-image1 { width: 100%; height: 100%; }
    .main-article-wrapper1 .article-title1 { font-size: 22px; font-weight: 700; margin-top: 12px; }

    /* Layout bài nhỏ bên phải bài chính */
    .related-list-wrapper1 .article-image-wrapper1 { display: none; }
    .related-list-wrapper1 .article-item1 { padding-bottom: 10px; margin-bottom: 10px; }
    .related-list-wrapper1 .article-title1::before { content: "• "; color: var(--primary-color1); font-weight: bold; }
}

/* MOBILE (< 768px) */
@media (max-width: 768px) {
    .container1 { flex-direction: column; padding: 10px; }
    .sidebar1 { display: none; }
    
    .mobile-icon-menu1 {
        display: grid; grid-template-columns: repeat(4, 1fr);
        gap: 10px; margin-bottom: 20px; padding: 0 5px;
    }
    .icon-item1 {
        display: flex; flex-direction: column; align-items: center;
        padding: 10px 5px; border: 1px solid #eee; border-radius: 8px; background: #fff;
        text-align: center;
    }
    .icon-item1 img { width: 35px; height: 35px; margin-bottom: 5px; }
    .icon-item1 span { font-size: 10px; font-weight: 700; color: #444; line-height: 1.2; }

    /* --- PHẦN ĐÃ CẬP NHẬT ĐỂ CHỐNG LỆCH DÒNG --- */
    .article-item1 { 
        display: flex; 
        align-items: center; /* Ép chữ và ảnh luôn nằm ngang hàng chính giữa nhau */
        gap: 12px; 
    }

    .article-image-wrapper1 { 
        flex: 0 0 110px; /* Giữ độ rộng ảnh cố định 110px */
        height: 80px; 
        overflow: hidden; 
        border-radius: 6px; 
    }

    .article-image1 { width: 100%; height: 100%; object-fit: cover; }

    .article-info1 { 
        flex: 1; 
        display: flex; 
        flex-direction: column; 
        justify-content: center; /* Căn giữa khối chữ theo chiều dọc của ảnh */
        margin-top: -2px;
        padding-top: 0;
    }

    .article-title1 { 
        font-size: 14px; 
        line-height: 1.3; 
        margin-bottom: 4px;
        /* Giới hạn 2 dòng để không bị đẩy quá thấp */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 0 !important;
    }
    
    .article-meta1 { font-size: 11px; margin-top: 0; }
    /* ------------------------------------------ */
    
    .view-more-link1 {
        display: block; text-align: center; background: #f5f5f5; 
        padding: 12px; margin: 15px 0; border-radius: 4px; font-weight: 500; font-size: 14px;
        color: #555; border: 1px solid #ddd;
    }

    /* Trên mobile, bài liên quan hiện lại ảnh */
    .related-list-wrapper1 .article-image-wrapper1 { display: block; }
}

/* Ghi đè hoặc thêm vào file CSS hiện tại của bạn */
.tab-pane1 { 
    display: none; 
}
.tab-pane1.active { 
    display: block; 
    animation: fadeIn1 0.4s ease; 
}

@keyframes fadeIn1 {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fix lỗi side-post content trên mobile */
.side-post-content1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Đảm bảo bài viết chính desktop đẹp hơn */
@media (min-width: 769px) {
    .main-article-wrapper1 .article-title1 {
        margin: 15px 0 10px;
        display: block;
    }
}
/* --- TRÊN DESKTOP (> 768px) --- */
.mobile-icon-menu1 {
    display: none; /* Ẩn hoàn toàn trên máy tính */
}

/* --- TRÊN DI ĐỘNG (< 768px) --- */
@media (max-width: 768px) {
    .mobile-icon-menu1 {
        display: grid; 
        grid-template-columns: repeat(4, 1fr); /* Chia 4 cột đều nhau */
        gap: 10px; 
        padding: 15px 10px;
        background: #fff;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
    }

    .icon-item1 {
        text-align: center;
        transition: transform 0.2s;
    }

    .icon-item1:active {
        transform: scale(0.9); /* Hiệu ứng nhấn nhẹ khi chạm tay vào */
    }

    .icon-item1 img {
        width: 40px; /* Độ lớn icon phù hợp ngón tay */
        height: 40px;
        margin-bottom: 8px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .icon-item1 span {
        font-size: 11px;
        font-weight: 600;
        color: #444;
        display: block;
        white-space: nowrap; /* Tránh chữ bị nhảy xuống dòng làm lệch hàng */
    }
}

/* Container bao quanh tiêu đề để căn chỉnh khoảng cách */
.title-wrapper1 {
    margin-bottom: 25px;
    padding-bottom: 5px;
}

.custom-section-title1 {
    position: relative;
    font-family: 'Lexend', Arial, sans-serif !important; /* Font mới */
    font-size: 22px;
    font-weight: 600;
    color: #231e1e;
    display: inline-block;
    margin: 0;
    padding-bottom: 5px;
}

.custom-section-title1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #7fcfcf;
    border-radius: 0px;
}

@media (max-width: 768px) {
    .custom-section-title1 {
        font-size: 19px;
    }
}


/* --- SLIDE NGANG CUSTOM --- */
.slidengang-section {
    padding: 30px 0;
    background: #fff;
}

.slidengang-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Khung chứa các item */
.slidengang-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding-bottom: 10px;
    cursor: grab; /* Hiện bàn tay để người dùng biết là kéo được */
    user-select: none; /* Tránh bôi đen chữ khi đang kéo */
}

.slidengang-wrapper:active {
    cursor: grabbing; /* Hiện bàn tay nắm lại khi đang kéo */
}

/* Quan trọng: Ngăn chặn click nhầm vào link khi đang kéo chuột */
.slidengang-wrapper.dragging a {
    pointer-events: none;
}

/* Ẩn thanh cuộn */
.slidengang-wrapper::-webkit-scrollbar {
    display: none;
}
.slidengang-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Item trong slide */
.slidengang-item {
    flex: 0 0 280px; /* Độ rộng mỗi card trên desktop */
    scroll-snap-align: start;
}

.slidengang-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: 100%;
    border: 1px solid #eee;
}

.slidengang-image {
    position: relative;
    height: 180px;
}

.slidengang-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.slidengang-content {
    padding: 15px;
}

.slidengang-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px 0;
    height: 42px; /* Đảm bảo các tiêu đề đều nhau */
    overflow: hidden;
    line-height: 1.4;
}

.slidengang-title a { color: #333; }

.slidengang-info {
    font-size: 12px;
    color: #777;
}

/* Nút Xem tất cả */
.btn-xem-tat-ca {
    display: inline-block;
    background-color: #5cb85c;
    color: white;
    padding: 8px 30px;
    border-radius: 4px;
    font-weight: 600;
    transition: 0.3s;
}

/* Nút điều hướng */
.nav-btn {
    background: #fff;
    border: 1px solid #ddd;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .slidengang-item {
        flex: 0 0 75%; /* Mobile hiện 1 card rưỡi để kích thích người dùng kéo */
    }
    .slidengang-image {
        height: 160px;
    }
    img {
        max-width: 100%;
    }
}
.container.anh.ngang {
    width: 100%;
}

img {
    width: 100%;
    height: auto;
    display: block;
}

/* Phong thủy nhà đất */
.bds-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 30px;
    font-family: Arial, sans-serif;
    background: #fff;
}

.bds-main-content { flex: 2; }
.bds-sidebar { flex: 1; border-left: 1px solid #eee; padding-left: 20px; }

.bds-section-title {
    font-size: 16px;
    color: #0056b3;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 5px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: bold;
}

.bds-grid-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.bds-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
}

.bds-img-wrapper img {
    width: 100%;
    height: 100%; 
    object-fit: cover;
    border-radius: 4px;
}

.bds-featured-title { font-size: 16px; font-weight: bold; margin: 10px 0; color: #111; }
.bds-excerpt { font-size: 13px; color: #666; line-height: 1.5; }

/* Desktop: Bài nhỏ nằm ngang (Ảnh trái - Chữ phải) */
.bds-small-item { display: flex; gap: 12px; margin-bottom: 15px;align-items: center;}
.bds-small-item img { width: 100px; height: 65px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.bds-small-item p { font-size: 13px; font-weight: bold; margin: 0; }

.bds-tags { display: flex; gap: 8px; margin-bottom: 30px; }
.bds-tag { background: #f2f2f2; padding: 4px 10px; border-radius: 3px; font-size: 12px; color: #555; border: 1px solid #ddd; }

/* Sidebar Desktop */
.bds-sidebar-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.bds-sidebar-item img { width: 80px; height: 55px; object-fit: cover; flex-shrink: 0; }
.bds-sidebar-item p { font-size: 13px; font-weight: bold; margin: 0; }
.bds-view-more { display: block; text-align: right; color: #0056b3; font-size: 13px; text-decoration: none; }

@media (max-width: 768px) {
    .bds-container {
        flex-direction: column; /* Chồng dọc Main và Sidebar */
        padding: 10px;
    }

    .bds-sidebar {
        border-left: none;
        padding-left: 0;
        margin-top: 20px;
    }

    .bds-grid-featured {
        grid-template-columns: 1fr; /* Từng bài viết chiếm 1 hàng */
    }

    /* Quan trọng: Biến bài nhỏ thành dạng Ảnh trên - Chữ dưới cho Mobile */
    .bds-small-item, .bds-sidebar-item {
        flex-direction: column; 
        margin-bottom: 20px;
    }

    .bds-small-item img, .bds-sidebar-item img {
        width: 100%; /* Ảnh giãn hết chiều ngang mobile */
        height: auto;
        aspect-ratio: 16/9;
    }

    .bds-small-item p, .bds-sidebar-item p {
        font-size: 16px; /* Chữ to rõ hơn trên điện thoại */
        margin-top: 10px;
    }

    .bds-featured-title {
        font-size: 18px;
    }
}

.card-content-body p{
    font-size: 16px;    
    line-height: 1.8;
}


.bds-sidebar-list .caret-right {
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 6px;
    vertical-align: middle;

    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #003366;
}
