 html {
            scroll-behavior: smooth;
        }

        body {
            margin: 0;
            font-family: 'Sarabun', sans-serif;
            line-height: 1.6;
            color: #333;
        }

       /* --- Header --- */
        header {
    background-color: #D4AF37;
    color: #fff;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: center; /* ให้อยู่ตรงกลาง */
    align-items: center;
    position: relative;
    z-index: 1000;
}

       /* ---------------- Grid Layout ---------------- */
.container {
    display: grid;
    grid-template-rows: 80px auto 1fr auto 50px;
    grid-template-columns: 1fr 4fr 1fr;
    height: 100vh;
    grid-template-areas:
        "header header header"
        "left-aside banner right-aside"
        "left-aside main right-aside"
        "left-aside low-content right-aside"
        "footer footer footer";
    grid-gap: 10px;
    padding: 10px;
    font-weight: 600;
    font-size: 20px;
}

@media (max-width: 678px) {
    .container {
        grid-template-rows: 50px 50px 50px 1fr 50px 50px 50px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "banner"
            "left-aside"
            "main"
            "right-aside"
            "low-content"
            "footer";
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-link img {
    height: 80px;
    width: auto;
    display: flex;
}

.header-right {
    display: flex;
    align-items: center;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav a,
nav .dropdown > a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
        font-size: 18px;

    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

nav a:hover,
nav .dropdown > a:hover {
    background: #ffffff;
    color: #000000;
}

/* เมนูหลัก (เฉพาะแถวบน header) */
header nav > a:hover,
header nav > .dropdown > a:hover {
    color: #2e2e2e;   /* ทอง */
    background: none; /* ไม่มีพื้นหลัง */
}

/* ลิงก์ภายใน dropdown */
.dropdown-content a:hover {
    color: #D4AF37;   /* ให้เปลี่ยนแค่สี */
    background: none; /* ไม่เอาพื้นหลัง */
}
/* dropdown ปกติ (desktop) */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #ffffff;
  min-width: 180px;
  top: 100%;
  left: 0;
  z-index: 999;
  flex-direction: column;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  margin-top: 8px;
}

.dropdown-content a {
  padding: 0.75rem 1rem;
  display: block;
  white-space: nowrap;
  color: #000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* ===== Mobile View ===== */
@media (max-width: 768px) {
  .dropdown {
    position: static;   /* ไม่ให้ absolute */
  }

  .dropdown-content {
    display: block !important;  /* แสดงตลอด */
    position: static;
    background: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
  }

  .dropdown-content a {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  /* เอาลูกศร ▾ ออกก็ได้ */
  .dropdown > a::after {
    content: none;
  }
}

.menu-toggle {
            display: none;
            font-size: 1.8rem;
            cursor: pointer;
            background: none;
            border: none;
            color: #fff;
        }

        

/* --- Responsive Design --- */
        @media (max-width: 768px) {
            header {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }

            .header-left {
                gap: 1rem;
            }
            
            .logo-link img {
                height: 60px;
            }

            /* Responsive for mobile */
@media (max-width: 768px) {
    nav {
        display: none;
        position: absolute;
        top: 50px;
        left: 0;
        background: #333333;
        width: 100%;
        padding-left: 10px;
        flex-direction: column;
        align-items: flex-start;
        
    }

    nav.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        background: #333333;
        width: 50%;
    }

    .dropdown-content a {
        padding-left: 1rem;
        color: #fff;
    }

    .dropdown-content a:hover {
        color: #f0ae2a;
    }
}

            
            .menu-toggle {
                display: block;
            }
        }


  footer {
    background:#3f3427; 
    color:#fff; 
    margin-top:auto;  /* ดันให้ชิดล่างเมื่อใช้ flexbox layout */
}

.footer-container { 
    display:flex; 
    justify-content:space-between; 
    align-items:center; 
    max-width:1200px; 
    margin:0 auto; 
    padding:1rem;
}

.copyright-bar { 
    background-color: #382b1c;  /* อาจเข้มกว่าด้านบนเล็กน้อย */
    text-align:center; 
    font-size:13px; 
    padding:0.5rem 0;
    color: #ffffff;
}
        .map-container { height: 300px; padding-right: 300px; }
        .contact-info p, .contact-info h3 { margin: 0.2rem 0; }
       .copyright-bar { 
    background:#3f3427;  /* อาจเข้มกว่าด้านบนเล็กน้อย */
    text-align:center; 
    font-size:13px; 
    padding:0.5rem 0;
    color: #ffffff;
}

        /* Responsive */
        @media (max-width: 768px) {
            nav { display: none; flex-direction: column; width: 100%; padding: 1rem 0; }
            nav.show { display: flex; }
            .menu-toggle { display: block; }
            .footer-container { flex-direction: column; }
            .map-container { width: 100%; padding-right: 0; margin-bottom: 2rem; }
        }

         .logo-container {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem 0;
        }

        .logo-container img {
            max-width: 300px;
            height: auto;
        }
 .content-box {
            background-color: #fff;
            padding: 25px;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            max-width: 700px;
            margin: auto;
        }
  
        .btn-readmore {
            display: inline-block;
            margin-top: 10px;
            padding: 5px 9px;
            background-color: #D4AF37;
            color: #fff; 
            text-decoration: none;
            border-radius: 8px;
            transition: background 0.3s;
        }
        .btn-readmore:hover {
            background-color: #b88f2a;
        }

        /* ====== Section: เขตคณะ ====== */
.khana-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: #fffdf6;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 2.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.khana-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.khana-text {
  flex: 1;
  color: #3f3427;
}
.khana-text h3 {
  color: #D4AF37;
  font-size: 1.7rem;
  margin-bottom: 1rem;
}
.khana-text p {
  margin: 0.3rem 0;
  font-size: 1.05rem;
}

.khana-image {
  flex: 1;
  text-align: center;
}
.khana-image img {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.khana-image img:hover {
  transform: scale(1.05);
}

/* Alternate layout (image left) */
.khana-card.reverse {
  flex-direction: row-reverse;
}

/* Lightbox */
.lightbox {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .khana-card {
    flex-direction: column;
    text-align: center;
  }
  .khana-card.reverse {
    flex-direction: column;
  }
  .khana-image img {
    max-width: 100%;
  }
}

/* ===== ปุ่มเปิด/ปิดเพลง ===== */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease, background 0.3s;
}

.music-toggle:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 200, 0.95);
}

.music-toggle i {
  font-size: 26px;
  color: #444;
}