/* --- เปลี่ยนแปลงที่ 1: นำเข้าฟอนต์ Sarabun จาก Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;700&display=swap');

/* --- การตั้งค่าพื้นฐานและตัวแปร --- */
:root {
    --primary-color: #1E90FF; /* DodgerBlue */
    --secondary-color: #87CEEB; /* SkyBlue */
    --dark-blue: #00008B; /* DarkBlue */
    --text-color: #333;
    --light-text-color: #fff;
    --bg-light: #f4f8ff;
    --border-radius: 15px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    /* --- เปลี่ยนแปลงที่ 2: ใช้ฟอนต์ Sarabun ทั่วทั้งเว็บ --- */
    font-family: 'Sarabun', sans-serif; 
    line-height: 1.7;
    color: var(--text-color);
    background-color: #effcff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--dark-blue);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* ==================================
   HEADER & NAVIGATION (UPDATED FOR FIX)
   ================================== */
.header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--light-text-color);
    padding: 1rem 0; /* Padding สำหรับจอใหญ่ */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s ease; /* เพิ่ม transition ให้ดูนุ่มนวล */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0; 
}

.logo {
    height: 50px; /* ขนาดโลโก้จอใหญ่ */
    width: 50px;
    margin-right: 15px;
    border-radius: 50%;
    transition: height 0.3s ease, width 0.3s ease; /* เพิ่ม transition */
}

.logo-text {
    color: var(--light-text-color);
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
}

/* Desktop Navigation Styles */
.nav-menu {
    list-style: none;
    display: flex;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--light-text-color);
    text-decoration: none;
    padding: 1rem; 
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
}

.nav-menu a:hover {
    background-color: var(--dark-blue);
}

/* Desktop Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    list-style: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--dark-blue);
}

/* Hamburger Menu Button (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1010; 
}


/* --- Hero Section --- */
.hero-section {
    background-image: url('imags/header.png');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--light-text-color);
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--dark-blue);
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    border: 2px solid var(--secondary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- Content Sections --- */
.content-section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

.full-width-img {
    width: 100%;
    margin-top: 2rem;
}

/* Flex Container for Text/Image */
.flex-container {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.flex-item-text, .flex-item-img {
    flex: 1;
}

.knowledge-item {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
}

.knowledge-item:nth-child(even) {
    flex-direction: row-reverse;
}

.flex-item-img.small-img img {
    max-width: 400px;
}

/* --- Specific Sections --- */

/* Innovations */
.innovation-grid, .innovation-grid-extra {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.innovation-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.innovation-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(30, 144, 255, 0.2);
}

.innovation-card img {
    margin-bottom: 1rem;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.innovation-grid-extra {
    margin-top: 2rem;
}

.innovation-grid-extra img {
    box-shadow: var(--box-shadow);
}

/* Uniforms */
.uniform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.uniform-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 1rem;
}

/* Clients */
.client-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
}

.client-grid img {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: 120px;
    width: auto;
    transition: transform 0.3s;
}

.client-grid img:hover {
    transform: scale(1.1);
}

/* --- Footer --- */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: var(--light-text-color);
    padding: 40px 0 20px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-item h4 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-item p {
    color: #ccc;
    line-height: 1.8;
}

.qr-code {
    border: 3px solid white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a627a;
    color: #ccc;
}

/* ==================================
   RESPONSIVE DESIGN (UPDATED)
   ================================== */

/* Tablet & Smaller Screens */
@media (max-width: 1024px) {
    
    /* --- [FIX] ปรับขนาด Header บนจอเล็ก --- */
    .header {
        padding: 0.5rem 0; /* ลด Padding บน-ล่างของ Header */
    }
    .logo {
        height: 40px; /* ลดขนาดโลโก้ */
        width: 40px;
    }
    .logo-text {
        display: none; 
    }
    /* --- จบส่วนแก้ไขขนาด Header --- */

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: fixed; /* เปลี่ยนเป็น fixed เพื่อให้เต็มจอเสมอ */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(10, 30, 60, 0.98);
        backdrop-filter: blur(8px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: opacity 0.3s ease-in-out;
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        padding: 1.2rem;
        font-size: 1.2rem;
        border-bottom: none; /* ย้ายเส้นคั่นไปที่ li */
    }
    
    .dropdown-menu {
        /* --- [FIX] แก้ไขการแสดงผล Dropdown บนมือถือ --- */
        position: static;
        display: none; /* ซ่อนไว้ก่อนเป็นค่าเริ่มต้น */
        max-height: 0; /* ใช้ max-height เพื่อทำ animation */
        overflow: hidden; /* ซ่อนส่วนที่เกิน */
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        width: 100%;
        border-radius: 0;
        padding-left: 0;
        transition: max-height 0.5s ease-in-out; /* เพิ่ม animation */
    }
    
    .dropdown.is-active > .dropdown-menu {
        display: block; /* แสดงผลเมื่อ active */
        max-height: 500px; /* กำหนดความสูงสูงสุดให้แสดงผลได้ */
    }
    /* --- จบส่วนแก้ไข Dropdown --- */
    
    .dropdown-menu a {
        color: #e0e0e0;
        font-size: 1rem;
        background-color: rgba(0, 0, 0, 0.2);
    }
    
    body.no-scroll {
        overflow: hidden;
    }
}


/* General Responsive Rules (from previous code) */
@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .form-grid {
        grid-template-columns: 1fr; /* เปลี่ยนเป็น 1 คอลัมน์บนมือถือ */
    }
}


```css
/* --- CSS for Application Form --- */
.application-form {
    margin-top: 2rem;
    background-color: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--dark-blue);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
}

.form-submit {
    text-align: center;
    margin-top: 2rem;
}

.btn-submit {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: 'Sarabun', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.btn-submit:hover {
    background-color: var(--dark-blue);
    transform: translateY(-3px);
}

/* Responsive for form */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr; /* เปลี่ยนเป็น 1 คอลัมน์บนมือถือ */
    }
}
/* ==================================
   GALLERY PAGE STYLES
   ================================== */
.gallery-section {
    background-color: var(--bg-light);
}

.album {
    background-color: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 3rem;
}

.album h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.photo-grid {
    display: grid;
    /* สร้าง 2-4 คอลัมน์ตามขนาดหน้าจอ */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.photo-grid a {
    display: block;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
}

.photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    transition: transform 0.4s ease-in-out, filter 0.4s;
}

.photo-grid a:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* เพิ่มไอคอนแว่นขยายเมื่อ hover */
.photo-grid a::after {
    content: '\f00e'; /* Font Awesome search icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: transform 0.4s, opacity 0.4s;
    z-index: 10;
}

.photo-grid a:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}