.elementor-4274 .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-4274 .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)
   [แก้ไข: ลบ #gallery-1 ออกเพื่อป้องกันบัคเมื่ออยู่หน้าเดียวกัน]
   ========================================================= */
.elementor-4274 .gallery {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* แบ่ง master grid เป็น 4 ช่อง */
    grid-gap: 15px !important; /* ระยะห่างระหว่างรูป */
    align-items: start !important;
}

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

/* 🌟 ตัวแก้บั๊ก 1: ปิดการทำงานของ <br> ที่ WP ชอบแอบใส่มาพัง Grid */
.elementor-4274 .gallery br {
    display: none !important; 
}

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

/* จัดรูปแบบรูปภาพให้โค้งมน และตั้ง object-fit */
.elementor-4274 .gallery .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-4274 .gallery .gallery-icon img:hover {
    transform: scale(1.02);
}

/* =========================================================
   2. จัดวางตำแหน่งและ "ความสูง" 
   🌟 ตัวแก้บั๊ก 2: ย้ายมากำหนดความสูงที่กล่อง Item แทนรูปภาพ
   ========================================================= */

/* รูปเด่นหลัก ลำดับที่ 1 (กว้าง 2 ช่อง สูง 2 แถว) */
.elementor-4274 .gallery .gallery-item:nth-child(1) {
    grid-column: 1 / 3 !important;
    grid-row: 1 / 3 !important;
    height: 519px !important; /* ปรับให้พอดีกับรูปรอง (252+252+ช่องไฟ 15 = 519) */
}

/* รูปเล็กลำดับที่ 2 ถึง 5 */
.elementor-4274 .gallery .gallery-item:nth-child(2) {
    grid-column: 3 / 4 !important;
    grid-row: 1 / 2 !important;
    height: 252px !important;
}
.elementor-4274 .gallery .gallery-item:nth-child(3) {
    grid-column: 4 / 5 !important;
    grid-row: 1 / 2 !important;
    height: 252px !important;
}
.elementor-4274 .gallery .gallery-item:nth-child(4) {
    grid-column: 3 / 4 !important;
    grid-row: 2 / 3 !important;
    height: 252px !important;
}
.elementor-4274 .gallery .gallery-item:nth-child(5) {
    grid-column: 4 / 5 !important;
    grid-row: 2 / 3 !important;
    height: 252px !important;
}

/* =========================================================
   3. การจัดการรูปภาพส่วนเกิน (ลำดับที่ 6 เป็นต้นไป)
   ========================================================= */
.elementor-4274 .gallery .gallery-item:nth-child(n+6) {
    grid-column: span 1 !important;
    height: 252px !important; /* ปรับความสูงรูปส่วนเกินให้เท่ารูปเล็ก */
}

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