/* --- Google Font --- */
@import url('/npm/@fontsource/prompt/index.css');

/* --- CSS Variables (ตัวแปรสี) --- */
:root {
    --primary-color: #41826e; /* สีเขียวตุ่นๆ */
    --white-color: #ffffff;
    --dark-grey-color: #333333; /* สีตัวอักษรหลัก */
    --light-grey-color: #f4f7f6; /* สีพื้นหลังสลับ */
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* กันเมนูบังหัวข้อตอนกดลิงก์ */
}

body {
    font-family: 'Prompt', sans-serif;
    line-height: 1.7;
    color: var(--dark-grey-color);
    background-color: var(--white-color);
    padding-top: 80px;
}

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

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--primary-color); margin-bottom: 1rem; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; }
.section-bg { background-color: var(--light-grey-color); }
section { padding: 80px 0; }
a { text-decoration: none; }

/* --- Header & Navbar --- */
.header {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo img { height: 50px; }
.nav-menu { display: flex; list-style: none; gap: 30px; }
.nav-link { text-decoration: none; color: var(--dark-grey-color); font-weight: 400; transition: color 0.3s ease; }
.nav-link:hover { color: var(--primary-color); }
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--dark-grey-color); transition: all 0.3s ease-in-out; }

/* --- Hero Section --- */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 500%;
    height: 100%;
    display: flex;
    transition: transform 0.8s ease-in-out;
    z-index: 1;
}

.slide {
    width: 20%;
    height: 100vh;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--white-color);
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #356a5a;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--white-color);
}

/* --- Services Section --- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.service-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.service-item { background: var(--white-color); padding: 2rem; border-radius: 10px; box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; }
.service-item:hover { transform: translateY(-10px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.service-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }

/*
===============================================
  ACCORDION STYLES (สำหรับหน้า missions.html)
===============================================
*/

.accordion {
    max-width: 800px;
    margin: 0 auto; /* จัดให้อยู่กลางจอ */
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}
.accordion-item:first-child {
    border-top: 1px solid var(--border-color);
}

.accordion-header {
    background-color: transparent;
    border: none;
    width: 100%;
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-grey-color);
    transition: background-color 0.3s ease;
    font-family: 'Prompt', sans-serif;
}

.accordion-header:hover, .accordion-item.active .accordion-header {
    background-color: var(--light-grey-color);
    color: var(--primary-color);
}

.accordion-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.3s ease-in-out;
    flex-shrink: 0; /* ป้องกันไอคอนถูกบีบ */
    margin-left: 1rem;
}

.accordion-item.active .accordion-header .accordion-icon {
    transform: rotate(45deg);
}

.accordion-panel {
    max-height: 0; /* ซ่อนเนื้อหาไว้ตอนแรก */
    overflow: hidden;
    background-color: var(--white-color);
    transition: max-height 0.4s ease-out, padding 0.4s ease-out; /* เพิ่ม padding transition */
    padding: 0 2rem; /* เพิ่ม padding ซ้ายขวา แต่บนล่างเป็น 0 */
}

.accordion-item.active .accordion-panel {
    padding: 1.5rem 2rem; /* เพิ่ม padding บนล่างเมื่อเปิด */
}


.accordion-content {
    color: #555;
}

.accordion-content p, .accordion-content ul {
    margin-bottom: 1rem;
}

.accordion-content ul {
    list-style-type: disc;
    padding-left: 25px; /* เพิ่มระยะห่างให้ list */
}

.accordion-content li {
    margin-bottom: 0.8rem;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
}


/* --- Footer Section --- */
.footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 50px 0 0;
}

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

.footer h4 {
    margin-bottom: 1rem;
    color: var(--white-color);
    font-size: 1.2rem;
}

.footer p, .footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--white-color);
}

.footer ul {
    list-style: none;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/*
=====================================
  ANIMATION & RESPONSIVE STYLES
=====================================
*/

/* --- Fade-in Animation on Scroll --- */
.section-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive (for Mobile) --- */
@media (max-width: 768px) {
    /* -- Hamburger Menu -- */
    .hamburger {
        display: block; /* แสดงปุ่ม Hamburger ในมือถือ */
    }

    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    
    .nav-menu {
        position: fixed;
        left: -100%; /* ซ่อนเมนูไปทางซ้าย */
        top: 80px;
        flex-direction: column;
        background-color: var(--white-color);
        width: 100%;
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        left: 0; /* แสดงเมนูเมื่อกด */
    }

    .nav-menu li {
        padding: 1rem 0;
    }

    /* -- General Layout Adjustments -- */
    section { padding: 60px 0; }
    .hero-title { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    
    /* -- Page-specific Adjustments -- */
    .about-container {
        flex-direction: column;
        text-align: center; /* จัดกลางให้สวยงาม */
    }
    .about-image { margin-bottom: 2rem; }

    .services-grid, .news-grid {
        grid-template-columns: 1fr; /* ให้แสดงแค่ 1 คอลัมน์ในมือถือ */
    }
    
    .accordion-header {
        font-size: 1rem;
        padding: 1.2rem 0.8rem;
    }

    .accordion-panel {
        padding: 0 1rem; /* ลด padding ซ้ายขวาในมือถือ */
    }
    .accordion-item.active .accordion-panel {
        padding: 1rem;
    }
    
    .footer-container {
        text-align: center;
    }
}

/* --- Page Header (แถบหัวข้อสีเขียว) --- */
.page-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 40px 0;
    text-align: center;
}

.page-header h1 {
    color: var(--white-color);
    font-size: 2.5rem;
}

.page-header p {
    font-size: 1.1rem;
    font-weight: 300;
}