/* General & Body */
body {
    font-family: 'Kanit', sans-serif;
     background-image: url('pic/BG\ about.png'); /* เปลี่ยน 'URL_ของ_รูปภาพ_เมฆ_การ์ตูน.png' เป็นลิงก์ของรูปภาพที่คุณต้องการใช้ */
    background-color: #f0f2f5;
    color: #343a40;
    line-height: 1.7;
    margin: 0;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Minimal Header */
.header-minimal {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 2rem;
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 4rem);
    z-index: 10;
}

/* Hero Section */
.about-hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('pic/aboutpic13.png') no-repeat center center/cover;
    color: #fff;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Content Section (Text & Image) */
.content-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.content-section.reverse-layout {
    direction: rtl;
}

.content-section.reverse-layout > .content-text-block {
    direction: ltr;
}

.content-text-block h2 {
    color: #0d47a1;
    font-size: 2.2rem;
    font-weight: 700;
}

.content-text-block p {
    font-size: 1.1rem;
    text-indent: 2rem;
}

.content-image-block img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Gallery Section */
.gallery-section h2 {
    text-align: center;
    color: #0d47a1;
    margin-bottom: 2rem;
}

.flex-gallery {
    display: flex;
    flex-wrap: wrap; /* ทำให้รูปภาพขึ้นบรรทัดใหม่เมื่อไม่มีพื้นที่พอ */
    gap: 15px; /* ระยะห่างระหว่างรูปภาพ */
    justify-content: center; /* จัดรูปภาพให้อยู่ตรงกลางแนวนอน */
    margin-bottom: 3rem;
}

.gallery-item {
    flex: 1 1 250px; /* ยืดหยุ่นได้และมีขนาดพื้นฐาน 250px */
    height: 200px; /* กำหนดความสูงที่แน่นอนของแต่ละรูปภาพ */
    overflow: hidden; /* ซ่อนส่วนเกินของรูปภาพ */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพเต็มพื้นที่โดยไม่เสียสัดส่วน */
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); /* ขยายรูปภาพเล็กน้อยเมื่อวางเมาส์ */
}


/* Responsive Design */
@media (max-width: 768px) {
    .flex-gallery {
        justify-content: space-around;
    }
    .gallery-item {
        flex: 1 1 150px; /* ปรับขนาดบนมือถือ */
    }
}

/* คลาสสำหรับกำหนดขนาด */
.grid-span-2x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.grid-span-1x2 {
    grid-row: span 2;
}


/* Footer Section */
.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);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-section,
    .content-section.reverse-layout {
        grid-template-columns: 1fr;
        direction: ltr;
    }

    .modern-grid-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    
    .grid-span-2x2, .grid-span-1x2 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .about-hero {
        height: 40vh;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}