/* --- DESKTOP FIX --- */
.khamphaalbum-section {
    padding-top: 0px;
    padding-bottom: 100px;
    background-color: var(--color-white);
    /* Giữ section ổn định */
    overflow: hidden; 
}

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

    .section-title {
        font-family: var(--special-font);
        font-size: 2.4rem; /* Giảm size xuống một chút cho tinh tế */
        font-weight: 400;
        text-transform: none;
        letter-spacing: -0.5px; /* QUOC dùng letter-spacing hẹp cho title */
        color: var(--text-color);
    }

    /* Label "Hành trình" */
    .khamphaalbum-header .section-label {
        font-size: 12px;
        text-transform: uppercase;
        font-weight: 200;
        letter-spacing: 0.1em;
        color: var(--color-text-muted);
    }

    /* Cụm 2 nút điều hướng */
    .khamphaalbum-controls {
        display: flex;
        gap: 12px;
    }

    .ctrl-btn {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        border: 1px solid var(--black); /* Màu dark từ footer nhưng nhạt đi */
        background-color: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--color-dark); /* Màu hắc ín của mày */
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        padding: 0;
    }


.khamphaalbum-slider {
    display: flex;
    /* Tăng gap lên một chút cho thoáng giống QUOC */
    gap: 20px; 
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* Quan trọng: Padding này phải khớp với container của mày để đồng nhất lề */
    padding: 0; 
}

/* Ép lề chuẩn cho toàn bộ section khamphaalbum */
.khamphaalbum-section .casa-container {
    max-width: 1200px; /* Hoặc con số chuẩn của các section khác mày đang dùng */
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 55px !important;
    padding-right: 55px !important;
    box-sizing: border-box !important;
}

/* Sửa lại kích thước item để không làm bung lề container */
.khamphaalbum-item {
    flex: 0 0 calc((100% - 40px) / 3) !important; /* 24px là tổng gap: 12px * 2 */
    min-width: calc((100% - 40px) / 3) !important;
    scroll-snap-stop: always !important;
    scroll-snap-align: start !important;

}

.khamphaalbum-item img {
    width: 100%;
    aspect-ratio: 11/12;
    object-fit: cover;
    margin-bottom: 25px;
    display: block;
}

.item-info {
        position: relative; /* Đảm bảo nó nằm theo luồng tự nhiên */
        padding: 0 10px 20px 0;
        text-align: left;
    }

    .item-title {
        font-family: var(--special-font);
        font-size: 2.2rem;
        font-weight: 400;
        margin-bottom: 20px;
        color: #000000;
        display: block;
    }

    .item-desc {
        font-size: 13px;
        line-height: 1.6;
        color: #000000;
        margin-bottom: 15px;
        /* Giới hạn 3 dòng để các card đều nhau */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }


    .card-link {
        font-family: var(--special-font);
        display: inline-block;
        background-color: var(--color-bg-dark);
        color: #ffffff;
        letter-spacing: -0.02em;
        padding: 12px 28px;
        border-radius: 100px;
        font-size: 1.1rem;
        font-weight: 400;
        text-decoration: none;
        text-transform: none;
        transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
        border: 2px solid #1a1a1a;
        margin-top: 5px;
}

/* Hiệu ứng Hover - Đảo màu nhẹ nhàng */
.card-link:hover {
    background-color: transparent;
    color: #1a1a1a;
}

    .khamphaalbum-progress-container {
        width: 100%;
        height: 1px;
        transform: scaleY(0.8);
        background-color:var(--color-bar); /* Nền thanh mảnh, nhạt */
        margin-top: 30px;
        position: relative;
        overflow: hidden;
    }

    .khamphaalbum-progress-bar {
        position: absolute;
        top: 0;
        left: 0;
        height: 101%;
        width: 0%; /* Bắt đầu từ 0 */
        background-color: #000000; 
        opacity: 1 !important;
        transition: width 0.2s ease-out; 
    }



/* ==========================================================================
   MOBILE & TABLET FIX (Danna's Golden Rule: Lề 20px, Section 40px)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Reset Container: Bỏ padding 60px của Desktop, về đúng 20px [cite: 2026-02-07] */
    .khamphaalbum-section .casa-container {
        padding-bottom: 80px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    .khamphaalbum-section {
        padding: 0 !important; 
        overflow: hidden; 
    }

    /* 2. Header: Căn thẳng hàng lề 20px [cite: 2026-02-07] */
    .khamphaalbum-header {
        padding: 0 20px !important;
        margin-bottom: 20px !important;
    }

    .section-title {
        font-size: 1.8rem !important;
        max-width: 300px;
    }


    .khamphaalbum-controls {
        display: none;
    }

    
    .khamphaalbum-slider {
        padding: 0 20px !important; /* Tạo lề 20px cho ảnh đầu [cite: 2026-02-07] */
        scroll-padding: 0 20px !important; /* BUỘC trình duyệt dừng đúng vạch 20px */
        gap: 7px !important;
        scroll-snap-type: x mandatory !important;
        display: flex !important;
        margin-right: 0 !important;
    }

    /* 4. Item: Tỷ lệ 85% sang chảnh, hở đuôi ảnh sau */
    .khamphaalbum-item {
        flex: 0 0 85% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        scroll-snap-align: start !important; /* Hít chặt lề trái khi vuốt */
    }

    
    /* 3. Đảm bảo item cuối không mang theo margin thừa */
    .khamphaalbum-item:last-child {
        margin-right: 0 !important;
    }

    .khamphaalbum-item img {
        aspect-ratio: 7/8 !important; 
        margin-bottom: 15px !important;
    }

    /* 5. Fix Text: Không bị chìm, không bị lệch */
    .item-info {
        padding: 0 !important;
    }

    .item-title {
        font-size: 22px !important;
        margin-bottom: 10px !important;
    }

    .item-desc {
        font-size: 0.95rem !important;
        -webkit-line-clamp: 3 !important;
    }

    .card-link {
        font-size: 17px;
        font-weight: 100;
    }

    .khamphaalbum-progress-container {
        margin: 30px 0 0 0 !important;
        margin-bottom: 80px !important;
        width: 100%;
    }
}



@media screen and (min-width: 768px) and (max-width: 819px) {
    /* Ép container bung lề */
    .khamphaalbum-section .casa-container {
        padding: 40px 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 40px;
    }

    /* Ép Slider nhận lề 20px và không xuống hàng */
    .khamphaalbum-section .khamphaalbum-slider {
        display: flex !important;
        flex-wrap: nowrap !important;
        padding: 0 20px !important;
        gap: 10px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ép Card thu nhỏ lại để thấy card sau */
    .khamphaalbum-section .khamphaalbum-item {
        flex: 0 0 44% !important; 
        min-width: 44% !important; /* PHÁ KHÓA: Đè bệt cái 100% cũ */
        max-width: 44% !important;
        scroll-snap-align: start !important;
    }

    .khamphaalbum-section .khamphaalbum-item img {
        aspect-ratio: 6/7 !important;
        width: 100% !important;
    }

    .khamphaalbum-section .khamphaalbum-progress-container {
        display: block !important; /* Đảm bảo không bị ẩn */
        margin: 30px 20px 0 20px !important; /* Lề 20px chuẩn Danna [cite: 2026-02-07] */
        width: calc(100% - 40px) !important; /* Trừ đi 2 bên lề 20px */
        background-color: var(--color-bar) !important;
        height: 1px !important;
        position: relative !important;
        overflow: visible !important;
    }

    .khamphaalbum-section .khamphaalbum-progress-bar {
        background-color: #000000 !important;
        height: 100% !important;
        display: block !important;
    }


}






/* 2. TABLET LỚN (820px - 1439px) - Fix dính lề trái */
@media screen and (min-width: 820px) and (max-width: 1439px) {
    .khamphaalbum-section { padding: 40px 0 !important; overflow: hidden !important; margin-bottom: 40px; }
    
    .khamphaalbum-section .casa-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
    
    .khamphaalbum-header { 
        padding: 10px 20px !important; 
        box-sizing: border-box !important;
        width: 100% !important; /* Chống tràn, nhả lề trái 20px ra */
    }
    .khamphaalbum-controls { display: none !important; } 
    
    .khamphaalbum-slider {
        padding: 0 20px !important; 
        scroll-padding: 0 20px !important; /* Hít lề 20px khi vuốt */
        display: flex !important;
        flex-wrap: nowrap !important; 
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 20px !important;
    }
    
    .khamphaalbum-item {
        flex: 0 0 45% !important; /* Set 38% để hiện cỡ 2.5 card cho đẹp */
        min-width: 45% !important;
        max-width: 45% !important;
        scroll-snap-align: start !important;
    }
    
    .item-info { padding-right: 0 !important; }
    .khamphaalbum-progress-container { margin: 20px 20px 0 20px !important; width: calc(100% - 40px) !important; margin-bottom: -20px !important; }
}