:root {
    --brown: #4A3728;
    --header-bg: #2C211A;
    --card-shadow: rgba(0,0,0,0.1);
    --gradient-bg: linear-gradient(135deg, #F0EAD6 0%, #E6E1D1 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    font-family: 'Kanit';
    text-decoration: none;
    transition: .2s linear;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
    overflow-x: hidden;
    filter: grayscale(50%);
}

/* Header */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-color: var(--transparent-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 5rem;
    z-index: 1000; 
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none; /* เริ่มต้นไม่มีเงา */
}

.header-container.scrolled {
    background-color: var(--header-bg); /* เปลี่ยนเป็นสีทึบ */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* *** NEW: สร้างขอบโค้งมน (Wave effect) *** */
}

.logo {
    margin-top: 1cm;
    margin-bottom: 10px;
    height: 120px;
    width: 200px;
    object-fit: contain;
    position: relative;
    padding-bottom: 30px;
}

.navbar {
    display: flex;
    gap: 2rem;
}

.navbar a {
    color: rgb(255, 255, 255);
    font-weight: 600;
    font-size: 1.4rem;
    padding: 1rem 2rem;
    border-radius: 25px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.navbar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.navbar a:hover::before {
    left: 100%;
}

.navbar a:hover {
    background: linear-gradient(90deg, #6A5B52, var(--brown)); 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.navbar a.active {
    background: linear-gradient(90deg, #6A5B52, var(--brown));
    font-weight: 700;
}

/* Hero Slider */
.slider {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    margin-top: 0px;
    transform: translateZ(0);
    background-color: #1a1a1a;
}

.slider img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider img.active {
    opacity: 1;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brown);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.slider-nav:hover {
    background: #b8621f;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.slider-nav.prev { left: 12px; }
.slider-nav.next { right: 12px; }

.indicators {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 2;
}

.indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: white;
}

/* Section Heading */
.section-heading {
    padding: 4rem 5rem 2rem;
    text-align: center;
}

.section-heading h2 {
    font-size: 3rem;
    color: var(--brown);
    margin-bottom: 1rem;
}

.section-heading p {
    font-size: 1.5rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Cards Section */
.cards-wrapper {
    position: relative;
    padding: 2rem 3rem 4rem;
    transform: translateZ(0);
}

.cards-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2rem 0;
    scrollbar-width: none;
}

.cards-container::-webkit-scrollbar {
    display: none;
}

.card {
    flex: 0 0 395px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--brown);
}

.card p {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #666;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brown);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.scroll-btn:hover {
    background: #b8621f;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.scroll-btn.prev { left: 15px; }
.scroll-btn.next { right: 15px; }

/* YouTube Section */
.youtube-section {
    padding: 4rem 5rem;
    text-align: center;
    background-color: #f8f8f8;
}

.youtube-section h3 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--brown);
}

.youtube-container iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--card-shadow);
}

/* Calendar Section */
.calendar-section {
    padding: 8rem 5rem; /* เพิ่มพื้นที่ว่างให้ดูโปร่งและหรูหรา */
    text-align: center;
    position: relative;
    /* --- พื้นหลัง Gradient + Pattern --- */
    /* 1. ไล่สีพื้นหลังโทนครีม/เทาอุ่นๆ */
    background-color: #f6f1e6;
    background-image: 
        /* สร้างลายจุดจางๆ สีน้ำตาล */
        radial-gradient(rgba(74, 55, 40, 0.07) 1.5px, transparent 1.5px),
        /* ไล่สีพื้นหลังจากบนซ้ายไปล่างขวา */
        linear-gradient(135deg, #bbb29d 0%, #e6e4df 100%);
    /* กำหนดระยะห่างของลายจุด */
    background-size: 30px 30px, 100% 100%;
    background-position: 0 0, 0 0;
    z-index: 2; /* ให้อยู่เหนือส่วนพื้นหลังอื่นๆ */
}

.calendar-section h3 {
    font-size: 3.5rem; /* ขยายหัวข้อให้ใหญ่ขึ้น */
    margin-bottom: 4rem;
    color: var(--brown);
    font-weight: 700;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
    position: relative;
    display: inline-block;
}

/* เพิ่มเส้นตกแต่งใต้หัวข้อ */
.calendar-section h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 5px;
    background: var(--brown);
    margin: 15px auto 0;
    border-radius: 10px;
}

.calendar-container iframe {
    width: 100%;
    max-width: 1000px;
    height: 650px; /* เพิ่มความสูงอีกนิด */
    /* เงาฟุ้งๆ ให้ดูลอยออกมาจากพื้นหลัง */
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.1),
        0 10px 20px rgba(0,0,0,0.05);
}

/* Footer */
footer {
    background-color: #f0f0f0;
    padding: 3rem 5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-left {
    flex: 1;
    min-width: 300px;
}

.footer-logo {
    width: 320px;
    height: auto;
    margin-bottom: 2rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.footer-socials img {
    width: 35px;
    height: 35px;
    transition: transform 0.3s;
}

.footer-socials img:hover {
    transform: scale(1.1);
}

.footer-text {
    font-size: 1.4rem;
    color: #333;
    line-height: 1.6;
}

.footer-right {
    flex: 1;
    max-width: 600px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem 2rem;
        flex-direction: column;
        height: auto;
    }

    .logo {
        margin-top: 0;
        height: 80px;
        width: auto;
    }

    .navbar {
        margin-top: 1rem;
    }

    .slider {
        margin-top: 120px;
        height: 60vh;
        
    }

    .section-heading {
        padding: 2rem;
    }

    .youtube-section, .calendar-section {
        padding: 2rem;
    }

    .youtube-container iframe,
    .calendar-container iframe {
        height: 300px;
    }

    footer {
        padding: 2rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
    }

    .calendar-section {
        padding: 4rem 2rem;
        border-radius: 30px 30px 0 0;
    }
    
    .calendar-container iframe {
        height: 400px;
        border-width: 8px; /* ลดขอบขาวในมือถือ */
    }
}