/* Container chính */
.fct-gallery-sec {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px;
    text-align: center;
}

/* --- PHẦN CSS CHO TIÊU ĐỀ SECTION MỚI --- */
.fct-gallery-header {
    margin-bottom: 25px;
    text-align: center;
}

.fct-gallery-main-title {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #0c1a30 !important; /* Màu xanh đen đậm */
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    display: inline-block;
    position: relative;
    padding-bottom: 12px; /* Khoảng cách từ chữ xuống gạch chân */
}

/* Tạo đường gạch chân màu đỏ căn giữa */
.fct-gallery-main-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 65px; /* Độ dài đường gạch chân */
    height: 3px; /* Độ dày đường gạch chân */
    background-color: #d0021b; /* Màu đỏ gạch chân */
    border-radius: 2px;
}

/* Kiểu nút danh mục (Tabs) */
.fct-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.fct-tabs .fct-tab-btn {
    border: 1px solid #e5e5e5;
    color: var(--fs-color-secondary);
    padding: 5px 22px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.fct-tabs .fct-tab-btn.active,
.fct-tabs .fct-tab-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: #d0021b;
}

/* Lưới hiển thị 4 cột, khoảng cách 5px */
.fct-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

/* Ô chứa ảnh */
.fct-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    aspect-ratio: 4/3;
}

.fct-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.fct-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.fct-item:hover img {
    transform: scale(1.06);
}

/* Lớp phủ tối ở đáy ảnh */
.fct-item-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 15px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    text-align: left;
    box-sizing: border-box;
    pointer-events: none;
}

/* Khu vực hiển thị Text */
.fct-item-meta {
    flex: 1;
    padding-right: 10px;
}

.fct-item-title {
    color: #ffffff !important;
    margin: 0 0 3px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.fct-item-subtitle {
    color: #dddddd !important;
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
}

/* Icon mũi tên */
.fct-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.fct-item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- TRÊN THIẾT BỊ DI ĐỘNG --- */
@media (max-width: 767px) {
    .fct-gallery-main-title {
        font-size: 21px !important; /* Thu nhỏ tiêu đề trên mobile */
    }

    /* Tối ưu thanh Tabs lướt ngang mượt mà */
    .fct-tabs {
        justify-content: flex-start !important; /* Căn nút từ bên trái sang để cuộn tự nhiên */
        flex-wrap: nowrap !important;          /* Tuyệt đối không cho xuống hàng */
        overflow-x: auto !important;           /* Kích hoạt chế độ cuộn ngang */
        padding: 5px 15px !important;          /* Thêm khoảng đệm hai bên để tránh sát lề màn hình */
        margin-bottom: 20px !important;
        -webkit-overflow-scrolling: touch;     /* Lướt mượt trên iOS */
    }

    /* Ngăn các nút tab bị méo hoặc co nhỏ kích thước khi cuộn */
    .fct-tabs .fct-tab-btn {
        flex: 0 0 auto !important; 
    }

    /* Ẩn thanh cuộn xấu xí của thanh Tabs trên mobile */
    .fct-tabs::-webkit-scrollbar {
        display: none !important; 
    }
    .fct-tabs {
        -ms-overflow-style: none !important;  
        scrollbar-width: none !important;  
    }

    /* Lưới ảnh lướt ngang */
    .fct-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 5px;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }
    
    .fct-grid::-webkit-scrollbar {
        display: none; 
    }
    .fct-grid {
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }

    .fct-item {
        flex: 0 0 78%; 
        scroll-snap-align: start;
        aspect-ratio: 4/3;
    }
    
    .fct-item-title {
        font-size: 13px !important;
    }
    
    .fct-item-subtitle {
        font-size: 10px !important;
    }
}