
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --black: #333;
    --white: #fff;
    --green: #2D7D46;
    --gray: #555;
}   

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Prompt", sans-serif;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

.hamburger {
    color: var(--black);
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    right: 0;
}

/* Header */

header {
    position: fixed;   /* ทำให้ Header ลอยตามจอ */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;     /* ให้ลอยเหนือเนื้อหาอื่น */
    transition: all 0.3s ease; /* ทำให้การเปลี่ยนสีดูนุ่มนวล */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

/* จัดวางกล่องสลับภาษา */
.lang-switch-item {
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #888;
}

.toggle-switch-container span.active-lang {
    color: #ff9800; /* สีเน้นข้อความภาษาที่เลือกอยู่ (ปรับเปลี่ยนได้ตามธีมเว็บ) */
}

/* ดีไซน์ปุ่ม Toggle Switch แบบในรูป */
.language-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.language-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 22px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

/* เมื่อเลือกภาษาอังกฤษ (Toggle ไปขวา) ปุ่มสลับจะเป็นสีเขียวมะนาว/ส้มตามชอบ */
input:checked + .slider-toggle {
    background-color: #9acd32; /* สีเขียวมะนาวแบบในรูปตัวอย่าง */
}

input:checked + .slider-toggle:before {
    transform: translateX(22px);
}

/* เพิ่ม Padding ให้หน้าเว็บ เพราะเมื่อ Header ลอยตัว เนื้อหาข้างบนจะโดนบัง */
body {
    padding-top: 100px; /* ให้เท่ากับความสูงของ header เดิม */
}

header nav .nav-wrapper {
    position: relative;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 24px;
    color: var(--green); 
}

header .menu {
    display: flex;
    list-style: none;
}

.menu li {
    position: relative; 
}

header .menu li a {
    margin-left: 40px;
    text-decoration: none;
    font-weight: 400; 
    color: var(--gray);      
    transition: 0.3s;
}

header .menu li a.active, 
header .menu li a:hover {
    color: #2D7D46;
    font-weight: 600;
}

.dropdown-content {
    display: none;          
    position: absolute;     
    top: 100%;              
    left: 0;
    background-color: var(--white);
    min-width: 250px;       
    box-shadow: 0px 8px 16px rgba(0,0,0,0.1); 
    z-index: 999;           
    list-style: none;
    padding: 10px 0;
    border-radius: 0 0 8px 8px; 
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    margin-left: 0 !important; 
    transition: background 0.3s;
}

.dropdown-content li a:hover {
    background-color: #f1f1f1;
    color: var(--green); 
}

.menu li:hover .dropdown-content {
    display: block;
}

header .menu li a[href="form-login.php"] {
    background-color: var(--green);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 20px;
    margin-left: 20px;
}

header .menu li a[href="form-login.php"]:hover {
    background-color: #1e5a32;
    color: var(--white);
}

@media screen and (min-width: 842px) {
    .hamburger {
        display: none; 
    }
}

@media screen and (max-width: 842px) {
    header {
        height: auto;
        padding: 0.25rem 0;
    }

    header nav {
        margin: 0 1rem;
    }

    header nav .nav-wrapper {
        flex-direction: column;
        align-items: flex-start;
        margin: 1rem 0;
        height: auto;
    }

    header .menu {
        display: none; 
        flex-direction: column;
        width: 100%;
    }

    header .menu.show {
        display: flex;
    }

    header .menu li {
        margin-left: 0;
        margin-top: 1.5rem;
    }

    header .menu li a {
        margin-left: 0;
    }
}

/* Slider Container */
.slider-container { 
    position: relative; 
    width: 100%; 
    height: 600px; /* ปรับความสูงตามต้องการ */
    overflow: hidden; 
    margin-top: 0; /* ระยะห่างจาก Header */
}

.slider { 
    display: flex; 
    height: 100%;
    transition: transform 0.5s ease-in-out; 
}

.slide { 
    position: relative;
    min-width: 100%; 
    height: 100%;
}

.slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* ทำให้รูปเต็มพื้นที่โดยไม่ผิดสัดส่วน */
}

/* ปุ่มควบคุม */
.prev, .next { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0,0,0,0.3); 
    color: white; 
    border: none; 
    padding: 20px; 
    cursor: pointer; 
    z-index: 10;
    font-size: 20px;
}
.prev { left: 20px; } 
.next { right: 20px; }

.prev:hover, .next:hover { background: rgba(0,0,0,0.6); }

/* ส่วนของข้อความ */
.caption {
    position: absolute; /* ลอยอยู่เหนือรูปภาพ */
    top: 50%;           /* ขยับลงมา 50% ของความสูง */
    left: 50%;          /* ขยับมาทางขวา 50% ของความกว้าง */
    transform: translate(-50%, -50%); /* ดึงกลับมาให้อยู่จุดศูนย์กลางที่แท้จริง */
    text-align: center;
    color: white;
    width: 80%;         /* กำหนดความกว้างเพื่อไม่ให้ข้อความยาวเกินไป */
    z-index: 5;         /* ให้ลอยอยู่เหนือรูปภาพ */
    text-shadow: 0 2px 5px rgba(0,0,0,0.5); /* เพิ่มเงาให้ข้อความอ่านง่ายขึ้น */
}

/* ตกแต่งข้อความ */
.caption h1 { 
    font-size: clamp(2rem, 10vw, 4rem);
    line-height: 1.2;
    margin-bottom: 20px;
    text-align: center; 
}

.caption p { 
    font-size: clamp(0.5rem, 10vw, 1.5rem);
    margin-bottom: 40px;
    font-weight: 300;
    text-align: center;
}

.caption-btn{
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ================= Hero Buttons ================= */
.btn-primary {
    position: relative;
    padding: 15px 40px;
    background: #ff9800;
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.7);
}

.btn-secondary {
    position: relative;
    padding: 15px 40px;
    background: linear-gradient(135deg, #0056b3, #003d82);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.4);
    z-index: 1;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.75);
}

/* Shimmer Light Effect สำหรับทั้งสองปุ่ม */
.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 80%
    );
    transform: rotate(25deg);
    transition: all 0.75s ease-in-out;
    z-index: 2;
    pointer-events: none;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
    left: 125%;
}

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.slide::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* ความมืด 40% */
    z-index: 1;
}

/* Main */

main {
    /* ใส่ Overlay สีดำจางๆ หรือสีเขียวจางๆ ทับบนรูปภาพ */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('../img/main-bg.png');
    
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    padding: 40px 0;
}

/* กรอบใหญ่สุด */
.main-knowledge-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px; /* เพิ่มความโค้งมนให้ดูทันสมัยขึ้น */
    border: 1px solid rgba(0,0,0,0.05); /* เส้นขอบบางๆ เพื่อความสะอาดตา */
    /* เพิ่มเงาที่นุ่มนวล */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); 
    margin: 40px 0;
}

/* ส่วนหัวข้อและปุ่มดูทั้งหมด */
.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.knowledge-header h2 { color: var(--green); }
.view-all { color: var(--green); text-decoration: none; font-weight: 600; }

/* Grid ของ 3 กรอบย่อย */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* กรอบย่อยแต่ละอัน */
.knowledge-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.4s ease; /* ทำให้การแสดงผลเงาดูสมูท */
}

.knowledge-card .img-box {
    overflow: hidden;
    border-radius: 8px;
}

.knowledge-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.5s ease;
}


.knowledge-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--black);
}

.read-more {
    color: var(--green);
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}

/* เมื่อเอาเมาส์ไปวาง ให้กรอบลอยขึ้นและเงาชัดขึ้น */
.knowledge-card:hover {
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px); /* เลื่อนตัวขึ้นเล็กน้อย */
}

.knowledge-card:hover img {
    transform: scale(1.08); /* รูปขยายใหญ่อย่างนุ่มนวล */
}

/* ================= Video Cards & Overlay Play Button ================= */
.video-card .video-thumb-box {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-card .video-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-bottom: 0;
    transition: transform 0.4s ease;
}

.video-card:hover .video-thumb-box img {
    transform: scale(1.08); /* เอฟเฟกต์ซูมรูปเล็กน้อยเมื่อชี้เมาส์ */
}

/* ปุ่ม Play ลอยบนรูป */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    background: rgba(45, 125, 70, 0.9); /* สีเขียวหลัก */
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    padding-left: 3px; /* ดึงไอคอน Play ให้อยู่จุดศูนย์กลาง */
}

.video-card:hover .play-btn {
    background: #ff9800; /* เปลี่ยนเป็นสีส้มเมื่อ Hover */
    transform: translate(-50%, -50%) scale(1.15);
}

.btn-play-text {
    background: transparent;
    border: none;
    color: var(--green);
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: color 0.3s ease;
}

.btn-play-text:hover {
    color: #ff9800;
}

/* ================= Modal Video Popup ================= */
.video-modal {
    display: none; /* ซ่อนไว้เป็นค่าเริ่มต้น */
    position: fixed;
    z-index: 2000; /* อยู่เหนือ Header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* พื้นหลังมืดซูมลึก */
    backdrop-filter: blur(5px); /* ทำให้พื้นหลังเบลอ */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.show {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 850px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff9800;
}

/* รักษาสัดส่วนวิดีโอ 16:9 แบบ Responsive */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* สัดส่วน 16:9 */
    height: 0;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* นำไปปรับใช้กับกล่องข้อความหรือ Card */
.glass-box {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.floating-qr {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--green);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s ease;
}

.floating-qr:hover {
    transform: scale(1.08);
    background: #1e5a32;
}


/* ปรับให้เรียงลงมาในมือถือ */
@media screen and (max-width: 768px) {
    .knowledge-grid { grid-template-columns: 1fr; }
}

/* คลาสสำหรับส่วนที่ยังไม่โชว์ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

/* คลาสเมื่อเลื่อนมาถึง */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.news-card:nth-child(2) { transition-delay: 0.2s; }
.news-card:nth-child(3) { transition-delay: 0.4s; }

/* ================= Footer Style ================= */

footer {
    padding: 50px 0 0 0;
    background: #17512d; /* สีเขียวเข้มประจำธีม */
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* แบ่งฝั่งแผนที่และข้อมูลติดต่อ 50/50 */
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h3 i {
    color: #ff9800; /* ไอคอนหัวข้อสีส้มไฮไลท์ */
}

/* กรอบครอบแผนที่ Google Maps */
.map-placeholder {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.map-placeholder iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 15px;
    display: block;
}

/* รายการข้อมูลติดต่อ */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
    font-size: 0.95rem;
}

.contact-info li i {
    margin-right: 12px;
    margin-top: 4px;
    color: #ff9800;
    font-size: 1.1rem;
    width: 20px; /* ล็อคความกว้างเพื่อให้ข้อความเริ่มต้นตรงกันทุกบรรทัด */
    text-align: center;
    flex-shrink: 0;
}

/* ปุ่ม Social Media */
.footer-social {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: #ff9800;
    transform: translateY(-3px);
}

/* แถบ Copyright ด้านล่างสุด */
.footer-bottom {
    margin-top: 40px;
    background: #0f381f; /* สีเขียวเข้มพิเศษแยกส่วนชัดเจน */
    padding: 15px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive สำหรับหน้าจอมือถือ */
@media screen and (max-width: 768px) {
    footer {
        padding: 40px 0 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr; /* เรียงเป็นแนวตั้งบนมือถือ */
        gap: 30px;
    }

    .footer-bottom {
        margin-top: 30px;
    }
}

/* ปรับแต่งสำหรับมือถือ (ให้เรียงลงมา) */
@media screen and (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* About Page Styles */
/* ================= About Hero: Glassmorphism ================= */

.about-hero {
    height: 450px;
    background: linear-gradient(135deg, rgba(23, 81, 45, 0.7), rgba(15, 56, 31, 0.8)), 
                url('../img/bander-about.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

/* การ์ดกระจกฝ้าซ้อนข้างใน */
.about-hero .container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 50px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    text-align: center;
}

.about-hero h1 {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 700;
}

.about-hero p {
    font-size: 1.2rem;
    color: #f0f0f0;
    font-weight: 300;
}

.about-content {
    padding: 80px 20px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    color: var(--green);
    margin-bottom: 20px;
    border-left: 5px solid #ff9800;
    padding-left: 15px;
}

.about-text p {
    color: var(--gray);
    line-height: 1.8;
}

.about-image img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* การจัดวางกรอบ */
/* 1. คลาสสำหรับเซกชันเต็มจอ (ย้ายรูปพื้นหลังมาไว้ตรงนี้) */
.about-section {
    width: 100%;
    padding: 80px 0;
    
    /* ใส่ภาพพื้นหลังเต็มจอ พร้อม overlay สีขาวจางๆ ให้อ่านง่าย */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                      url('../img/bander-about.jpg'); /* ใส่ path รูปภาพสวนส้มโอของคุณ */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed; /* (Optional) เลื่อนหน้าจอแล้วรูปนิ่งแบบ Parallax */
}

/* 2. คลาสสำหรับคุมความกว้างการ์ดให้อยู่ตรงกลาง */
.about-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px; /* คุมความกว้างการ์ดไม่ให้แผ่กว้างเกินไป */
    margin: 0 auto;
}

.about-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); /* เงาจางๆ ให้ดูมีมิติ */
    border-left: 8px solid var(--green); /* ขอบซ้ายเป็นสีเขียวประจำธีม */
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px); /* ขยับขึ้นเมื่อเอาเมาส์ไปชี้ */
}

.about-card .card-icon {
    font-size: 2rem;
    color: var(--green);
    margin-bottom: 15px;
}

.about-card h2 {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 15px;
}

.about-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray);
}

/* กำหนดรูปภาพพื้นหลังให้ครอบคลุมทั้งเซกชันใหญ่ */
/* เซกชันหลักสำหรับหน้า About แบบ Split (ใส่รูปพื้นหลังและ Overlay) */
.about-section-split {
    width: 100%;
    padding: 20px 0 30px 0;
    
    /* ใส่รูปภาพพื้นหลัง พร้อมทำ Overlay สีขาวโปร่งแสง 85% ทับเพื่อให้ตัวหนังสืออ่านง่าย */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                      url('../img/bander-about.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed; /* เอฟเฟกต์ภาพนิ่งเวลาเลื่อนหน้าจอ (Parallax) */
}

/* จัดการโครงสร้างใหม่ในกรอบ */
.card-wrapper {
    display: flex;
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    gap: 30px; /* ระยะห่างระหว่างข้อความกับรูป */
}

.card-text {
    flex: 2; /* ให้ข้อความกินพื้นที่มากกว่า */
}

.card-image {
    flex: 1; /* ให้รูปกินพื้นที่น้อยกว่า */
}

.card-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* จัดโครงสร้างภาพรวมหน้า Split Section */
/* ================= About Split Section (Option 3: CSS Grid) ================= */

.about-split-container {
    display: grid;
    /* แบ่งเป็น 2 คอลัมน์: ฝั่งซ้าย 40% (รูป), ฝั่งขวา 60% (เนื้อหา) */
    grid-template-columns: 4fr 6fr; 
    gap: 30px;
    align-items: start; /* ให้กล่องเริ่มจัดตำแหน่งจากด้านบนสุด */
    padding: 40px 0;
}

/* ฝั่งซ้าย: Infographic แบบ Sticky */
.about-infographic-sticky {
    position: sticky;
    top: 120px; /* ระยะห่างจาก Header ด้านบนเมื่อ scroll ลงมา */
    width: 100%;
}

.infographic-box {
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

.infographic-box img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    object-fit: cover;
}

.infographic-caption {
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
}

/* ฝั่งขวา: กล่องการ์ดข้อความ */
.about-text-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px; /* ระยะห่างระหว่างการ์ด */
    width: 100%;
}

.text-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-left: 6px solid var(--green); /* แถบสีเขียวประจำธีม */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.text-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(45, 125, 70, 0.15);
}

.text-card h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--black);
}

.text-card p {
    color: var(--gray);
    line-height: 1.7;
    font-size: 0.98rem;
}

/* Responsive สำหรับมือถือและแท็บเล็ต (หน้าจอ < 992px) */
@media screen and (max-width: 992px) {
    .about-split-container {
        /* ยุบคอลัมน์ลงมาเป็น 1 คอลัมน์แนวตั้ง */
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-infographic-sticky {
        position: relative; /* ปิดการ Sticky เมื่อแสดงบนมือถือ */
        top: 0;
    }
}

/* ปรับให้แสดงผลสวยงามบนมือถือ */
@media (max-width: 768px) {
    .card-wrapper {
        flex-direction: column; /* เปลี่ยนเป็นแนวตั้งเมื่อจอเล็ก */
        text-align: center;
    }
}

/* ปรับแต่งสำหรับมือถือ */
@media screen and (max-width: 842px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

/* ทำให้การ์ดเลขคู่ สลับฝั่งอัตโนมัติ (ซ้ายเป็นข้อความ, ขวาเป็นรูป/Infographic) */
@media screen and (min-width: 769px) {
    .about-card:nth-child(even) .card-wrapper {
        flex-direction: row-reverse;
    }
}

/* ================= Image Lightbox / Modal with Zoom Controls ================= */
.infographic-box.clickable {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.infographic-box.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.img-modal {
    display: none; 
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.img-modal.show {
    display: flex;
    opacity: 1;
}

/* แถบปุ่มกดควบคุมลอยด้านบน */
.img-modal-controls {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3010;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: #ff9800;
    color: #ffffff;
    transform: scale(1.1);
}

.close-img-modal {
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: 8px;
    transition: color 0.2s;
}

.close-img-modal:hover {
    color: #ff9800;
}

/* กรอบรูปภาพรองรับการลาก & ย่อขยาย */
.img-modal-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.img-modal-wrapper:active {
    cursor: grabbing;
}

.img-modal-content {
    max-width: 85%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: transform 0.15s ease-out;
    user-select: none;
}

/* ================= Contact Page Styles ================= */
.contact-hero {
    height: 400px;
    background: linear-gradient(rgba(45, 125, 70, 0.8), rgba(45, 125, 70, 0.8)), url('../img/contact-bg.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.contact-hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.contact-hero p {
    font-size: 1.2rem;
    font-weight: 300;
}

.contact-section {
    padding: 80px 20px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
}

/* ฝั่งซ้าย: Info */
.contact-info h2, .contact-form-box h2 {
    color: var(--green);
    margin-bottom: 25px;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
}

.contact-info h2::after, .contact-form-box h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background-color: #ff9800; /* สีส้มไฮไลท์ประจำเว็บ */
    border-radius: 2px;
}

.info-desc {
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 35px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.info-item i {
    font-size: 1.5rem;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    padding: 15px;
    border-radius: 50%;
    margin-right: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-item h3 {
    font-size: 1.1rem;
    color: var(--black);
    margin-bottom: 5px;
}

.info-item p {
    color: var(--gray);
    font-size: 1rem;
}

/* ฝั่งขวา: Form */
.contact-form-box {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--black);
    font-weight: 500;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 125, 70, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background-color: #1e5a32;
}

/* Responsive สำหรับมือถือ */
@media screen and (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-form-box {
        padding: 30px 20px;
    }
}

/* สำหรับหน้า content-all.php */
/* สไตล์กล่องหลัก */
.box-section {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* ส่วนที่ 1: หัวข้อ */
.header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.count-badge {
    background: var(--green);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ส่วนที่ 2: ช่องค้นหา */
.search-box form {
    display: flex;
    gap: 10px;
}
.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.search-box button {
    padding: 10px 25px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* ส่วนที่ 3: รายการ */
.news-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.news-item img {
    width: 120px; height: 80px; object-fit: cover; border-radius: 8px; margin-right: 20px;
}
.news-info h3 { color: #333; }
.news-info .read-more { color: var(--green); text-decoration: none; font-size: 0.9rem; }

/* form-login */
/* จัดพื้นหลังและกึ่งกลาง */
.login-page {
    background-color: #f4f7f6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 { color: var(--green); margin-bottom: 20px; }

/* กล่อง input */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box; /* สำคัญมากเพื่อไม่ให้ input เกินขอบ */
}

/* ปุ่มกด */
.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.login-btn:hover { background: #236638; }

.login-footer { margin-top: 15px; font-size: 0.9rem; }
.login-footer a { color: var(--green); text-decoration: none; }

/* ================= Mobile Specific Fixes ================= */
@media screen and (max-width: 768px) {
    /* 1. ปรับแต่ง Header & Hamburger ให้ไม่ทับ Logo */
    header nav .nav-wrapper {
        position: relative;
        justify-content: space-between;
    }
    
    .hamburger {
        top: 50% !important;
        transform: translateY(-50%);
        right: 15px !important;
    }

    /* 2. ปรับขนาด Slider & Caption บนมือถือ */
    .slider-container {
        height: 450px; /* ลดความสูงของ Banner ลงในมือถือ */
    }

    .caption {
        width: 90%;
    }

    .caption h1 {
        font-size: 1.5rem !important; /* ปรับขนาดหัวข้อให้พอดี */
        margin-bottom: 10px;
    }

    .caption p {
        font-size: 0.85rem !important;
        margin-bottom: 20px;
    }

    .caption-btn {
        flex-direction: column; /* ให้ปุ่มเรียงเป็นแนวตั้งบนมือถือ */
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.95rem;
        width: 100%;
    }

    /* ปุ่มเลื่อนสไลด์ย่อขนาด */
    .prev, .next {
        padding: 10px 15px;
        font-size: 16px;
    }

    /* 3. ปรับแต่ง Floating QR บนมือถือ */
    .floating-qr {
        bottom: 15px;
        right: 15px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .floating-qr i {
        font-size: 1rem;
    }

    /* 4. ปรับขนาด Modal Popup บนมือถือ */
    .video-modal-content {
        width: 95%;
    }

    .close-modal {
        top: -35px;
        right: 5px;
        font-size: 30px;
    }
}

.content-all-main {
    padding: 40px 0;
    /* ใส่ Linear-gradient ซ้อนทับรูป 85% เพื่อให้อ่านข้อความง่าย */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                      url('../img/content-all-background.png'); 
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed; /* (Optional) เพิ่มลูกเล่น Parallax ตอนเลื่อนจอ */
}

/* ==========================================
   Knowledge Detail Pages & Infographic Styles
   ========================================== */
:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --accent-color: #e8f5e9;
    --text-dark: #2c3e50;
    --bg-light: #f9fbf9;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.page-header {
    background: linear-gradient(rgba(46, 125, 50, 0.85), rgba(27, 94, 32, 0.9)), url('../img/main-bg.png') center/cover;
    color: #fff;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 0px;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.breadcrumb {
    font-size: 0.95rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: #a5d6a7;
    text-decoration: none;
}

.content-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Infographic Section */
.infographic-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 50px;
    border: 1px solid #e0e0e0;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    border-left: 5px solid var(--primary-light);
    padding-left: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.infographic-box {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f4f4;
    text-align: center;
    border: 2px dashed #a5d6a7;
    padding: 15px;
    transition: all 0.3s ease;
}

.infographic-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.15);
}

.infographic-box {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f4f4;
    text-align: center;
    border: 2px dashed #a5d6a7;
    padding: 15px;
    transition: all 0.3s ease;
    
    max-width: 800px; /* กำหนดความกว้างสูงสุดของกล่อง (ปรับเพิ่ม/ลดได้) */
    margin: 0 auto;   /* จัดกล่องให้อยู่ตรงกลาง */
}

.infographic-img:hover {
    transform: scale(1.01);
}

.infographic-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn-zoom {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-zoom:hover {
    background-color: #1b5e20;
}

.btn-download {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-download:hover {
    background-color: var(--accent-color);
}

/* Steps Cards Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.step-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-number {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    margin-bottom: 15px;
}

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.step-card p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* Modal Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 768px) {
    .page-header h1 { font-size: 1.6rem; }
    .infographic-actions { flex-direction: column; }
}

