body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* ---------------- HEADER BLUE BAR ---------------- */
.top-bar {
    background: #1C4D8D;
    color: #C2E4F2;
    display: flex;
    align-items: center;
    padding: 20px 40px;
    gap: 20px;
    padding-bottom: 40px;  
}

.logo {
    height: 65px;
}

.title-box {
    flex-grow: 1;
}

.title { font-size: 20px; font-weight: bold; line-height: 1.3; }
.subtitle { font-size: 13px; color: #FF8246; }

/* ---------- Language Switch ---------- */
.right-tools {
    display: flex;
    align-items: center;
    gap: 5px;
}



.search-icon {
    font-size: 22px;
    cursor: pointer;
}

.search-box input {
    width: 170px;              
    padding: 8px 12px;
    border-radius: 6px;        
    border: 2px solid #FFFEEB; 
    background: #FFFEEB;       
    outline: none;
    font-size: 14px;
}

/* ---------- HAMBURGER (Mobile Only) ---------- */
.hamburger {
    font-size: 26px;
    cursor: pointer;
    display: none;
    color: white;
}

header{
    position: sticky;
    top: 0;
    z-index: 9999;
    
}
/* ---------------- MENU BAR ---------------- */
.menu {
    background: #C2E4F2;        
    display: flex;
    justify-content: center;
    align-items: flex-start;    
    gap: 40px;
    font-size: 16px;
    font-weight: 550;

    width: 85%;
    margin: 0 auto;
    padding: 20px 20px;
    border-radius: 25px;

    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.menu a,
.menu .dropdown {
    text-decoration: none;
    color: #1C4D8D;             
    cursor: pointer;
}

.menu a:hover,
.menu .dropdown:hover {
    background-color: rgba(28, 77, 141, 0.1);
}


.menu .active {
    border-bottom: 3px solid #1C4D8D;  
    padding-bottom: 0px;
    line-height: 1;
    display: inline-block;
}
/* ---------------- SIDE MENU ---------------- */

.side-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: linear-gradient(180deg, #1C4D8D, #081F3F);
    color: white;
    padding: 40px 25px;
    transition: 0.4s ease;
    z-index: 10000;

    display: flex;
    flex-direction: column;
}

.side-menu.show {
    right: 0;
}


.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header input {
    width: 80%;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    outline: none;
}

.close-btn {
    font-size: 22px;
    cursor: pointer;
}

.menu-links {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.menu-links a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.menu-footer {
    margin-top: auto;
    color: #FF8246;
    font-size: 14px;
    margin-bottom: 90px; 
}

/* Active สำหรับ mobile menu */
.menu-links a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
    display: block;
}

/* เส้นใต้ตอนกด */
.menu-links a:focus,
.menu-links a:active {
    border-bottom: 3px solid #FF8246;
}
/* ---------------- RESPONSIVE ---------------- */

/* ---------------- RESPONSIVE ---------------- */

@media(max-width: 650px) {

    /* แสดง hamburger */
    .hamburger {
        display: block;
    }

    /* ซ่อน navbar */
    .menu {
        display: none;
    }

    /*  ซ่อน search box ตอนจอเล็ก */
    .search-box {
        display: none;
    }

    /* ปรับ padding */
    .top-bar {
        padding: 15px 20px;
    }

}
@media(min-width: 650px) {

    /* ซ่อน hamburger */
    .hamburger {
        display: none;
    }

/* -------- SEARCH BOX -------- */

.search-box {
    display: flex;
    align-items: center;
    background: #FFFEEB;
    border-radius: 25px;
    padding: 5px 12px;
    gap: 8px;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 140px;
}

.search-box input::placeholder {
    color: #555;
}

/* ── DROPDOWN ── */
.dropdown-wrap {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 999;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #1C4D8D;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f0f6ff;
}

.dropdown-wrap:hover .dropdown-menu {
    display: block;
}




}
/* ---------------- HERO SECTION ---------------- */
section.hero {
    margin-top: -120px;  /* ปรับตามความสูงของ header */
    position: relative;
    z-index: 1;          /* ต่ำกว่า header (z-index: 9999) */
}

.hero{
    width:100%;
    height:650px;      /* ใช้ height แทน min-height */
    background:url("../images/hero-bg.jpg") center/cover no-repeat;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    margin-top: 0;    /* เพิ่ม */
    padding-top: 0;   /* เพิ่ม */
}


.hero-bg______{
    width:100%;
    background:url("../images/hero-bg.jpg") center/cover no-repeat;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    margin-top: 0;    /* เพิ่ม */
    padding-top: 0;   /* เพิ่ม */
}

.carousel{
    display:flex;
    align-items:center;
    justify-content:center;
}

/* overlay มืด */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
    pointer-events: none;
}

/* ===== SLIDE ===== */

.slide{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
    transition: 0.6s ease;
    z-index: 2;
}

.curricula{
    padding-top: 120px;
}
.slide img{
    width: 450px;
    border-radius: 25px;
}

/* กลาง */
.slide.active{
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 3;
}

/* ซ้าย */
.slide.left{
    transform: translate(-150%, -50%) scale(0.75);
    opacity: 0.6;
}

/* ขวา */
.slide.right{
    transform: translate(50%, -50%) scale(0.75);
    opacity: 0.6;
}

/* ===== ปุ่มซ้ายขวา ===== */

.prev,
.next{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #FFFEEB;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}

.prev{ left: 80px; }
.next{ right: 80px; }

.prev:hover,
.next:hover{
    background: #FFFEEB;
}

/* ===== DOTS ===== */


.dots{
    position:absolute;
    bottom:40px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    gap:8px;
    z-index:50;
}

.dot{
    height: 10px;
    width: 10px;
    margin: 5px;
    background: #FFFEEB;
    opacity: 0.5;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active{
    opacity: 1;
    transform: scale(1.2);
}
/* ================= MOBILE SLIDER FIX ================= */

@media (max-width: 650px){

  /* ลดขนาดรูป */
  .slide img{
      width: 280px;
  }

  /* ปรับตำแหน่ง slide */
  .slide{
      transform: translate(-50%, -50%) scale(0.8);
  }

  .slide.active{
      transform: translate(-50%, -50%) scale(1);
  }

  .slide.left{
      transform: translate(-120%, -50%) scale(0.75);
  }

  .slide.right{
      transform: translate(20%, -50%) scale(0.75);
  }

  /* ปรับปุ่มให้อยู่นอกกรอบรูป */
  .prev{
      left: 10px;
  }

  .next{
      right: 10px;
  }

  /* ลดขนาดปุ่ม */
  .prev,
  .next{
      width: 35px;
      height: 35px;
      font-size: 16px;
  }

}

/* ================= CURRICULA SECTION ================= */

.curricula{
    background: linear-gradient(
        to bottom,
        #1C4D8D 0%,      /* น้ำเงินเข้มบน */
        #6B8BAE 18%,     /* ฟ้า */
        #C7D2DA 35%,     /* ฟ้าเทาอ่อน */
        #DDE3DC 50%,     /* เทากลางเพิ่ม */
        #C7D2DA 65%,     /* เทาอ่อนอีกชั้น */
        #1C4D8D 85%,     /* กลับมาเข้ม */
        #2A2B2C 100%     /* ล่างสุด */
    );
    padding:0px 0 100px;
    text-align:center;
}

/* หัวข้อ */
.curricula-header{
    background: #1C4D8D;
    color: #c2e4f2;
    padding: 15px 40px;
    font-size: 22px;
    font-weight: 500;
    text-align: left;
}

/* กล่องการ์ด */
.curricula-wrapper{
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 60px;
}

/* การ์ด */
.curricula-card{
    background: #EAE3D0;
    width: 250px;
    padding: 60px 20px 30px;
    border-radius: 20px;
    border: 3px solid #FF8246;
    position: relative;
    transition: 0.3s;
}

.curricula-card:hover{
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

/* ไอคอนข้าวหลามตัด */
.icon-box{
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg,#FF9A5A,#FF6A2E);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.icon-box img{
    width: 35px;
    transform: rotate(-45deg);
}

/* ข้อความ */
.curricula-card h3{
    font-size: 16px;
    color: #1C4D8D;
    margin-bottom: 20px;
}

.curricula-card a{
    text-decoration: none;
    color: #1C4D8D;
    font-size: 14px;
    font-weight: 500;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px){

    .curricula-wrapper{
        gap: 60px;
    }

    .curricula-card{
        width: 80%;
    }

}

/* ================= SCHOLARSHIP SECTION ================= */

.scholarship-section{
    position: relative;   /* สำคัญมาก */
    background: linear-gradient(
        to bottom,
        #1c4d8d,
        #FFFFFF
    );
    padding:80px 0;
    overflow: hidden;     /* กันแถบล้น */
}

.scholarship-container{
    width:85%;
    margin:auto;
    display:flex;
    align-items:center;
    gap:60px;
}

/* LEFT SIDE */
.scholarship-left{
    flex:1;
}

.image-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
    background:rgba(255,255,255,0.2);
    padding:20px;
    border-radius:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.3);
}

.image-grid img{
    width:100%;
    height:150px;
    object-fit:cover;
    border-radius:15px;
}

/* RIGHT SIDE */
.scholarship-right{
    flex:1;
}

.scholarship-box{
    border:2px dashed rgba(255,255,255,0.5);
    padding:40px;
    border-radius:20px;
    position:relative;
    color:white;
}

.scholarship-title{
     font-size:15px;
    position:absolute;
    top:-22px;
    left:30px;

    background: linear-gradient(
        to right,
        #2e5f99 0%,     /* น้ำเงินด้านซ้าย */
        #1f4f87 40%,    /* น้ำเงินเข้มขึ้น */
        #1a3e6d 70%,    /* เข้มขึ้นอีก */
        #111111 100%    /* ดำด้านขวา */
    );

    color:white;
    padding:10px 30px;
    border-radius:32px;
    border:1.5px solid white;

    font-weight:600;
    letter-spacing:0.5px;
}

.scholarship-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 0;
    border-bottom:1px solid #1c4d8d;
    font-size:16px;
}

.scholarship-item span{
    background:white;
    color:#2b4f7f;
    width:25px;
    height:25px;
    border-radius:5px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
}

/* ================= RESPONSIVE ================= */

@media(max-width:900px){

    .scholarship-container{
        flex-direction:column;
    }

    .image-grid{
        grid-template-columns:1fr;
    }

}

/* ===== Sharp Bottom Bar ===== */

.scholarship-section{
    position: relative;
}



/* ===== Sharp Top Bar (match screenshot exactly) ===== */

.scholarship-section::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;

    background: linear-gradient(
        to bottom,
        #ebe6d8 0px,
        #ebe6d8 10px,
        #d9d3c4 10px,
        #d9d3c4 22px
    );
}

/* ===== NEWS TABS ===== */

.news-tabs{
    display:flex;
    gap:0;
}

.tab{
    padding:12px 25px;
    border:2px solid #1C4D8D;
    background:#1C4D8D;
    color:white;
    font-weight:500;
    cursor:pointer;
    transition:0.3s;
}

/* ปุ่มแรกโค้งซ้าย */
.tab:first-child{
    border-radius:10px 0 0 0;
}

/* ปุ่มสุดท้ายโค้งขวา */
.tab:last-child{
    border-radius:0 10px 0 0;
}

/* ตอน hover */
.tab:hover{
    background:#2f5f99;
}

/* ===== Active (สีเทา) ===== */

.tab.active{
    background:#D9D9D9;
    color:#1C4D8D;
    border-bottom:2px solid #D9D9D9;
}

/* ===== BAR BETWEEN SCHOLARSHIP AND NEWS ===== */

.news-section{
    position: relative;
}


/* ================= NEWS SECTION ================= */

.news-section{
    background: linear-gradient(to bottom,#5b78a3,#3c5f8f);
    padding:50px 0;
}

.news-container{
    width:85%;
    margin:auto;
    display:flex;
    gap:50px;
}

/* LEFT BOX */
.news-left{
    flex:2;
    background:#fffeeb;
    padding:35px 40px;
    border-radius:35px;
    box-shadow:0 25px 40px rgba(0,0,0,0.35);
}

/* ===== TABS ===== */

.news-tabs{
    display:flex;
    margin-bottom:30px;
}

.tab{
    padding:14px 28px;
    background:#1C4D8D;
    color:white;
    border:none;
    cursor:pointer;
    font-weight:500;
    border-right:1px solid rgba(255,255,255,0.2);
}

.tab:first-child{
    border-radius:10px 0 0 0;
}

.tab:last-child{
    border-radius:0 10px 0 0;
}

.tab.active{
    background:#D9D9D9;
    color:#1C4D8D;
    font-weight:600;
}

/* ===== NEWS ITEM ===== */

.news-item{
    display:flex;
    align-items:flex-start;
    gap:20px;
    margin-bottom:28px;
}

.news-item img{
    width:140px;
    height:140px;
    object-fit:cover;
    border-radius:18px;
}

.news-content h4{
    margin:0 0 8px 0;
    color:#1C4D8D;
    font-size:17px;
    line-height:1.4;
}

.date{
    font-size:14px;
    color:#5a5a5a;
}

/* RIGHT SIDE */

.news-right{
    flex:1;
    display:flex;
    flex-direction:column;
    padding-top:150px;  
    gap:35px;
}

.video-card{
    border-radius:20px;
    overflow:hidden;
    box-shadow:0 15px 30px rgba(0,0,0,0.4);
    position:relative;
}

.video-card img{
    width:100%;
    display:block;
}

.video-title{
    position:absolute;
    top:0;
    left:0;
     width:100%;
    padding:12px 22px;
    background:linear-gradient(to right,#ff7b39,#000);
    color:white;
    font-weight:600;
    font-size:14px;
}

/* BOTTOM BUTTONS */

.news-bottom{
    margin-top:50px;
    text-align:center;
}

.search-btn{
    padding:12px 25px;
    border-radius:30px;
    border:2px solid #1C4D8D;
    background:#f5f5f5;
    color:#1C4D8D;
    font-weight:500;
    margin-right:15px;
    cursor:pointer;
}

.view-btn{
    padding:12px 35px;
    border-radius:30px;
    border:none;
    background: linear-gradient(
        to right,
        #7EA6D8 0%,     /* ฟ้าอ่อน */
        #4C6FA3 50%,    /* กลาง */
        #2B4F7F 100%    /* น้ำเงินเข้ม */
    );
    color:white;
    font-weight:500;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,0.25);
    transition:0.3s;
}

.view-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 25px rgba(0,0,0,0.35);
}

.section-divider{
    height: 40px;
    margin-top: 20px; 
    background: linear-gradient(
        to bottom,
        #0e2a4a 0%,
        #1f4f87 40%,
        #0a1f3a 70%,
        #000000 100%
    );
}
/* ===== MOBILE LAYOUT ===== */

@media(max-width: 768px){

    .news-container{
        flex-direction: column;   /* 👈 เปลี่ยนจากซ้าย-ขวา เป็นบน-ล่าง */
    }

    .news-right{
        margin-top: 40px;         /* 👈 เว้นระยะจากข่าว */
        padding-top: 0;           /* เอา padding-top เดิมออก */
    }

}

.news-bottom-wrapper{
    background: #fffeeb;
    padding: 10px 0 15px 0;
    text-align: center;
}

.news-bottom{
    display: flex;
    justify-content: center;
    gap: 20px;
}
.bottom-dark-bar{
    height:40px;
    margin-top: 20px; 
    background: linear-gradient(
        to bottom,
        #0b1f36 0%,
        #123b66 40%,
        #0b1f36 70%,
        #000000 100%
    );
}

/* ================= OUTSTANDING PROJECTS ================= */

.projects-section{
    background: linear-gradient(
        to bottom,
        #2b4f7f 0%,
        #ffffff 40%,
        #193b66 100%
    );
    padding:0px 0;
    text-align:center;
}

.projects-header{
    background:#1c4d8d;
    color:#c2e4f2;
    font-size:22px;
    padding:20px 60px;
    text-align:left;
    font-weight:500;
}

.projects-wrapper{
    position:relative;
    width:85%;
    margin:60px auto 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
}



.project-card{
    background:#FFFEEB;
    width:400px;
    padding:20px;
    border-radius:25px;
    box-shadow:0 20px 40px rgba(0,0,0,0.35);
    transition:0.3s;
}

.project-card:hover{
    transform:translateY(-10px);
}

.project-card img{
    width:100%;
    height:220px;
    object-fit:cover;
    border-radius:18px;
}

.project-card h4{
    margin:15px 0 10px 0;
    color:#2b4f7f;
    font-size:16px;
}

.project-card p{
    font-size:14px;
    color:#444;
}

/* ปุ่มลูกศร */

.project-prev,
.project-next{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:#d9d9d9;
    border:none;
    width:45px;
    height:45px;
    border-radius:50%;
    cursor:pointer;
    font-size:18px;
    box-shadow:0 5px 15px rgba(0,0,0,0.2);
}

.project-prev{
    left:-20px;
}

.project-next{
    right:-20px;
}

.project-prev:hover,
.project-next:hover{
    background:white;
}
.projects-viewport{
    overflow:hidden;
    width:1050px;   /* กว้างพอดีกับ 3 การ์ด */
}

.projects-track{
    display:flex;
    gap:40px;
    transition: transform 0.5s ease;
}

.project-card{
    min-width:280px;
    background:#FFFEEB;
    padding:20px;
    border-radius:25px;
    box-shadow:0 20px 40px rgba(0,0,0,0.35);
}

/* ===== PROJECTS RESPONSIVE ===== */

@media (max-width: 768px){

    .projects-viewport{
        width: 400px;   /* เท่ากับการ์ด 1 ใบ */
        margin: auto;
    }

    .project-card{
        width: 400px;
    }

    .projects-wrapper{
        justify-content: center;
    }

    .project-prev{
        left: -10px;
    }

    .project-next{
        right: -10px;
    }
}
.bottom-orange-bar{
    height: 50px;
    width: 100%;
    margin-top: 40px;
    background:
        radial-gradient(
            ellipse at center,
            rgba(255,120,0,0.9) 0%,
            rgba(255,120,0,0.6) 25%,
            rgba(255,120,0,0.3) 40%,
            rgba(0,0,0,0.9) 70%,
            rgba(0,0,0,1) 100%
        ),
        linear-gradient(
            to bottom,
            #000000 0%,
            #000000 100%
        );
}

/* ================= CONTACT SECTION ================= */

.contact-section{
    background:#cbcbcb;
    padding:0px 0;
}

.contact-container{
    width:85%;
    margin:auto;
    display:flex;
    justify-content:space-between;
    gap:80px;
}

/* LEFT */

.contact-left{
    flex:1;
     text-align:left; 
}

.contact-header{
    display:flex;
    align-items:center;
    gap:20px;
    margin-bottom:30px;
}

.contact-header h2{
    color:#1c4d8d;
    font-weight:600;
}

.contact-line{
    height:2px;
    width:120px;
    background:#1c4d8d;
}

.contact-left h3{
    color:#ff8246;
    margin-bottom:20px;
}

.contact-left p{
    color:#1c4d8d;
    line-height:1.7;
    margin-bottom:20px;
}

.contact-info strong{
    color:#ff8246;
}

/* RIGHT */

.contact-right{
    flex:1;
    text-align:center;
}

.contact-right img{
    width:100%;
    border-radius:20px;
    box-shadow:0 15px 40px rgba(0,0,0,0.3);
    transition:0.4s;
}

.contact-right img:hover{
    transform:scale(1.03);
}

.social-icons{
    text-align:right;
    margin-bottom:20px;
}

.social-icons i{
    font-size:22px;
    margin-left:15px;
    color:#2b4f7f;
    cursor:pointer;
    transition:0.3s;
}

.social-icons i:hover{
    color:#ff6a00;
}

.map-btn{
    display:inline-block;
    margin-top:25px;
    padding:12px 30px;
    border-radius:25px;
    background:#2b4f7f;
    color:#c2e4f2;
    text-decoration:none;
    font-weight:500;
    transition:0.3s;
}

.map-btn:hover{
    background:#1c3d66;
    transform:translateY(-3px);
}
@media(max-width: 900px){

    .contact-container{
        flex-direction:column;
        text-align:center;
    }

    .social-icons{
        text-align:center;
    }

    .contact-header{
        justify-content:center;
    }
}

/* เส้นคั่นล่าง */
.contact-section{
    position: relative;
    padding-bottom: 80px;  /* เว้นที่ให้ปุ่ม */
}

.contact-section::after{
    content: "";
    position: absolute;
    bottom: 0;
    margin: 0 auto 40px auto;
    left: 5%;
    width: 90%;
    height: 2px;
    background: #2b4f7f;
}

/* ================= CURRICULUM POPUP ================= */

.curriculum-popup{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 9999;
}

.curriculum-popup.show{
    opacity: 1;
    visibility: visible;
}

.popup-card{
    width: 600px;
    background: #C2E4F2;
    border-radius: 40px;
    padding: 60px 50px;
    border: 6px solid #1c4d8d;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: popupFade 0.4s ease;
}

/* ปุ่มปิด */
.popup-close{
    position: absolute;
    top: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    border-radius: 15px;
    border: 2px solid #1c4d8d;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: #1c4d8d;
}

/* หัวข้อ */
.popup-main-title{
    text-align: center;
    color: #1c4d8d;
    font-size: 28px;
    margin-bottom: 40px;
}

/* เนื้อหา */
.popup-content p{
    font-size: 20px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.label{
    color: #1c4d8d;
    margin-right: 10px;
}

.highlight{
    color: #ff8246;
    font-weight: 500;
}

/* animation */
@keyframes popupFade{
    from{
        transform: translateY(-30px);
        opacity: 0;
    }
    to{
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media(max-width: 768px){
    .popup-card{
        width: 90%;
        padding: 40px 25px;
    }

    .popup-content p{
        font-size: 16px;
    }
}

/* ================= ALL NEWS POPUP ================= */

.allnews-popup{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 9999;
}

.allnews-popup.show{
    opacity: 1;
    visibility: visible;
}

.allnews-card{
    width: 700px;
    max-height: 90vh;
    overflow-y: auto;
     text-align: left;
    padding: 50px;
    border-radius: 40px;
    background: linear-gradient(
        to bottom,
        #9fb3c8,
        #2b4f7f,
        #111
    );
    color: white;
    position: relative;
}

.allnews-close{
    position: absolute;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    border: 2px solid #2b4f7f;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #2b4f7f;
}

.allnews-list .news-item{
    margin-bottom: 30px;
}

.allnews-list .news-item img{
    width: 130px;
    height: 130px;
}

.allnews-list .news-content h4{
    color: #fffeeb;   /* เปลี่ยนเป็นสีที่ต้องการ */
}

.allnews-list .date{
    color: #FFfeeb;   /* เช่นสีส้มอ่อน */
}

.inline-search{
    display: flex;
    gap: 10px;
}

.inline-search input{
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid #1C4D8D;
    outline: none;
    width: 220px;
}

.inline-search button{
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    background: #1C4D8D;
    color: white;
    cursor: pointer;
}

.scholarship-item{
    text-decoration: none;
    color: white;
}

.scholarship-item:hover{
    color: #FF8246;
}

html {
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 120px;
}

.pdf-btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 25px;
    background: #1c4d8d;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.pdf-btn:hover {
    background: #163b6b;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE FIXES — เพิ่มต่อท้าย main.css
   ═══════════════════════════════════════════════════ */

/* ── 1. TOP BAR ── */
@media (max-width: 650px) {
    .top-bar { padding: 12px 16px 35px; gap: 12px; }
    .logo { height: 42px; }
    .title { font-size: 13px; }
    .subtitle { font-size: 11px; }
}

/* ── 2. HERO SECTION ── */
@media (max-width: 650px) {
    section.hero { margin-top: -80px; }   /* แก้จาก -120px */
    .hero { height: 420px; }
    .slide img { width: 240px; }
    .prev { left: 8px; }
    .next { right: 8px; }
}

/* ── 3. CURRICULA SECTION ── */
@media (max-width: 650px) {
    .curricula { padding-top: 80px; }
    .curricula-wrapper { gap: 70px; padding: 0 20px; }
    .curricula-card { width: calc(100% - 40px); }
}

/* ── 4. SCHOLARSHIP SECTION ── */
@media (max-width: 650px) {
    .scholarship-section { padding: 50px 0; }
    .scholarship-container { width: 90%; gap: 30px; }
    .image-grid img { height: 110px; }
    .scholarship-box { padding: 30px 20px; }
    .scholarship-title { font-size: 13px; padding: 8px 20px; }
    .scholarship-item { font-size: 14px; padding: 16px 0; }
}

/* ── 5. NEWS SECTION ── */
@media (max-width: 768px) {
    .news-left { padding: 25px 20px; border-radius: 20px; }
    .news-right { padding-top: 0; margin-top: 20px; }  /* แก้ padding-top: 150px */
    .news-item img { width: 90px; height: 90px; border-radius: 12px; }
    .news-content h4 { font-size: 14px; }
    .tab { padding: 10px 14px; font-size: 13px; }
}
@media (max-width: 480px) {
    .news-container { width: 92%; }
    .news-item img { width: 70px; height: 70px; }
}

/* ── 6. PROJECTS SECTION ── */
@media (max-width: 768px) {
    .projects-viewport {
        width: calc(100vw - 80px);
        max-width: 380px;
    }
    .project-card {
        min-width: calc(100vw - 80px);
        max-width: 380px;
        width: auto;
    }
    .projects-wrapper { width: 92%; }
    .project-prev { left: -15px; }
    .project-next { right: -15px; }
}
@media (max-width: 480px) {
    .projects-viewport { width: calc(100vw - 60px); }
    .project-card { min-width: calc(100vw - 60px); }
}

/* ── 7. CONTACT SECTION ── */
@media (max-width: 900px) {
    .contact-container { gap: 30px; padding: 40px 0; }
}
@media (max-width: 650px) {
    .contact-container { width: 90%; gap: 20px; }
}

/* ── 8. POPUP ── */
@media (max-width: 480px) {
    .popup-card { width: 88%; padding: 35px 20px; border-radius: 25px; }
    .popup-main-title { font-size: 20px; }
    .allnews-card { width: 88%; padding: 35px 20px; }
}

/* --- ย้ายมาไว้นอก @media เพื่อให้ทำงานทุกขนาดหน้าจอ --- */

/* 1. บังคับซ่อน sub-menu ในแฮมเบอร์เกอร์เริ่มต้น (ทุกขนาดจอ) */
#subMenu {
    display: none !important; 
}

/* 2. แสดงผลเฉพาะตอนที่ได้รับคลาส 'open' จาก JavaScript เท่านั้น */
#subMenu.open {
    display: flex !important; 
    flex-direction: column;
    padding-left: 20px;
    background: rgba(0, 0, 0, 0.1);
}

/* ปรับแต่งลิงก์ข้างใน sub-menu ให้ดูดีขึ้น */
#subMenu a {
    font-size: 15px !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}


