/* General Body & Layout */
body {
    font-family: 'Kanit', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.page-header {
    text-align: center; /* ทำให้ข้อความและองค์ประกอบ inline อยู่ตรงกลาง */
    padding: 30px 20px;
    background-color: #0d47a1; /* Deep blue */
    color: #fff;
    position: relative; /* สำคัญมาก! เพื่อให้ .back-to-home-button อ้างอิงตำแหน่งกับ header */
}

.page-header h1 {
    margin: 0;
    font-size: 2.5rem;
}
.contact-main {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Contact Details Section */
.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 40px;
}

.contact-info-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 1 1 200px; /* Adjust card size */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.contact-info-card i {
    font-size: 2.5rem;
    color: #ffc107; /* Amber/gold */
    margin-bottom: 15px;
}

.contact-info-card h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #0d47a1;
}

.contact-info-card a {
    color: #0d47a1;
    text-decoration: none;
}

/* Map & Social Sections */
.contact-map, .contact-social, .image-gallery-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.contact-map h2, .contact-social h2, .image-gallery-section h2 {
    text-align: center;
    color: #0d47a1;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.social-icons {
    text-align: center;
    font-size: 2rem;
}

.social-icons a {
    color: #333;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.social-icons a.fab.fa-facebook-f:hover {
    color: #1877f2; /* Facebook blue */
}

.social-icons a.fab.fa-youtube:hover {
    color: #ff0000; /* YouTube red */
}

/* Image Gallery Section */
.image-gallery-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.image-gallery-section h2 {
    text-align: center;
    color: #0d47a1;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.image-gallery {
    /* ใช้ Grid Layout ที่ยืดหยุ่นมากขึ้น */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* <-- ปรับความกว้างขั้นต่ำของรูปภาพ */
    grid-auto-rows: 250px; /* <-- ปรับความสูงของแถวให้ใหญ่ขึ้น */
    gap: 15px;
}

.image-gallery img {
    width: 100%;
    height: 100%; /* <-- ทำให้ภาพเต็มกรอบที่กำหนดไว้ */
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
}
/* ซ่อนปุ่มบนหน้าจอคอมพิวเตอร์ */
.mobile-home-button {
    display: none; 
}


/* สำหรับหน้าจอมือถือ (ไม่เกิน 768px) */
@media (max-width: 768px) {
    .mobile-home-button {
        display: flex !important; /* บังคับให้แสดงปุ่มในมือถือ */
        position: fixed; /* ตรึงปุ่มให้อยู่กับที่ */
        bottom: 20px; /* เว้นระยะห่างจากขอบล่าง 20px */
        left: 50%; /* จัดตำแหน่งกึ่งกลางแนวนอน */
        transform: translateX(-50%); /* ปรับตำแหน่งให้สมบูรณ์ */
        z-index: 1000; /* ทำให้ปุ่มอยู่บนสุดของเนื้อหา */
        
        /* สไตล์ปุ่ม */
        background-color: #2a466d;
        color: white;
        padding: 12px 24px;
        border-radius: 50px;
        text-decoration: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
        font-family: 'Kanit', sans-serif;
    }
}
/* จัดการ container หลัก */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    
}

.footer-button {
    color: #fff;
    background-color: #0d47a1;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-block;
}

.footer-button:hover {
    background-color: #002d73;
    transform: translateY(-3px);
}