:root {
    --primary-blue: #000000;
    --accent-yellow: #FFCA61;
    --text-dark: #333;
    --bg-light: #ffdc97;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}
/* 1. ตั้งค่าตัวคลุมทั้งหมดให้รองรับการ Snap */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ถ้าคุณใช้ container คลุม ให้ใส่ค่าเหล่านี้ */
body {
    scroll-snap-type: y mandatory; /* บังคับให้ล็อคในแนวแกน Y */
    overflow-y: scroll;
    height: 100vh;
}

/* 2. ตั้งค่าให้ทุก Section มีขนาดพอดีหน้าจอ */
.snap-section {
    height: 100vh;            /* บังคับสูงเท่าหน้าจอพอดี */
    width: 100%;             /* กว้างเต็มหน้าจอ */
    scroll-snap-align: start; /* ให้ขอบบนของ section ล็อคกับขอบหน้าจอ */
    scroll-snap-stop: always; /* บังคับให้หยุดทุกครั้งที่เลื่อน (เหมือน TikTok) */
    
    /* จัดเนื้อหาให้อยู่กลางหน้าจอเสมอ */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;         /* ป้องกันเนื้อหาล้นออกมานอกหน้าจอ */
}
body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto; /* ไม่ต้องกำหนดความสูงตายตัว */
    background: transparent !important; /* ทำให้พื้นหลังโปร่งใส */
    box-shadow: none !important;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 1000;
}

/* สร้างลักษณะวงกลม/ครึ่งวงกลมที่มุม */
.nav-circle {
    position: fixed;
    top: 0;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* ดันให้อยู่ชั้นบนสุดของทุกอย่าง */
    cursor: pointer; /* เปลี่ยนเมาส์เป็นรูปมือเมื่อชี้ */
    pointer-events: auto; /* มั่นใจว่าคลิกติดแน่นอน */
}

/* ตกแต่งมุมซ้าย (โลโก้) */
.nav-circle.left {
    border-radius: 0 0 50px 0; /* ทำเป็นโค้ง 1 ใน 4 หรือครึ่งวงกลมตามมุม */
    position: fixed;
    top: 0;
    left: 0;
}

.nav-circle.left img {
    height: 45px;
    margin-right: 10px;
    margin-bottom: 10px;
}


.nav-circle.left {
    position: fixed;
    top: 0;
    left: 0;
    width: 0px; /* ปรับจาก 0px เป็น 120px */
    height: 0px;
    background: var(--accent-yellow);
    /* ... โค้ดส่วนที่เหลือ ... */
}

/* ตกแต่งมุมขวา (ปุ่มเมนู) */
.nav-circle.right {
    border-radius: 0 0 0 50px;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1002; /* เพิ่ม z-index ให้สูงกว่าเพื่อน */
    font-size: 24px;
    color: var(--primary-blue);
    pointer-events: auto;
}
/* ค้นหาหรือเพิ่มส่วนนี้ */
.nav-circle img {
    width: 70%; /* ปรับเปอร์เซ็นต์เพื่อให้รูปเล็กลงหรือใหญ่ขึ้นเมื่อเทียบกับวงกลม */
    height: auto;
    object-fit: contain;
}

nav .logo img { height: 80px; }
nav ul { display: flex; list-style: none; margin: 0; }
nav ul li a { 
    text-decoration: none; 
    margin-left: 20px; 
    color: var(--text-dark); 
    font-weight: 600; 
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ส่วนครอบสไลด์ */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* ให้อยู่หลังข้อความ */
}
/* สไตล์ตอนที่โลโก้อยู่หน้าแรก */
#main-logo {
    width: 150px; /* ปรับขนาดตามต้องการ */
    transition: all 0.5s ease-in-out;
    display: block;
    margin: 0 auto 20px auto;
    z-index: 1001;
}

/* สไตล์ตอนที่เลื่อนหน้าจอลงมาแล้ว (Sticky State) */
#main-logo.sticky {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px; /* ย่อขนาดลงเมื่ออยู่บนแถบเมนู */
    margin: 0;
}

#main-logo:hover {
    transform: scale(1.1); /* ขยายใหญ่ขึ้นเล็กน้อย */
    filter: brightness(1.2); /* สว่างขึ้นเล็กน้อย */
    transition: 0.3s;
}

/* หากโลโก้อยู่ในสถานะ sticky (ที่ขยับไปอยู่ข้างบน) ก็ให้มันขยายได้เช่นกัน */
#main-logo.sticky:hover {
    transform: translateX(-50%) scale(1.1); /* ต้องรักษาค่า translateX ไว้ด้วย */
}

.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

/* แถบยาวที่บรรจุรูปทั้งหมด */
.slide-track {
    display: flex;
    width: 400%; /* (จำนวนรูปทั้งหมดรวมตัวซ้ำ) x 100% */
    height: 100%;
    animation: scrollSlides 20s linear infinite; /* ปรับเวลาตามความเร็วที่ชอบ */
}

.slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6); /* ปรับความมืดให้ข้อความอ่านง่ายขึ้น */
}

/* สั่งให้เลื่อนจากรูปที่ 1 ไปจนจบ */
@keyframes scrollSlides {
    0% { transform: translateX(0); }
    100% { transform: translateX(-75%); } /* เลื่อนไปทางซ้าย (100 - (100/จำนวนรูป)) */
}

.hero-content {
    z-index: 1; /* ดันข้อความมาข้างหน้า */
    color: var(--white);
    text-align: center;
}

/* News Section */
.news-section { padding: 80px 20px; background: var(--bg-light); text-align: center; }
.news-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; 
    max-width: 1200px; 
    margin: 40px auto 0; 
}

/* =========================================
   PART 1: ปรับแต่ง News Section & Cards
   ========================================= */

.news-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden; /* ล็อคแสงวิ่งให้อยู่ในการ์ด */
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* เอฟเฟกต์ "แสงวิ่งผ่าน" (Shine Effect) */
/* ส่วนของลำแสงวิ่งผ่านที่ปรับใหม่ให้ชัดขึ้น */
.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 80%; /* ขยายความกว้างลำแสง */
    height: 100%;
    background: linear-gradient(
        to right, 
        transparent 0%, 
        rgba(122, 238, 232, 0.699) 30%,
        rgba(114, 241, 214, 0.8) 80%, /* ปรับเป็นสีขาวสว่าง 80% จะเห็นชัดมาก */
        rgb(154, 240, 228) 70%,
        transparent 100%
    );
    transform: skewX(-25deg);
    transition: 1.0s; /* ปรับเวลาให้วิ่งนวลตาขึ้น */
    z-index: 1;
}

/* เมื่อ Hover ให้วิ่งไปจนสุด */
.news-card:hover::before {
    left: 150%;
}

/* เมื่อเอาเมาส์วางบนการ์ด */
.news-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-yellow);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2);
}

.news-card:hover::before {
    left: 150%;
}

/* ปรับปรุงปุ่ม "อ่านต่อ" ในการ์ด */
.news-card button {
    background: linear-gradient(135deg, #FFCA61, #D4AF37);
    color: #000;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 3.5s;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.news-card button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* =========================================
   PART 2: ปรับแต่งปุ่ม Social (Glassmorphism)
   ========================================= */

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.social-icons a {
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.2); /* พื้นหลังใสแบบกระจก */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000; /* หรือใช้ var(--accent-yellow) */
    font-size: 3.5rem;
    text-decoration: none;
    transition: all 1.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* ดีดเด้งแบบ Bounce */
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* เมื่อเอาเมาส์วางบนปุ่ม Social */
.social-icons a:hover {
    background: var(--accent-yellow);
    transform: translateY(-12px) rotate(5deg); /* ลอยสูงขึ้นและเอียงนิดๆ */
    color: #fff;
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.4);
    border-color: #ffffff;
}

.news-card:hover { transform: translateY(-5px); }

.news-card, .staff-card, .card-3d {
    background: rgba(255, 255, 255, 0.9) !important; /* ขาวโปร่งแสงเล็กน้อย */
    backdrop-filter: blur(5px); /* เบลอพื้นหลังการ์ดให้ดูหรู */
    border: 1px solid rgba(212, 175, 55, 0.4) !important; /* ขอบทองจางๆ */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}
/* Member Carousel (3D) */
/* ค้นหาส่วนนี้ใน style.css */
.member-section { 
    padding: 80px 0; 
    text-align: center; 
    overflow: hidden; 
    background: var(--bg-light); /* เพิ่มบรรทัดนี้ หรือเปลี่ยนจากสีเดิมเป็นตัวแปรนี้ */
}
.carousel-wrapper { 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 500px; 
}

.carousel-container { 
    position: relative; 
    width: 800px; 
    height: 450px; 
    perspective: 1200px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.card-3d {
    position: absolute;
    width: 280px;
    height: 400px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    transform: scale(0.5) rotateY(0deg);
    pointer-events: none;
    overflow: hidden;
}

/* ปรับปรุงการตอบสนองของการ์ดสมาชิก */
/* สถานะปกติของการ์ดที่อยู่ตรงกลาง (Active) */
.card-3d.active {
    opacity: 1;           /* ทำให้การ์ดปรากฏขึ้น (จากเดิมที่โดนซ่อนเป็น 0) */
    z-index: 10;          /* ให้การ์ดอยู่หน้าสุด */
    transform: scale(1.1) translateX(0) rotateY(0deg); /* ขยายขนาดให้เด่นกว่าใบอื่น */
    pointer-events: auto; /* ให้กดคลิกได้ */
    cursor: pointer;      /* เปลี่ยนเมาส์เป็นรูปมือ */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* เอฟเฟกต์เมื่อเอาเมาส์ไปชี้ (Hover) */
.card-3d.active:hover {
    transform: scale(1.05) translateY(-15px); /* ขยายขนาดขึ้นเล็กน้อยและลอยขึ้น */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3); /* เพิ่มเงาให้ดูเหมือนการ์ดลอยสูงขึ้นจากพื้นหลัง */
    filter: brightness(1.1); /* เพิ่มความสว่างเล็กน้อยเพื่อให้ดู Highlight */
}

/* เอฟเฟกต์แสงเงาวิ่งผ่านการ์ด (Glossy Shine Effect) */
/* เอฟเฟกต์เมื่อเอาเมาส์ไปชี้ (Hover) เฉพาะใบกลาง */
.card-3d.active:hover {
    transform: scale(1.15) translateY(-20px); /* ลอยขึ้นสูงขึ้นและขยายขึ้นอีกนิด */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); /* เงาเข้มขึ้นเพื่อให้ดูเหมือนลอยสูงจากพื้น */
    filter: brightness(1.05); /* สว่างขึ้นเล็กน้อย */
}

/* เพิ่มแสงวิ่งผ่านการ์ด (Glossy Effect) */
.card-3d.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: 0.6s;
}

.card-3d.active:hover::after {
    left: 150%; /* แสงวิ่งจากซ้ายไปขวาเมื่อชี้ */
}

/* เพิ่มแอนิเมชันให้รูปภาพข้างในขยับเล็กน้อย */
.card-3d.active:hover .card-content img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}
.card-3d.prev-card { opacity: 0.6; z-index: 5; transform: scale(0.8) translateX(-350px) rotateY(30deg); pointer-events: auto; }
.card-3d.next-card { opacity: 0.6; z-index: 5; transform: scale(0.8) translateX(350px) rotateY(-30deg); pointer-events: auto; }

.card-content { padding: 20px; }
.card-content img { width: 100%; height: 220px; object-fit: cover; border-radius: 15px; margin-bottom: 15px; }

.nav-btn {
    width: 50px;
    height: 50px;
    background: var(--accent-yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: 0.3s;
}

.nav-btn:hover { background: var(--primary-blue); color: var(--white); }

/* Staff Section */
/* ค้นหาส่วนนี้ใน style.css และแก้ไขตามนี้ */
.staff-section { 
    padding: 80px 20px; 
    text-align: center; 
    background: var(--bg-light); /* เปลี่ยนจาก #f0f4f8 เป็นสีเหลืองนวล */
}
.staff-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px; margin-top: 40px; }
.staff-card { 
    background: var(--white); 
    padding: 25px; 
    border-radius: 20px; 
    box-shadow: var(--shadow); 
    max-width: 300px; 
    cursor: pointer; /* ทำให้เมาส์เป็นรูปมือ */
    transition: 0.3s; 
}
.staff-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); /* เพิ่มเงาตอน Hover ให้ดูเด่นขึ้น */
}
#staffDetailContainer {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
}
.staff-img { width: 200px; height: 250px; object-fit: cover; border-radius: 15px; margin-bottom: 15px; }

/* Gallery */
/* ค้นหาหรือเพิ่มส่วนนี้ใน style.css */
.gallery-section {
    padding: 80px 20px;
    text-align: center;
    background: var(--bg-light); /* เพิ่มบรรทัดนี้เพื่อให้เป็นสีเหลืองนวล */
}
.gallery-container {
    display: grid;
    /* แบ่งเป็น 4 คอลัมน์เท่าๆ กัน (หรือตามชอบ) */
    grid-template-columns: repeat(4, 1fr);
    /* กำหนดความสูงเริ่มต้นของแถว */
    grid-auto-rows: 200px; 
    /* ระยะห่างของเส้นขอบ (ที่เป็นสไตล์มอนเดรียน) */
    gap: 10px; 
    padding: 10px;
    background-color: #000; /* สีของเส้นขอบ (ถ้าอยากให้เป็นเส้นสีดำแบบต้นฉบับ) */
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background-color: #fff;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* บังคับให้รูปเต็มบล็อกโดยไม่เสียสัดส่วน */
    display: block;
    transition: transform 0.3s ease;
}

/* หากในไฟล์เดิมมี .gallery-grid อยู่แล้ว ไม่ต้องลบครับ ให้คงไว้เหมือนเดิม */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px; 
    padding: 40px 20px; 
    max-width: 1200px; 
    margin: 0 auto;
}
.gallery-item img { width: 100%; border-radius: 12px; cursor: pointer; transition: 0.3s ease; }
.gallery-item img:hover { transform: scale(1.03); }
/* รูปขนาดใหญ่พิเศษ (กว้าง 2 สูง 2) */
.size-big {
    grid-column: span 2;
    grid-row: span 2;
}

/* รูปทรงกว้าง (กว้าง 2 สูง 1) */
.size-wide {
    grid-column: span 2;
}

/* รูปทรงสูง (กว้าง 1 สูง 2) */
.size-tall {
    grid-row: span 2;
}
/* Modals & Lightbox */
/* Lightbox พื้นหลัง */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}

/* รูปภาพขนาดเต็ม */
.full-res-img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    cursor: default;
    animation: zoomIn 0.3s ease;
}

/* ปุ่มปิด (X) */
.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 50px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #ffeb3b;
    transform: scale(1.2);
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* แก้ไข .news-modal ให้ใช้คุณสมบัติเดียวกับ lightbox เพื่อให้เด้งทับหน้าจอ */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* พื้นหลังมืด */
    z-index: 10000; /* ให้อยู่บนสุด */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

/* ปรับปรุงดีไซน์การ์ดเนื้อหาข่าวสาร */
.news-modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 25px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 50px rgba(235, 232, 232, 0.3);
    border-top: 8px solid var(--primary-blue); /* เพิ่มแถบสีให้ดูเหมือนการ์ด */
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ปรับแต่งหัวข้อในข่าวสาร */
#newsDetail h2 {
    color: var(--primary-blue);
    margin-top: 0;
    font-size: 1.8rem;
}

#newsDetail p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333232;
}

@keyframes pop { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }

.close-btn { position: absolute; top: 15px; right: 25px; font-size: 35px; cursor: pointer; color: #999; }
.close-btn:hover { color: var(--text-dark); }

/* Footer */
footer {
    padding: 40px;
    background: var(--primary-blue);
    color: var(--white);
    text-align: center;
}
/* ปรับปรุงดีไซน์ Modal รายละเอียดสมาชิก */
.detail-modal {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    max-width: 450px; /* จำกัดความกว้างรวม */
    width: 90%;
    max-height: 90vh; /* จำกัดความสูงไม่ให้เกินหน้าจอ */
    overflow-y: auto; /* เพิ่ม Scrollbar หากเนื้อหายาวเกินไป */
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: pop 0.3s ease-out;
}

/* ควบคุมขนาดรูปภาพใน Modal ให้ไม่ใหญ่เกินไป */
.detail-modal img {
    width: 100%;
    max-height: 300px; /* กำหนดความสูงสูงสุดของรูป */
    object-fit: cover; /* ให้รูปดูสมส่วนไม่เบี้ยว */
    border-radius: 15px;
    margin-bottom: 20px;
    display: block;
}

.detail-modal h2 { margin: 10px 0; color: var(--primary-blue); }
.detail-modal p { margin: 8px 0; line-height: 1.5; color: #333333; }
/* ปรับให้การ์ดที่ไม่ได้เป็น Active ดูเหมือนปุ่มที่คลิกได้ */
.carousel-item {
    cursor: pointer; /* เปลี่ยนเมาส์เป็นรูปมือ */
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* ลบสไตล์ปุ่มเดิมออก (ถ้ามี) เพื่อความสะอาดของโค้ด */
.carousel-controls {
    display: none;
}
.carousel-item {
    cursor: pointer; /* เปลี่ยนเมาส์เป็นรูปมือ */
    transition: all 0.5s ease-in-out;
}

/* เพิ่ม Effect นิดหน่อยเวลาเอาเมาส์ไปชี้ใบที่อยู่ข้างๆ */
.carousel-item:not(.active):hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}
/* ดีไซน์ปุ่มแฮมเบอร์เกอร์ */
.menu-toggle {
    display: block; /* แสดงผล */
    font-size: 28px;
    cursor: pointer;
    color: var(--primary-blue);
    z-index: 1001;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

#calendar .calendar-3d {
    width: 100%;
    max-width: 400px;
    background: rgba(15, 15, 15, 0.9); /* เปลี่ยนจาก #8d8d8d เป็นดำเข้มใสๆ */
    border: 3px solid var(--accent-yellow);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 202, 97, 0.2);
    backdrop-filter: blur(10px); /* เพิ่มความหรูหราแบบกระจก */
    transform: rotateX(20deg) rotateY(-10deg);
    transition: transform 0.5s ease;
}
.calendar-3d:hover {
    transform: rotateX(0deg) rotateY(0deg) scale(1.02); /* ขยายขึ้นนิดนึงตอน Hover */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                0 0 25px rgba(139, 128, 100, 0.4);
}

.calendar-header button {
    background: transparent;
    border: none;
    color: var(--accent-yellow);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.calendar-header button:hover {
    color: var(--white)8;
    transform: scale(1.2);
}
/* ส่วนหัว จ. - อา. */

/* สไตล์พื้นฐานของแถบหัวข้อวัน */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 202, 97, 0.3); /* เส้นใต้สีทองจางๆ */
}

/* กำหนดสีแยกตามวันด้วย nth-child */
.calendar-weekdays div {
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* เพิ่มเงาให้ตัวหนังสือลอยเด่น */
}

.calendar-weekdays div:nth-child(1) { color: #FF6B6B; } /* อาทิตย์ - แดงพาสเทล */
.calendar-weekdays div:nth-child(2) { color: #FFF385; } /* จันทร์ - เหลืองนวล */
.calendar-weekdays div:nth-child(3) { color: #FFACEC; } /* อังคาร - ชมพู */
.calendar-weekdays div:nth-child(4) { color: #89FFA0; } /* พุธ - เขียวอ่อน */
.calendar-weekdays div:nth-child(5) { color: #FFB37E; } /* พฤหัสบดี - ส้มอ่อน */
.calendar-weekdays div:nth-child(6) { color: #88E2FF; } /* ศุกร์ - ฟ้า */
.calendar-weekdays div:nth-child(7) { color: #D1B3FF; } /* เสาร์ - ม่วงอ่อน */

.weekend {
    color: #e27272; /* สีแดงสำหรับวันหยุด/วันเสาร์-อาทิตย์ */
}

/* ปรับแต่งช่องวันที่ที่มีเรียน */
.study-day {
    background-color: rgba(105, 99, 93, 0.2) !important; /* สีเหลืองจางๆ */
    border: 1px solid var(--accent-yellow) !important;
}

.study-label {
    font-size: 10px;
    color: var(--accent-yellow);
    display: block;
    margin-top: 2px;
}

/* ทำให้ช่องวันที่เป็นสี่เหลี่ยมสวยๆ */
.day-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}
/* ซ่อนเมนูและเตรียมการเคลื่อนไหว */
/* ปรับปรุงเมนูที่สไลด์ออกมา */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 200px;
    height: 100vh;
    background: rgb(247, 208, 130); 
    display: flex; /* มั่นใจว่าเป็น flex เพื่อจัดเรียงแนวตั้ง */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 20px;  /* ปรับตัวเลขนี้ตามความเหมาะสม ยิ่งน้อยหัวข้อยิ่งสูงขึ้น */
    padding-left: 0;
    z-index: 9998; /* ให้อยู่ต่ำกว่าปุ่มกดนิดนึงแต่สูงกว่าหน้าเว็บ */
    transition: 0.5s ease;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu.active {
    right: 0;
}

.nav-menu li {
    margin: 20px 0;
}

.nav-menu li a {
    font-size: 1.2rem;
    transition: 0.3s;
}

.nav-menu li a:hover {
    color: var(--white);
    letter-spacing: 2px; /* เอฟเฟกต์ตัวอักษรขยายตอน Hover */
}
/* ลดระยะห่างด้านบนของรายการเมนูตัวแรก */
.nav-menu li:first-child {
    margin-top: 90px; 
}

/* เปลี่ยนไอคอนแฮมเบอร์เกอร์ตอนคลิก (Optional: หมุนไอคอน) */
.menu-toggle.active i::before {
    content: "\f00d"; /* เปลี่ยนเป็นรูปตัว X (FontAwesome times) */
}
/* --- ปรับปรุงระบบ Hero Slider ใหม่ --- */

.slide-track {
    display: block;      /* เปลี่ยนจาก flex เป็น block เพื่อให้ภาพซ้อนกัน */
    width: 100%;
    height: 100%;
    position: relative;
    animation: none;     /* ลบการเลื่อนซ้ายเดิมออก */
}

.slide {
    position: absolute;  /* สั่งให้ทุกภาพวางซ้อนทับกันที่จุดเดียว */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;          /* เริ่มต้นด้วยการซ่อนภาพไว้ */
    filter: brightness(0.6); /* ค่าความสว่างเริ่มต้น (ปรับตามที่คุณชอบ) */
    
    /* เรียกใช้ Animation ใหม่ที่เราสร้าง: 6 วินาที x 3 ภาพ = 18 วินาที */
    animation: heroPopAndFade 18s infinite; 
}

/* กำหนด Delay ให้แต่ละภาพเริ่มไม่พร้อมกัน (สำหรับ 3 ภาพ) */
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 6s; }
.slide:nth-child(3) { animation-delay: 12s; }

/* สร้าง Animation: เด้งขึ้น -> แสดงภาพ -> ดรอปสีและหายไป */
@keyframes heroPopAndFade {
    0% {
        opacity: 0;
        transform: scale(1.1) translateY(20px); /* เด้งขึ้นมาจากด้านล่างนิดๆ และขนาดใหญ่กว่าปกติ */
        filter: brightness(0) grayscale(1);      /* เริ่มจากมืดสนิทและขาวดำ (ดรอปสี) */
    }
    /* 5% ของ 18 วินาที คือช่วงที่ภาพกำลังโผล่ขึ้นมา (ประมาณ 0.9 วินาที) */
    5% {
        opacity: 1;
        transform: scale(1) translateY(0);       /* กลับสู่ขนาดปกติ */
        filter: brightness(0.6) grayscale(0);    /* สีกลับมาสดใสและความสว่างปกติ */
    }
    /* 28% คือช่วงเวลาที่ภาพจะหยุดนิ่งให้คนดู (ประมาณ 4-5 วินาที) */
    28% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: brightness(0.6) grayscale(0);
    }
    /* 33.33% คือช่วงที่ภาพกำลังเริ่มดรอปสีและหายไปเพื่อสลับภาพใหม่ */
    33.33% {
        opacity: 0;
        transform: scale(0.95);                 /* ย่อตัวลงเล็กน้อย */
        filter: brightness(0) grayscale(1);      /* ดรอปสีลงเป็นขาวดำและมืดลง */
    }
    /* เวลาที่เหลือ 100% ให้ภาพนั้นซ่อนตัวอยู่ เพื่อให้ภาพอื่นแสดงผล */
    100% {
        opacity: 0;
    }
}
/* คอนเทนเนอร์หลักของหน้าประตู */
/* ค้นหาส่วน .door-container หรือ #door-overlay ในไฟล์เดิม */
.door-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    z-index: 9999;
    /* แก้ไข/เพิ่มบรรทัดนี้: กำหนดพื้นหลังหลักเป็นสีขาว */
    background-color: #ffffff; 
    transition: opacity 0.8s ease; /* ให้ตัวคอนเทนเนอร์ค่อยๆ หายไป */
}

/* ส่วนของบานประตูสีดำเดิม */
.door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: #000000; /* สีดำเดิมที่คุณมี */
    transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: 1;
}

/* เพิ่ม Effect เมื่อประตูเปิด (คลาสที่จะถูกเติมด้วย JS) */
.door-container.active .door-left {
    transform: translateX(-100%);
}

.door-container.active .door-right {
    transform: translateX(100%);
}

/* เพิ่มการทำให้ Logo หายไปทันทีที่กด */
.door-container.active .door-logo {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.door-left {
    left: 0;
    border-right: 2px solid var(--accent-yellow); /* เส้นแบ่งระหว่างประตู */
}

.door-right {
    right: 0;
    border-left: 2px solid var(--accent-yellow);
}

/* โลโก้ตรงกลางประตู */
/*----------------*/
/*----------------*/
.door-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    text-align: center;
    transition: opacity 0.8s ease;
}
.door-logo img {
    width: 300px; /* ปรับขนาดโลโก้ */
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 202, 97, 0.5));
}

.door-logo p {
    color: white;
    margin-top: 40px;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* เมื่อประตูถูกเปิด */
.door-container.opened .door-left {
    transform: translateX(-100%);
}

.door-container.opened .door-right {
    transform: translateX(100%);
}

.door-container.opened .door-logo {
    opacity: 0;
    pointer-events: none;
}
#leaf-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* เพื่อให้เรายังคลิกปุ่มต่างๆ ในเว็บได้ */
    z-index: 9999;
    overflow: hidden;
}

.leaf {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--accent-yellow); /* ใช้สีเหลืองจากตัวแปรเดิมของคุณ */
    border-radius: 0 100%; /* ทำให้เป็นรูปทรงใบไม้ */
    opacity: 0.8;
    z-index: 9999;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(100px) rotate(720deg);
        opacity: 0;
    }
}
.schedule-section {
    padding: 80px 20px;
    background: #FFDC97 ;
    perspective: 1000px; /* สร้างมิติความลึก */
}

.calendar-3d-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-3d {
    width: 100%;
    max-width: 600px;
    background: #8d8d8d;
    border: 3px solid var(--accent-yellow);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 50px 100px rgba(201, 22, 22, 0.5), 0 0 20px srgba(75, 75, 75, 0.2);
    /* เอียงปฏิทินให้เป็น 3D */
    transform: rotateX(20deg) rotateY(-10deg);
    transition: transform 0.5s ease;
}

.calendar-3d:hover {
    transform: rotateX(0deg) rotateY(0deg); /* ดึงกลับมาหน้าตรงเมื่อเม้าส์ชี้ */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--accent-yellow);
    margin-bottom: 20px;
}

.calendar-weekdays, .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    text-align: center;
}

.calendar-weekdays div {
    color: #888;
    font-size: 0.8rem;
    font-weight: bold;
}

.day-cell {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #222;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    position: relative;
}

.day-cell:hover {
    background: var(--accent-yellow);
    color: black;
    transform: translateZ(20px); /* ให้ปุ่มเด้งขึ้นมา */
}

/* จุดแสดงว่ามีกิจกรรม */
.has-event::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #ff4757;
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
}
/* 1. สร้างเลเยอร์ลวดลายจางๆ ทับบนสีพื้นหลังเดิม */
.news-section, .member-section, .staff-section, .gallery-section, .schedule-section {
    position: relative;
    background-color: var(--bg-light); /* สีเหลืองนวลเดิมของคุณ */
    overflow: hidden;
}

/* ใช้ Pseudo-element สร้างลายเพื่อไม่ให้กระทบเนื้อหาข้างใน */
.news-section::before, 
.member-section::before, 
.staff-section::before, 
.gallery-section::before, 
.schedule-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    
    /* เลือกใช้ลายใดลายหนึ่งด้านล่างนี้ (ผมเตรียม URL ลายจางๆ ไว้ให้แล้ว) */
    background-image: url('http://www.transparenttextures.com/patterns/cartographer.png'); 
    opacity: 0.4; /* ปรับความเข้มจางของลายที่นี่ (0.1 - 1.0) */
    pointer-events: none; /* สำคัญมาก: เพื่อให้คลิกทะลุไปโดนปุ่ม/การ์ดได้ปกติ */
    z-index: 0;
}

/* 2. ดันเนื้อหาให้อยู่เหนือลายพื้นหลัง */
.news-section > *, .member-section > *, .staff-section > *, .gallery-section > *, .schedule-section > * {
    position: relative;
    z-index: 1;
}

/* 3. เพิ่มความหรูหราให้ปฏิทิน 3D ด้วยการไล่เฉดสี */
.calendar-3d {
    background: linear-gradient(145deg, #ffffff, #e6e6e6) !important;
    border: 3px solid #D4AF37 !important; /* เปลี่ยนเป็นขอบสีทอง */
    box-shadow: 20px 20px 60px rgba(0,0,0,0.1), -20px -20px 60px rgba(255,255,255,0.5);
}
/* คอนเทนเนอร์หลักของข้อความ */
.wave-text {
    display: flex;
    justify-content: center;
    gap: 2px; /* ระยะห่างระหว่างตัวอักษร */
}

/* ตั้งค่าให้ทุกตัวอักษรที่อยู่ใน span */
.wave-text span {
    display: inline-block;
    font-size: 2.5rem; /* ปรับขนาดตามต้องการ */
    font-weight: 600;
    animation: wave-animation 1.5s ease-in-out infinite;
}

/* สร้าง Animation การเคลื่อนที่ ขึ้น-ลง */
@keyframes wave-animation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px); /* ปรับความสูงของการเด้งที่นี่ */
    }
}

/* ใส่จังหวะหน่วง (Delay) ให้ตัวอักษรแต่ละตัว 
   ยิ่งตัวเลขต่างกันมาก คลื่นจะยิ่งดูห่างกัน
*/
.wave-text span:nth-child(1) { animation-delay: 0.1s; }
.wave-text span:nth-child(2) { animation-delay: 0.2s; }
.wave-text span:nth-child(3) { animation-delay: 0.3s; }
.wave-text span:nth-child(4) { animation-delay: 0.4s; }
.wave-text span:nth-child(5) { animation-delay: 0.5s; }
.wave-text span:nth-child(6) { animation-delay: 0.6s; }
.wave-text span:nth-child(7) { animation-delay: 0.7s; }
.wave-text span:nth-child(8) { animation-delay: 0.8s; }
.wave-text span:nth-child(9) { animation-delay: 0.9s; }
.wave-text span:nth-child(10) { animation-delay: 1.0s; }
.wave-text span:nth-child(11) { animation-delay: 1.1s; }
.wave-text span:nth-child(12) { animation-delay: 1.2s; }
.wave-text span:nth-child(13) { animation-delay: 1.3s; }
.wave-text span:nth-child(14) { animation-delay: 1.4s; }
.wave-text span:nth-child(15) { animation-delay: 1.5s; }
.wave-text span:nth-child(16) { animation-delay: 1.6s; }
.wave-text span:nth-child(17) { animation-delay: 1.7s; }
.wave-text span:nth-child(18) { animation-delay: 1.8s; }
.wave-text span:nth-child(19) { animation-delay: 1.9s; }
.wave-text span:nth-child(20) { animation-delay: 2.0s; }
/* ตัวดวงไฟ */
.cursor-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(97, 218, 255, 0.15) 0%, rgba(0, 255, 200, 0) 70%);
    border-radius: 50%;
    position: fixed; /* ให้วิ่งตามหน้าจอ */
    top: 0;
    left: 0;
    pointer-events: none; /* สำคัญ: เพื่อให้คลิกทะลุแสงไปโดนปุ่มได้ */
    transform: translate(-50%, -50%); /* ให้จุดศูนย์กลางดวงไฟอยู่ตรงปลายเมาส์ */
    z-index: 9999; /* ให้อยู่บนสุด หรือปรับลดถ้าอยากให้อยู่หลังตัวอักษร */
    transition: transform 0.1s ease-out; /* เพิ่มความสมูทเวลาขยับ */
    mix-blend-mode: screen; /* ช่วยให้แสงดูกลืนไปกับพื้นหลัง */
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-yellow); /* สีทองตามธีมเว็บ */
    box-shadow: 0 0 10px var(--accent-yellow), 0 0 20px var(--accent-yellow); /* ทำให้เส้นมีแสงเรือง */
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s; /* ให้จุดปลายเรียวเล็กลงได้ */
}
/* เพิ่มไปที่ท้ายไฟล์ style.css */
.door-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#portalCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1; /* ให้อยู่หลังโลโก้ */
    pointer-events: none; /* เพื่อให้คลิกทะลุไปโดนโลโก้ได้ */
}

#portal-trigger-logo {
    position: relative;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#portal-trigger-logo:active {
    transform: scale(0.95);
}
/* จัดการให้รายการในเมนูยืดเต็มความสูงเพื่อดันตัวล่างลงไป */
.nav-menu {
    display: flex;
    flex-direction: column;
    height: 80%; /* ปรับความสูงตามความเหมาะสมของหน้าจอ */
}

/* บรรทัดที่ต้องการให้อยู่ล่างสุด */
.nav-menu li.nav-contact {
    margin-top: auto; 
    padding-top: 20px;
    border-top: 1px solid rgba(255, 202, 97, 0.3); /* เส้นคั่นสีทองจางๆ */
}



