body{
    margin:0;
    /*font-family: "Sarabun",sans-serif;*/
    /* Sarabun  Kanit  Chonburi   Mali  Taviraj   */
    font-family: "Kanit",sans-serif;
    background:linear-gradient(135deg,#f0f4ff,#e6ecff);
    text-align:center;
}

/* ส่วนหัวเว็บ */
.header{
    background: linear-gradient(135deg,#0033cc,#4a6cff,#7ea2ff);
    color:white;
    padding:30px 20px;
    box-shadow:0 6px 20px rgba(0,0,0,0.25);
}

.header-box{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:20px;
}
.corner-ribbon{
    position: fixed;
    top: 0;
    right: 0;
    width: 140px;
    transform: rotate(0deg);
    z-index: 9999;
}


/* โลโก้ */
.logo{
    width:110px;
    height:auto;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4));
}

/* กล่องข้อความ */
.header-text{
    text-align:left;
}

/* ชื่อโรงเรียน */
.school-name{
    font-size:52px;
    font-weight:bold;
    letter-spacing:1px;
    text-shadow:3px 3px 10px rgba(0,0,0,0.8);
}

/* จังหวัด */
.province{
    font-size:34px;
    text-shadow:3px 3px 10px rgba(0,0,0,0.8);
}

/* ภาพหลัก */

.hero img{
    width:100%;
    max-width:1000px;
    border-radius:15px;
    margin-top:20px;
    box-shadow:0 10px 30px rgba(0,0,0,.2);
}


    /* เมนูหลัก - ใช้ div container */
        
        .menu-container {
            /*background: white;
            border-radius: 60px;
            box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15);
            padding: 0 20px;
            width: 100%;
            max-width: 1200px;
            transition: all 0.3s ease;*/

            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1.2rem;
            list-style: none;
            margin: 0;
            padding: 0.5rem 0 0.8rem 0;
        }

        

/* ปุ่มเมนู */

.menu-grid{
    width:90%;
    max-width:600px;
    margin:auto;
    margin-top:30px;
    display:grid;
    /*grid-template-columns: repeat(2, 1fr);*/
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
}

.menu-grid img{
    width:100%;
    border-radius:10px;
    cursor:pointer;
    transition:0.3s;
    box-shadow:0 6px 15px rgba(0,0,0,.2);
}

.menu-grid img:hover{
    transform:scale(1.07);
    box-shadow:0 10px 25px rgba(0,0,0,.35);
}

/* ข่าว */

.news22 img{
    width:70%;
    max-width:460px;
    margin-top:40px;
    border-radius:12px;
    transition:.3s;
    box-shadow:0 8px 20px rgba(0,0,0,.25);
}
.news22 img:hover{
    transform:scale(1.05);
}
.news img{
    width:80%;
    max-width:700px;
    margin-top:40px;
    border-radius:12px;
    box-shadow:0 8px 20px rgba(0,0,0,.25);
}

.news-slider{
    position:relative;
    max-width:580px;
    margin:40px auto;
    overflow:hidden;
    border-radius:14px;
    box-shadow:0 10px 30px rgba(0,0,0,.3);
}
.slide{
    position:absolute;
    width:100%;
    height: 400px;
    opacity:0;
    transition:opacity 1s ease;
}

.slide.active{
    opacity:1;
    position:relative;
}

/* zoom */
.slide img{
    width:100%;
    transition:transform 8s ease;
}

.slide.active img{
    transform:scale(1.05);
}

/* caption */

.caption{
    position:absolute;
    bottom:20px;
    left:20px;
    right:20px;
    background:rgba(0,0,0,.45);
    color:white;
    padding:12px;
    border-radius:8px;
}

.news-title{
    font-size:20px;
    font-weight:bold;
}

.news-date{
    font-size:14px;
    opacity:.9;
}

/* buttons */

.prev,.next{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:rgba(0,0,0,.5);
    color:white;
    border:none;
    font-size:30px;
    padding:10px 15px;
    cursor:pointer;
}

.prev{left:10px;}
.next{right:10px;}

/* dots */

.dots{
    text-align:center;
    padding:12px;
}

.dot{
    height:20px;
    width:20px;
    margin:5px;
    border-radius:50%;
    background:#bbb;
    display:inline-block;
    cursor:pointer;
}

.dot.active{
    background: #ff6a00;
}

/* popup */

.popup{
    display:none;
    position:fixed;
    z-index:9999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.9);
    text-align:center;
}

.popup img{
    max-width:90%;
    max-height:90%;
    margin-top:3%;
    border-radius:10px;
}

.close{
    position:absolute;
    top:20px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
}

/* mobile */

@media(max-width:768px){

.news-title{
    font-size:16px;
}

.prev,.next{
    font-size:22px;
}

}


/* popup */

.img-popup{
    display:none;
    position:fixed;
    z-index:9999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.9);
    text-align:center;
}

.img-popup img{
    max-width:90%;
    max-height:90%;
    margin-top:3%;
    border-radius:10px;
}

.popup-close{
    position:absolute;
    top:20px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
}
/* fb-yt    */

.social-row{

max-width:1200px;

margin:40px auto;

display:flex;

gap:30px;

align-items:stretch;

justify-content:center;

}

/* กล่อง */

.social-box{

flex:1;
max-width:480px;
display:flex;

}

/* ทำให้สูงเท่ากัน */

.social-box > *{
width:90%;

}

/* มือถือ */

@media(max-width:900px){

.social-row{

flex-direction:column;

}

}


/* ปุ่มยาว */

.bigmenu{
    margin-top:40px;
}

.bigmenu img{
    width:80%;
    max-width:600px;
    margin:10px;
    border-radius:10px;
    transition:.3s;
    box-shadow:0 6px 15px rgba(0,0,0,.2);
}

.bigmenu img:hover{
    transform:scale(1.05);
}

/* footer */

.footer-sch{
    text-align:center;
    color: #777;
    font-size:18px;
    margin-top:30px;
    padding-top:12px;
    border-top:1px solid #ddd;
}

.footer{
    text-align:center;
    color:white;
    background:linear-gradient(135deg, #4facfe, #00f2fe);
    font-size:18px;
    margin-top:30px;
    padding:12px;
    border-radius:8px;
    text-shadow: 2px 2px 2px rgba(2, 5, 155, 0.4);
}

/* footer */
.footer-som{
    margin-top:35px;

    padding:15px;

    font-size:18px;

    text-align:center;

    color:white;

    font-weight:bold;

    text-shadow:1px 1px 4px rgba(0,0,0,.5);
}

/*.counter{
    margin-top:20px;
}*/

.menu-box{
    text-align:center;
    margin:30px auto;
}

.menu-box a{
    display:inline-block;
    margin:10px;
}

.thumbnail{
    width:300px;
    height:80px;
    border-radius:8px;
    transition:0.3s;
    box-shadow:0 4px 10px rgba(0,0,0,0.2);
}

.thumbnail:hover{
    transform:scale(1.08);
    box-shadow:0 8px 20px rgba(0,0,0,0.3);
}

.popup{
    display:none;
    position:fixed;
    z-index:9999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.85);
    justify-content:center;
    align-items:center;
}

.popup-box{
    position:relative;
    width:80%;
    max-width:900px;
    animation:zoomIn .35s ease;
}

.popup-box video{
    width:100%;
    height:auto;
    display:block;
    border-radius:12px;
}

.close-btn{
    position:absolute;
    top:-20px;
    right:-20px;
    width:40px;
    height:40px;
    background:white;
    border-radius:50%;
    font-size:28px;
    text-align:center;
    line-height:38px;
    cursor:pointer;
    box-shadow:0 5px 15px rgba(0,0,0,.4);
}


@keyframes zoomIn{
    from{
        transform:scale(.6);
        opacity:0;
    }
    to{
        transform:scale(1);
        opacity:1;
    }
}

/* มือถือ */
@media (max-width:768px){

.header-box{
    flex-direction:column;
    text-align:center;
}

.header-text{
    text-align:center;
}

.logo{
    width:100px;
}

.school-name{
    font-size:22px;
    text-shadow: 
        1px 1px 0 #f804af,
        2px 2px 3px rgba(0,0,0,0.4);
}

.province{
    font-size:18px;
}

}

.digital-clock-container{
    background: linear-gradient(135deg,#1404f7,#010b64);
    justify-content: center;
    /*font-family: "Kanit",sans-serif;*/
    /*font-family: "Sarabun",sans-serif;*/
    color: #f5f5f2;
    text-align:center;
    padding:16px 10px;
    box-shadow:0 6px 15px rgba(0,0,0,0.25);
     /* เพิ่ม 3 บรรทัดนี้ */
    /*font-size: clamp(1rem, 4vw, 3rem); /* ย่อขยายขนาดอักษรตามความกว้างจออัตโนมัติ */
    white-space: nowrap;                 /* บังคับให้อยู่บรรทัดเดียว ห้ามขึ้นบรรทัดใหม่ */
    overflow: hidden;                    /* ป้องกันข้อความล้นทะลักออกนอกกรอบ */
    font-size: 3.5rem; /* ขนาดปกติบนจอคอมพิวเตอร์ */
}

.thai-datetime{
    font-size:26px;
    font-weight:bold;
    letter-spacing:2px;
    font-family: "Kanit",sans-serif;
    /*font-family:'Courier New', monospace;*/
    text-shadow:0 0 10px rgba(255,255,255,0.8);
}

@media (max-width:480px){
    .digital-clock-container{
        /*font-size: 1.5rem; /* ปรับลดขนาดลงให้พอดีกับจอโทรศัพท์ของคุณ */
        padding:8px 4px; /* ลด padding ซ้ายขวาลงอีกเพื่อให้มีพื้นที่แสดงข้อความ */
    }

    .thai-datetime{
        /*font-size:18px;*/
        /* ปรับลดช่วงขนาดลงมาเป็น 12px ถึง 18px และลด % หน้าจอเหลือ 4vw */
        font-size: clamp(12px, 4vw, 18px); 
        letter-spacing: 0px; /* ยกเลิกการเว้นวรรคระหว่างตัวอักษรเพื่อประหยัดพื้นที่ */
        
    }
}


/* กล่อง */
.counter-box{
    background: rgba(255,255,255,0.1);
    padding:5px 25px;    /* 🔥 ปรับความสูง/ความหนา */
    border-radius:20px;
    text-align:center;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    color: #1f06f8;
    animation: fadeIn 1s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); 
}

/* ตัวเลข */
.count-number{
    font-size:28px;
    font-weight:bold;
    margin-top:10px;
    letter-spacing:2px;
    color: #faf603;
    animation: pop 0.5s ease;
    text-shadow: 
    1px 1px 0px #fa0d05, /* ขอบสีส้มทอง */
    0 0 12px rgba(255, 170, 0, 0.6), /* ไฮไลท์ส้มฟุ้ง */
    3px 3px 5px rgba(0, 0, 0, 0.9); /* เงาดำเข้ม */
    /*-webkit-text-stroke: 0.1px #000; *//* ตัดขอบดำรอบตัวอักษร 1 พิกเซล */
}
.counter-box h1{
    font-size: 28px;
    margin-bottom: 15px;
}

.count-item{
    font-size: 18px;
    margin: 8px 0;
}

.navbar{
    background: #111111;
    display:flex;
    justify-content: space-around;
    /*justify-content: space-between;
    /*justify-content:center;*/

    flex-wrap:wrap;
    box-shadow:0 2px 10px rgba(0,0,0,.2);
}

.dropdown{
    position:relative;
}

.dropbtn{
    background:none;
    border:none;
    font-family: "Kanit",sans-serif;
    font-weight:bold;
    color: #fff;
    padding:15px 20px;
    font-size:20px;
    cursor:pointer;
    transition:.3s;
}

.dropbtn:hover{
    background:#f8034d;
    border-radius:10px;
}

.dropdown-content{
    display:none;
    position:absolute;
    background:#e0e0e0;
    min-width:260px;
    box-shadow:0 5px 15px rgba(0,0,0,.2);
    z-index:999;
    border-radius:0 0 8px 8px;
}

.dropdown-content a{
    color: #0c0c0c;
    padding:12px 16px;
    text-decoration:none;
    display:block;
    border-bottom:1px solid #eee;
    text-align:left;
}

.dropdown-content a:hover{
    background:#f5f5f5;
    color: #fa042d;
    
}

.dropdown:hover .dropdown-content{
    display:block;
}

/* มือถือ */
@media(max-width:768px){

    .navbar{
        flex-direction:column;
    }

    .dropdown{
        width:100%;
    }

    .dropbtn{
        width:100%;
        text-align:left;
    }

    .dropdown-content{
        position:static;
        width:100%;
        box-shadow:none;
    }
}