* { 
    font-family: "Noto Sans Lao", sans-serif;
    font-optical-sizing: auto;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html{
    font-style: normal;
    margin: auto;
    width: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* contract school */
.contract{
    display: flex;
    justify-content: start;
    position: relative;
    z-index: 10;
    background: rgb(5, 188, 188);
}
.contract img{
    padding-top: 0.1rem;
    border-radius: 100%;
    width: 2rem;
    margin: 0.5rem;
}

/* logo and menu */
/* logo */
nav{
    background: white;
    top: 0;
    left: 0;
    position: sticky;

    z-index: 1000;

    display: flex;
    padding: 0.5rem;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px -5px black ;
    z-index: 1000;
}
.logo{
    display:flex;
    align-items: center;
    padding-left: 0.5rem;
}
.logo h2{
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: clamp(0.5rem,calc(5vh+1rem),1.2rem);
    padding: min(0.5em);
    margin: 0;
    line-height: 1.2;
}
.logo a img{
    display: block;
    border-radius: 100%;
    width: 100px;
}
/* menu */
.allmenu{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    position: relative;
}
.menu{
    position: relative;
    margin-right: 2rem;
}
.menu-btn{
    font-size: 1.2rem;
    text-decoration: none;
    border: none;
    background: white;
    cursor: pointer;
    position: relative;
}
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dropdown{
    position: absolute;
    color: black;
    left: auto;
    margin: 0;
    border-top: 2px solid blue;
    width: 10rem;
    
    overflow-wrap: break-word;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease ;
    background:white;
}
.dropdown li{
    padding-top: 5px;
}
a{
    font-size: 1.2rem;
    color: black;
    text-decoration: none;
}
.menu:hover .dropdown{
    opacity: 1;
    transform: translateY(0);
}
.hamburger{
    display: none;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    align-items: center;
}
.overlay{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    pointer-events: none;
    transition:  0.3s;
}
.overlay.show{
    opacity: 0.3;
    pointer-events: auto;
}
@media(max-width:768px){
    .hamburger{
        display: block;
        padding: 1rem;
    }
    .allmenu{
        position: fixed;
        top: 0;
        right: -260px;
        width: 260px;
        height:100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        transition: 0.3s;
        z-index: 10000;
        overflow-y:auto ;
    }

    /* open menu */
    .allmenu.show{
        right: 0;
    }
    
    .dropdown{
    position: relative;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3 ease;
    background: white;
    }

    
    #btn-active{
    color: black;
    padding-bottom: 0.1rem;
    border-bottom: none;
    }
    .dropdown.show{
        max-height: 300px;
        opacity: 1;
        transform: translateY(0);
    }
}
/* main */
/* content of picture */
.slider {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.slide {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 1s ease-in-out;
}

/* แต่ละรูปต้องมีขนาดคงที่ */
.slide img {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;  /* ← ครอบรูปให้พอดีโดยไม่บิดเบี้ยว */
    flex-shrink: 0;
}

/* ปุ่มไม่ขยับตามรูป */
.btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.btn button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: all;
    background: rgba(255,255,255,0.3);
    color: white;
    border: 2px solid white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.3s;
    z-index: 10;
}

.btn button:hover {
    background: rgba(255,255,255,0.6);
    color: black;
}

.prev { left: 15px; }
.next { right: 15px; }

/* our value */
.text-of-value{
    display: block;
    position: relative;
    margin: 1rem;
    border-bottom: 2px solid blue;
}
.value{
    top: 0;
    margin: 2rem;

    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
}
.card {
    position: relative;
    width: 32%;
    height: 300px;
    overflow: hidden;
}
@media(max-width:768px) {
    .value{
        justify-content: center;
    }
    .card{
        width: 80vw;   
    }
}
/* รูป */
.bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* โลโก้ + ไตเติ้ล */
.header {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 10px;
    transition: 0.4s ease;
    z-index: 2;
}

.logoa {
    width: 30px;
}

.title {
    margin-left: 8px;
    font-weight: bold;
    color: black;
}

/* คำบรรยายเต็มรูป */
.desc {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 20px;

    transform: translateY(100%);
    transition: 0.4s ease;
}

/* ===== hover ===== */

.card:hover .desc {
    transform: translateY(0);
}

.card:hover .header {
    background: transparent;
}

.card:hover .title {
    color: white;
}
/* ===== NEWS ===== */
.feature-news {
    padding: 2rem;
    background: #f5f5f5;
}

.feature-news h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: black;
    border-bottom: 3px solid rgb(5,188,188);
    padding-bottom: 0.5rem;
}

.news-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.newscontainer {
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 1rem 0;
    flex: 1;
}

.newscontainer::-webkit-scrollbar { display: none; }

/* ── กล่อง news เหมือน event-card ── */
.news-card {
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 300px;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* รูป 4:3 */
.news-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.news-card h3 {
    padding: 0.8rem 1rem 0.3rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card p {
    padding: 0 1rem;
    font-size: 0.85rem;
    color: gray;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card a {
    display: inline-block;
    margin: 0.8rem 1rem;
    padding: 0.4rem 1rem;
    background: rgb(5,188,188);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
    align-self: flex-start;
    margin-top: auto;
}
.news-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.news-card a:hover { background: rgb(3,150,150); }

/* ── ปุ่มเลื่อน ── */
.news-prev,
.news-next {
    background: rgb(5,188,188);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s;
}
.news-prev:hover,
.news-next:hover { background: rgb(3,150,150); }

@media (max-width: 768px) {
    .news-card {
        min-width: 220px;
        max-width: 220px;
    }
    .news-prev,
    .news-next {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .news-card {
        min-width: 200px;
    }
    .news-prev,
    .news-next {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
/* ===== EVENT ===== */
.event-section {
    padding: 2rem;
    background: white;
}

.event-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: black;
    border-bottom: 3px solid rgb(5,188,188);
    padding-bottom: 0.5rem;
}

/* wrapper */
.event-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* slider */
.event-slider {
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    flex: 1;
    padding: 1rem 0;

    align-items: stretch; /* สำคัญมาก */
}

/* CARD */
.event-card {
    display: flex;
    flex-direction: column;

    flex: 0 0 300px;   /* คุมขนาดคงที่ */
    min-width: 300px;
    max-width: 300px;

    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);

    transition: transform 0.3s, box-shadow 0.3s;
}

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

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

/* no image */
.event-card-noimg {
    width: 100%;
    height: 200px;
    background: #f0fafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* BODY */
.event-card-body {
    padding: 1rem;

    display: flex;
    flex-direction: column;
    flex: 1; /* ดันปุ่มลงล่าง */
}

/* TITLE */
.event-card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* DESCRIPTION */
.event-card-body p {
    font-size: 0.85rem;
    color: gray;
    line-height: 1.5;
    margin-bottom: 0.8rem;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* BUTTON */
.event-read-btn {
    margin-top: auto; /* ดันลงล่าง */
    align-self: flex-start;

    padding: 0.4rem 1rem;
    background: rgb(5,188,188);
    color: white;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
}

.event-read-btn:hover {
    background: rgb(3,150,150);
}

/* SLIDER BUTTON */
.slider-btn {
    background: rgb(5,188,188);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
}

.slider-btn:hover {
    background: rgb(3,150,150);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .event-card {
        flex: 0 0 220px;
        min-width: 220px;
        max-width: 220px;
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
.poster-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.poster-box {
    position: relative;
    max-width: 500px;
    width: 90%;
}

.poster-box img {
    width: 100%;
    border-radius: 12px;
}

.poster-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10000;
}

/* ปรับขนาดสำหรับมือถือ */
@media (max-width: 600px) {
    .poster-box {
        max-width: 90%;
    }
    .poster-close {
        right: -10px;
        top: -10px;
    }
}
/* footer */
.footer{
    padding: 2rem;
    background: blue;
    color: aliceblue;
    border-top: 4px solid white;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.footer-logo img {
    border-radius: 100%;
    width: 10rem;
}

/* text footer */

.text-address-phone{
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.phone-address{
    font-size: 1.2rem;
}

.text-contract-email{
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.2rem;
}

.email{
    font-size: 0.8rem;
}