/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

 
.project-posts-container {
    display: grid;
    /* Mặc định hiển thị 2 cột cho mobile */
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; /* Có thể giảm khoảng cách một chút trên mobile */
    margin: 0 auto;
    padding: 20px; /* Thêm padding 2 bên để không bị dính sát lề trên mobile */
}

.project-post {
    position: relative;
    overflow: hidden;
}

.project-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 8, 8, 0.76); /* Overlay background */
    z-index: 1;
}

.project-post img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    z-index: 0;
}

.project-post-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    padding: 10px;
    width: 80%;
    pointer-events: none; /* Ngăn chặn tiêu đề cản trở click vào link */
    background: none; /* Loại bỏ background của tiêu đề */
    z-index: 2;
}

.project-link {
    display: block;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.project-link:hover img {
    transform: scale(1.05); /* Hiệu ứng zoom khi hover */
}

.load-more-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    width: auto; /* Khôi phục kích thước tự động */
    height: auto; /* Khôi phục kích thước tự động */
    line-height: normal; /* Khôi phục line-height */
}

.loader-container {
    text-align: center;
    margin: 20px auto;
}

.loader {
    width: 40px; /* Thu nhỏ từ 100px xuống 40px */
    height: 40px; /* Thu nhỏ từ 100px xuống 40px */
    margin: 0 auto;
    border-top: 5px solid #292929;
    border-right: 5px solid #efefef;
    border-bottom: 5px solid #efefef;
    border-left: 5px solid #efefef;
    border-radius: 50px; /* Điều chỉnh để phù hợp với kích thước mới */
    animation: spin 1s infinite linear;
    display: inline-block;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* --- Project Swiper Slider Styles --- */
.project-swiper-slider {
    width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}

/* Đảm bảo slide có một chiều cao nhất định để ảnh có không gian để lấp đầy */
.project-swiper-slider .swiper-slide {
    position: relative;
    text-align: center;
    font-size: 18px;
    background: #eee; /* Thêm màu nền để thấy rõ nếu ảnh chưa load */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    
    /* QUAN TRỌNG: Đặt một tỷ lệ khung hình cho slide */
    /* Bạn có thể chọn 1 trong 2 hoặc tự đặt chiều cao cố định */
    aspect-ratio: 4 / 3; /* Tỷ lệ 4:3 (phổ biến) */
    /* aspect-ratio: 16 / 9; */ /* Tỷ lệ màn hình rộng */
    /* height: 350px; */ /* Hoặc đặt chiều cao cố định nếu muốn */
}

/* Đảm bảo thẻ a cũng lấp đầy slide */
.project-swiper-slider .swiper-slide .slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.project-swiper-slider .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-swiper-slider .swiper-slide:hover img {
    transform: scale(1.1);
}

.project-swiper-slider .slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    text-align: left;
    /* Thêm transition để hiệu ứng mượt hơn */
    transition: opacity 0.3s ease;
}

.project-swiper-slider .swiper-slide .slide-link:hover .slide-content {
    /* Tùy chọn: Ẩn/hiện tiêu đề khi hover */
    opacity: 1;
}

.project-swiper-slider .slide-title {
    margin: 0 0 5px;
    font-size: 22px;
    color: #ffffff;
}

.project-swiper-slider .slide-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* --- Navigation & Pagination Styles --- */
.project-swiper-slider .swiper-button-next,
.project-swiper-slider .swiper-button-prev {
    color: #fff;
    background-color: rgba(0,0,0,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.project-swiper-slider .swiper-button-next:after,
.project-swiper-slider .swiper-button-prev:after {
    font-size: 18px;
}
.project-swiper-slider .swiper-pagination-bullet-active {
    background-color: #fff;
}

/* --- Synced Project Slider Styles --- */
.synced-slider-widget {
    display: flex;
    align-items: center;
    gap: 60px; /* Khoảng cách giữa 2 cột */
    background-color: #fff;
    border-radius: 12px;
}

.synced-slider-widget .image-column,
.synced-slider-widget .content-column {
    flex: 1; /* Chia đều 2 cột */
    min-width: 0; /* Quan trọng để flexbox hoạt động đúng */
}

.synced-slider-widget .image-column img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    aspect-ratio: 1/1; /* Giữ ảnh vuông, bạn có thể đổi thành 4/3 */
    object-fit: cover;
}

.synced-slider-widget .slider-content-container {
    overflow: hidden; /* Ẩn các slide nội dung không hoạt động */
}

.synced-slider-widget .project-category-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: #ffeae3;
    color: #ff8c66;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.synced-slider-widget .project-title {
    font-size: 42px;
    font-weight: bold;
    color: #1a2e44;
    line-height: 1.2;
    margin: 0 0 20px 0;
}
/* Hiệu ứng gạch chân tiêu đề */
.synced-slider-widget .project-title span {
    background: linear-gradient(to top, #c7f4f3 40%, transparent 40%);
    display: inline;
}


.synced-slider-widget .project-description {
    font-size: 16px;
    color: #6d7b8a;
    line-height: 1.6;
    margin-bottom: 30px;
}

.synced-slider-widget .project-link {
    color: #1a2e44;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.synced-slider-widget .project-link .arrow {
    transition: transform 0.3s ease;
}

.synced-slider-widget .project-link:hover .arrow {
    transform: translateX(5px);
}

/* --- Navigation Styles --- */
.synced-slider-widget .slider-navigation {
    margin-top: 40px;
    display: flex;
    gap: 15px;
}

.synced-slider-widget .swiper-button-prev,
.synced-slider-widget .swiper-button-next {
    position: static; /* Ghi đè style mặc định của Swiper */
    width: 50px;
    height: 50px;
    background-color: #f7f5ff;
    border-radius: 50%;
    color: #6e62e4;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.synced-slider-widget .swiper-button-prev:hover,
.synced-slider-widget .swiper-button-next:hover {
    background-color: #6e62e4;
    color: #fff;
}

.synced-slider-widget .swiper-button-prev:after,
.synced-slider-widget .swiper-button-next:after {
    display: none; /* Ẩn icon mũi tên mặc định */
}

/* Responsive cho mobile */
@media (max-width: 767px) {
    .synced-slider-widget {
        flex-direction: column; /* Xếp chồng 2 cột */
        gap: 30px;
        padding: 20px;
    }

    /* Tùy chọn: Nếu bạn muốn cột NỘI DUNG lên trên, hãy bỏ comment dòng dưới */
    /* .synced-slider-widget { flex-direction: column-reverse; } */

    /* QUAN TRỌNG: Đặt lại flex-basis và chiều rộng rõ ràng cho 2 cột */
    .synced-slider-widget .image-column,
    .synced-slider-widget .content-column {
        flex-basis: auto; /* Reset flex-basis */
        width: 100%;      /* Đảm bảo mỗi cột chiếm toàn bộ chiều rộng */
    }

    .synced-slider-widget .project-title {
        font-size: 32px;
    }
}

/* Áp dụng cho màn hình từ 768px trở lên (tablet và desktop) */
@media (min-width: 768px) {
    .project-posts-container {
        /* Chuyển sang 3 cột */
        grid-template-columns: repeat(3, 1fr);
        gap: 20px; /* Trả lại khoảng cách ban đầu */
        padding: 20px 0; /* Bỏ padding 2 bên trên desktop */
    }
}

/* --- 4. Project Category List Widget Styles --- */
.project-category-list-container { display: grid; gap: 30px; }
.project-category-item { position: relative; overflow: hidden; }
.project-category-item a { display: block; position: relative; text-decoration: none; }
.project-category-item a::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(13, 8, 8, 0.76); z-index: 1; transition: background-color 0.3s ease; }
.project-category-item a:hover::before { background-color: rgba(13, 8, 8, 0.5); }
.project-category-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; display: block; transition: transform 0.4s ease; }
.project-category-item a:hover img { transform: scale(1.1); }
.project-category-item .category-title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; margin: 0; color: #ffffff; font-size: 22px; font-weight: bold; text-align: center; width: 90%; }
/* --- Service Slider Widget Styles --- */
.service-swiper-slider {
    position: relative;
    padding: 20px 0 40px; /* Thêm padding cho pagination */
}

.service-swiper-slider .swiper-slide {
    height: auto; /* Cho phép slide tự co dãn chiều cao */
}

.service-slide-item {
    display: flex;
    flex-direction: column;
    height: 100%; /* Quan trọng để các card cao bằng nhau */
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.service-slide-item .service-image img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.service-slide-item .service-content {
    flex-grow: 1; /* Đẩy nút xuống dưới cùng */
}

.service-slide-item .service-title {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 15px;
}

.service-slide-item .service-description {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
}

.service-slide-item .service-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #007bff;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.service-slide-item .service-button:hover {
    background-color: #0056b3;
}

/* --- Navigation & Pagination Styles --- */
.service-swiper-slider .swiper-pagination {
    bottom: 0 !important;
}

.service-swiper-slider .swiper-button-next,
.service-swiper-slider .swiper-button-prev {
    color: #333;
    top: 50%;
    transform: translateY(-50%);
}