/**
 * Component: Service Projects Slider (Dự án tiêu biểu)
 * Path: template-parts/sections/service-projects/style.css
 */

.service-projects {
    padding: clamp(50px, 6vw, 90px) 0 !important;
    background-color: #ffffff;
    overflow: hidden;
}

.midori-project-sub-title {
    font-family: var(--font-sans) !important;
    font-size: 22px !important;
    color: #374426 !important;
    font-weight: 600;
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.midori-project-main-title {
    font-family: 'Kodchasan', var(--font-serif), Georgia, serif !important;
    font-size: 32px !important;
    color: #374426 !important;
    font-weight: 600;
    margin: 0 0 16px 0;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.project-slide-wrapper {
    position: relative;
    text-align: left;
    padding: 40px 0 !important;
}

/* Khung góc trên bên phải */
.deco-top-right {
    position: absolute;
    top: 40px;
    right: 15px;
    width: 42%;
    height: 70px;
    border-top: 1px solid #374426;
    border-right: 1px solid #374426;
    border-top-right-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.deco-top-right::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background-color: #374426;
    border-radius: 50%;
}

/* Khung góc dưới bên trái */
.deco-bottom-left {
    position: absolute;
    bottom: 40px;
    left: 15px;
    width: 42%;
    height: 75px;
    border-bottom: 1px solid #374426;
    border-left: 1px solid #374426;
    border-bottom-left-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.deco-bottom-left::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background-color: #374426;
    border-radius: 50%;
}

/* Hàng tiêu đề góc trên bên trái */
.project-meta-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
    padding-left: 15px;
    max-width: 50%;
}

.meta-left {
    text-align: left;
}

.meta-title {
    font-family: 'Kodchasan', var(--font-serif), sans-serif !important;
    font-size: 20px !important;
    font-weight: 600;
    color: #111111;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.meta-subtitle {
    font-family: 'Kodchasan', var(--font-serif), sans-serif !important;
    font-size: 20px !important;
    color: #374426;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Lưới 5 ảnh */
.project-gallery-layout {
    display: flex;
    gap: 20px;
    margin: 25px 0;
    position: relative;
    z-index: 2;
}

.gallery-col-left {
    width: 38%;
    flex-shrink: 0;
}

.gallery-col-left img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 14px !important;
}

.gallery-col-right {
    width: 62%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-right-top {
    aspect-ratio: 16/7;
    overflow: hidden;
    border-radius: 14px;
}

.gallery-right-top img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.gallery-right-bottom-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-right-bottom-3 img {
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 14px !important;
}

/* Hàng thuyết minh góc dưới bên phải: Luôn nằm bên phải */
.project-footer-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    position: relative;
    z-index: 2;
    padding-right: 15px;
}

.footer-desc-right {
    width: 52%;
    max-width: 540px;
    text-align: right;
    margin-left: auto;
}

.footer-desc-right h4 {
    font-family: 'Kodchasan', var(--font-serif), sans-serif !important;
    font-size: 20px !important;
    font-weight: 600;
    color: #111111;
    margin-bottom: 10px;
    line-height: 1.35;
}

.footer-desc-right p {
    font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
    font-size: 16px !important;
    color: #666666;
    line-height: 1.65;
    margin: 0;
}

.project-swiper-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.project-swiper-pagination .swiper-pagination-bullet {
    width: 36px;
    height: 3px;
    background-color: #dddddd;
    border-radius: 2px;
    opacity: 1;
    transition: all 0.3s;
}

.project-swiper-pagination .swiper-pagination-bullet-active {
    background-color: #374426 !important;
    width: 64px;
}

/* Responsive Tablet */
@media (max-width: 991px) {

    .midori-project-sub-title,
    .midori-project-main-title {
        font-size: 26px !important;
    }

    .project-meta-row {
        max-width: 55%;
    }

    .deco-top-right {
        width: 38% !important;
    }

    .project-footer-row {
        display: flex !important;
        justify-content: flex-end !important;
    }

    .footer-desc-right {
        text-align: right !important;
        width: 54% !important;
        margin-left: auto !important;
    }

    .deco-bottom-left {
        width: 38% !important;
        bottom: 35px !important;
        height: 65px !important;
    }
}

/* Responsive Mobile (Đồng bộ 100% với Trang chủ) */
@media (max-width: 767px) {
    .midori-project-sub-title {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }

    .midori-project-main-title {
        font-size: 28px !important;
        margin-bottom: 20px !important;
    }

    /* 1. Thiết lập lưới 2 cột và 6 hàng bằng nhau */
    .project-gallery-layout {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        grid-template-rows: repeat(6, 1fr) !important; 
        gap: 10px !important;
        margin: 20px 0 !important;
        height: 520px !important; 
        position: relative !important;
        z-index: 2 !important;
    }

    /* Phá bỏ các div bọc để ảnh nhảy vào lưới chung */
    .gallery-col-left, .gallery-col-right, 
    .gallery-right-top, .gallery-right-bottom-3 {
        display: contents !important;
    }

    /* 2. CỘT TRÁI (2 ảnh - Mỗi ảnh chiếm 3 hàng) */
    
    /* Ảnh 1 (Ảnh trên cùng bên trái) */
    .gallery-col-left img {
        grid-column: 1 !important;
        grid-row: 1 / 4 !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* Ảnh 3 (Ảnh đầu tiên trong cụm 3 - Đưa xuống dưới bên trái) */
    .gallery-right-bottom-3 img:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 4 / 7 !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* 3. CỘT PHẢI (3 ảnh - Mỗi ảnh chiếm 2 hàng) */

    /* Ảnh 2 (Ảnh top-right) */
    .gallery-right-top img {
        grid-column: 2 !important;
        grid-row: 1 / 3 !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* Ảnh 4 (Ảnh thứ 2 trong cụm 3) */
    .gallery-right-bottom-3 img:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 3 / 5 !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* Ảnh 5 (Ảnh thứ 3 trong cụm 3) */
    .gallery-right-bottom-3 img:nth-child(3) {
        grid-column: 2 !important;
        grid-row: 5 / 7 !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* 4. Điều chỉnh hoạ tiết trang trí bo góc */
    .deco-top-right {
        top: 30px !important; 
        right: 15px !important;
        width: 38% !important; 
        height: 60px !important; 
        border-top-right-radius: 12px !important;
        border-top: 1px solid #374426 !important;
        border-right: 1px solid #374426 !important;
    }

    .deco-bottom-left {
        bottom: 40px !important; 
        left: 15px !important;
        width: 38% !important; 
        height: 60px !important;
        border-bottom-left-radius: 12px !important;
        border-bottom: 1px solid #374426 !important;
        border-left: 1px solid #374426 !important;
    }

    /* 5. Giới hạn chữ & thuyết minh */
    .project-meta-row {
        max-width: 60% !important; 
        margin-top: 15px !important;
        margin-bottom: 25px !important;
        padding-left: 10px !important;
    }

    .meta-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        margin-bottom: 4px !important;
    }

    .meta-subtitle {
        font-size: 20px !important;
        font-weight: 500 !important;
        margin-bottom: 6px !important;
    }

    .project-footer-row {
        display: flex !important;
        justify-content: flex-end !important;
        margin-top: 15px !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .footer-desc-right {
        text-align: right !important;
        width: 100% !important;
        padding-left: 35% !important; 
        margin-top: 15px !important;
        box-sizing: border-box !important;
    }

    .footer-desc-right h4 {
        font-size: 16px !important;
        font-weight: 600 !important;
        margin-bottom: 6px !important;
        text-align: right !important;
    }

    .footer-desc-right p {
        font-size: 13.5px !important;
        line-height: 1.55 !important;
        text-align: right !important;
    }

    .project-slide-wrapper {
        padding: 30px 15px 60px 15px !important; 
    }

    .project-swiper-pagination {
        margin-top: 20px !important;
    }
}