.elementor-4222 .elementor-element.elementor-element-729af94{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}.elementor-widget-image-gallery .gallery-item .gallery-caption{font-family:var( --e-global-typography-accent-font-family ), Sans-serif;font-weight:var( --e-global-typography-accent-font-weight );}.elementor-4222 .elementor-element.elementor-element-9678644 .gallery-item .gallery-caption{display:none;}/* Start custom CSS for image-gallery, class: .elementor-element-9678644 *//* =========================================================
   1. จัดโครงสร้างแกลเลอรีหลักเป็น Grid 4 คอลัมน์ (สำหรับ Desktop)
   ========================================================= */
.elementor-4222 #gallery-1.gallery {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* แบ่ง master grid เป็น 4 ช่องเท่ากัน */
    grid-gap: 15px !important; /* ระยะห่างระหว่างรูป */
    align-items: start !important;
}

/* เคลียร์ค่าเดิมของ Elementor */
.elementor-4222 #gallery-1 .gallery-item {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}

.elementor-4222 #gallery-1 .gallery-icon,
.elementor-4222 #gallery-1 .gallery-icon a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* จัดรูปแบบรูปภาพให้โค้งมน object-fit และ transition */
.elementor-4222 #gallery-1 .gallery-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* บังคับรูปไม่ให้เบี้ยว โดยการขยายและตัดพอดีกรอบ */
    border-radius: 12px !important; /* มุมโค้งมน */
    border: none !important;
    transition: transform 0.3s ease;
}

/* เอฟเฟกต์ซูมเล็กน้อยเมื่อเอาเมาส์ไปชี้ */
.elementor-4222 #gallery-1 .gallery-icon img:hover {
    transform: scale(1.02);
}

/* =========================================================
   2. จัดวางตำแหน่งแบบ DYNAMIC ตามลำดับรูปในแกลเลอรี
   (คุณต้องเรียงลำดับรูปใน Elementor ให้รูปที่ต้องการใหญ่ที่สุดอยู่ลำดับที่ 1)
   ========================================================= */

/* --- บล็อกโครงสร้าง 5 รูปแรก (1 ใหญ่ + 4 เล็ก) --- */

/* รูปเด่นหลัก ลำดับที่ 1: อยู่ฝั่งซ้าย กว้าง 2 ช่อง สูง 2 แถว */
.elementor-4222 #gallery-1 .gallery-item:nth-child(1) {
    grid-column: 1 / 3 !important;
    grid-row: 1 / 3 !important;
}
.elementor-4222 #gallery-1 .gallery-item:nth-child(1) img {
    height: 520px !important; /* กำหนดความสูงรูปเด่น */
}

/* รูปเล็กบนขวา 1 ลำดับที่ 2 */
.elementor-4222 #gallery-1 .gallery-item:nth-child(2) {
    grid-column: 3 / 4 !important;
    grid-row: 1 / 2 !important;
}
/* รูปเล็กบนขวา 2 ลำดับที่ 3 */
.elementor-4222 #gallery-1 .gallery-item:nth-child(3) {
    grid-column: 4 / 5 !important;
    grid-row: 1 / 2 !important;
}

/* รูปเล็กล่างขวา 1 ลำดับที่ 4 */
.elementor-4222 #gallery-1 .gallery-item:nth-child(4) {
    grid-column: 3 / 4 !important;
    grid-row: 2 / 3 !important;
}
/* รูปเล็กล่างขวา 2 ลำดับที่ 5 */
.elementor-4222 #gallery-1 .gallery-item:nth-child(5) {
    grid-column: 4 / 5 !important;
    grid-row: 2 / 3 !important;
}

/* ล็อกความสูงรูปเล็กทั้ง 4 รูปให้บาลานซ์กับรูปเด่น */
.elementor-4222 #gallery-1 .gallery-item:nth-child(2) img,
.elementor-4222 #gallery-1 .gallery-item:nth-child(3) img,
.elementor-4222 #gallery-1 .gallery-item:nth-child(4) img,
.elementor-4222 #gallery-1 .gallery-item:nth-child(5) img {
    height: 252px !important;
}

/* =========================================================
   3. การจัดการรูปภาพส่วนเกิน (ลำดับที่ 6 เป็นต้นไป)
   ========================================================= */

/* รูปภาพลำดับที่ 6 เป็นต้นไปจะถูกจัดรูปแบบเป็น Grid มาตรฐานต่อท้ายลงมา */
.elementor-4222 #gallery-1 .gallery-item:nth-child(n+6) {
    grid-column: span 1 !important; /* แต่ละรูปกว้าง 1 คอลัมน์มาตรฐาน */
}

/* กำหนดความสูงให้รูปส่วนเกินดูสวยงามและสมดุล (เช่น ให้เป็นสี่เหลี่ยมจัตุรัสตาม standard rows) */
.elementor-4222 #gallery-1 .gallery-item:nth-child(n+6) img {
    height: 252px !important; /* หรือปรับขนาดความสูงที่ต้องการ */
}

/* =========================================================
   4. การแสดงผลบนมือถือ (สลับเป็นแถวเรียงลงมาตามปกติ)
   ========================================================= */
@media (max-width: 767px) {
    .elementor-4222 #gallery-1.gallery {
        grid-template-columns: 1fr !important;
    }
    .elementor-4222 #gallery-1 .gallery-item:nth-child(n) {
        grid-column: auto !important;
        grid-row: auto !important;
    }
    .elementor-4222 #gallery-1 .gallery-icon img {
        height: 250px !important; /* ปรับขนาดความสูงบนมือถือ */
    }
}/* End custom CSS */