/* ====== Google Font ====== */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Prompt',sans-serif;
}

body{
    background:#d9c9ef;
    color:#222;
}

/* ====== Banner ====== */
.banner{
    width:100%;
    height:320px;
    background:url("images/banner.jpg") center center/cover no-repeat;
    position:relative;
}

.banner::before{
    content:"";
    position:absolute;
    inset:0;
    background:rgba(65,20,120,.35);
}

.banner-text{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    text-align:center;
    color:#fff;
}

.banner-text h1{
    font-size:42px;
    text-shadow:2px 2px 8px #000;
}

.banner-text p{
    margin-top:10px;
    font-size:18px;
}

/* ====== เมนูด้านบน ====== */
nav{
    background:#ffa50c; /* ====== สีเมนูแถบยาว ====== */
    box-shadow:0 3px 10px rgba(0,0,0,.2);
    position: sticky;
    top: 0;
    z-index: 9999;
}

nav ul{
    display:flex;
    justify-content:center;
    list-style:none;
}

nav ul li{
    position:relative;
}

nav ul li a{
    display:block;
    padding:18px 28px;
    color:#401364; /* ====== สีตัวอักษรเมนูบน ====== */
    text-decoration:none;
    font-weight:600;
    transition:.3s;
}

nav ul li:hover{
    background:#401364; /* ====== สีแถบย่อยเมนูบน ====== */
}

nav ul li:hover>a{
    color:#ffa50c; /* ====== สีตัวอักษรแถบย่อยเมนูบน ====== */
}

/* Dropdown */
nav ul li ul{
    display:none;
    position:absolute;
    background:#ffa50c; /* ====== สีพื้นหลังแถบย่อยเมนูบน ====== */
    width:240px;
    top:100%;
    left:0;
}

nav ul li:hover ul{
    display:block;
}

nav ul li ul li{
    width:100%;
}

/* ====== Layout ====== */
.container{
    display: flex;
    gap: 25px;
    padding: 25px;
    align-items: flex-start;
}

/* ====== เมนูซ้าย ====== */
.sidebar{
    width:290px;
    align-self:flex-start;
}

.box{
    background:#401364;
    border-radius:18px;
    margin-bottom:25px;
    overflow:hidden;
    box-shadow:0 8px 15px rgba(0,0,0,.2);

}

.box-title{
    background:#ffa50c;
    color:#222;
    font-weight:bold;
    font-size:24px;
    padding:14px;
    text-align: center; /* ====== หัวข้อเมนูซ้ายอยู่ตรงกลาง ====== */
    border-radius:50 0 25px 0;
}

.box ul{
    list-style:none;
    padding:14px;
}

.box ul li{
    margin:5px 0;
}

.box ul li a{
    color:#ffa50c;
    text-decoration:none;
    transition:.3s;
}

.box ul li a:hover{
    color:white;
    padding-left:8px;
}

/* ====== เนื้อหา ====== */
.content{
    flex:1;
    background:white;
    border-radius:18px;
    padding:30px;
    min-height:1940px;
    box-shadow:0 8px 15px rgba(0,0,0,.15);
}

.content h2{
    color:#401364;
    margin-bottom:20px;
}
/* ====== หัวข้อตรงกลาง ====== */
.content2{
    flex:1;
    background:white;
    border-radius:18px;
    padding:30px;
    min-height:1940px;
    box-shadow:0 8px 15px rgba(0,0,0,.15);
}

.content2 h2{
    color:#401364;
    margin-bottom:20px;
    text-align: center;
}

/* ====== Footer ====== */
footer{
    margin-top:30px;
    background:#401364;
    color:white;
    text-align:center;
    padding:20px;
}

/* ====== Responsive ====== */
@media(max-width:900px){

.container{
    flex-direction:column;
}

.sidebar{
    width:100%;
}

nav ul{
    flex-direction:column;
}

.banner{
    height:220px;
}

.banner-text h1{
    font-size:30px;
}

/* =========================
        ข่าวประชาสัมพันธ์ 
========================= */ 
}

.news-list{
    display:flex;
    flex-direction:column;
    gap:15px;
    margin-bottom:35px;
}

.news-list a{
    text-decoration:none;
    color:#222;
    font-size:20px;
    border-bottom:2px dotted #444;
    padding-bottom:8px;
    transition:.3s;
}

.news-list a:hover{
    color:#401364;
    padding-left:10px;
}

.activity{
    display:flex;
    gap:30px;
    margin-bottom:35px;
    align-items:flex-start;
}

.activity img{
    width:420px;
    border-radius:12px;
}

.activity-text{
    flex:1;
}

.activity-text h3{
    color:#401364;
    margin-bottom:10px;
}

.activity-text p{
    line-height:1.8;
    margin-bottom:15px;
}

.activity-text a{
    color:#401364;
    text-decoration:none;
    font-weight:bold;
}

/* =========================
         Banner
========================= */ 
.banner{
    width:100%;
    height:360px;
    overflow:hidden;
}

.banner img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

/* =========================
         pdf-center 
========================= */  
.pdf-center{
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px auto;
}

.pdf-center iframe{
    width: 60%;
    height: 940px;      /* ====== ปรับความสูง-pdf ====== */
    border: none;
}

/* =========================
  pdf-center2 ช่องทางติดต่อ
========================= */   

.pdf-center2{
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px auto;
}

.pdf-center2 iframe{
    width: 60%;
    height: 430px;           /* ====== ปรับความสูง-pdf ====== */
    border: none;
}

/* =========================
    pdf-center3 ปฏิทิน
========================= */   

.pdf-center3{
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px auto;
}

.pdf-center3 iframe{
    width: 80%;
    height: 400px;     /* ====== ปรับความสูงปฏิทิน ====== */
    border: none;
}

/* =========================
           สถิติ
========================= */
#visitor-box .counter-box{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

#visitor-box{
    min-height: 100px;   /* ปรับตามต้องการ */
}
/* =========================
        Download Item
========================= */
.download-item{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin:0;
    padding:8px 10px;

    border-bottom:1px dotted #ddd;

    opacity:1;
    transform:translateY(0);

    transition:
        padding-left 0.25s ease,
        color 0.25s ease;
}

/* เมาส์โดนรายการ */
.download-item:hover{
    padding-left:15px;
}

/* ลิงก์ */
.download-item a{
    color:#401364;
    text-decoration:none;

    transition:
        color 0.25s ease,
        padding-left 0.25s ease;
}

.download-item a:hover{
    color:#ffa50c;
    padding-left:5px;
}

/* แต่ละข้อแยกจากกัน */
.law-item{
    border-bottom:1px solid #ddd;
}

/* ข้อหลัก */
.law-main{
    padding:8px 10px 8px 25px;
    font-size:16px;
    font-weight:400;
    color:#000000;
    cursor:pointer;
}

/* ===== หัวข้อย่อย ซ่อนไว้ ===== */
.law-sub{
    max-height:0;
    opacity:0;
    overflow:hidden;

    padding-left:30px;
    padding-top:0;

    transition:
        max-height 0.5s ease,
        opacity 0.35s ease,
        padding-top 0.5s ease;
}

/* ===== เมาส์โดนข้อไหน แสดงเฉพาะข้อนั้น ===== */
.law-item:hover > .law-sub{
    max-height:300px;
    opacity:1;
    padding-top:5px;
}


/* ===== หัวข้อย่อย ===== */
.sub-item{
    padding:0 10px;

    opacity:0;
    transform:translateY(-8px);

    border-bottom:1px solid transparent;

    transition:
        opacity 0.35s ease,
        transform 0.45s ease,
        padding 0.45s ease,
        border-color 0.35s ease;
}


/* ===== ตอนแสดง ค่อย ๆ เลื่อนลง ===== */
.law-item:hover > .law-sub .sub-item{
    padding-top:7px;
    padding-bottom:7px;

    opacity:1;
    transform:translateY(0);

    border-bottom:1px dotted #ddd;
}


/* ===== ลิงก์ ===== */
.sub-item a{
    display:block;
    color:#401364;
    text-decoration:none;

    transition:
        color 0.25s ease,
        padding-left 0.25s ease;
}

.sub-item a:hover{
    color:#ffa50c;
    padding-left:5px;
}
/* =========================
        รูปภาพข่าว
========================= */
.img-center{
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
}

.img-center img{
    width: 500px;      /* ปรับตามต้องการ */
    max-width: 100%;
    height: auto;
}

/* =========================
   Gallery รูปภาพ
========================= */

/* ==========================================
   กิจกรรม
========================================== */

.activity-section {
    width: 100%;
}

.activity-section h2 {
    margin-bottom: 20px;
}


/* แต่ละกิจกรรม */

.activity-item {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 20px;
    align-items: start;
    margin-bottom: 35px;
}


/* ==========================================
   Gallery ฝั่งซ้าย
========================================== */

.activity-gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.activity-gallery img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;

    opacity: 1;
    transform: scale(1);

    transition:
        opacity 0.45s ease,
        transform 0.6s ease;
}

/* ตอนเปลี่ยนรูป */
.activity-gallery img.gallery-changing {
    opacity: 0;
    transform: scale(1.03);
}


/* ==========================================
   ลูกศร
========================================== */

.gallery-btn {
    position: absolute;

    /* ให้อยู่ตรงกลางความสูงของรูป */
    top: 50%;
    transform: translateY(-50%);

    z-index: 5;

    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);
    color: white;

    font-size: 28px;
    line-height: 38px;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 0.3s ease,
        background 0.3s ease;
}


/* เอาเมาส์ไปที่รูปแล้วลูกศรค่อยขึ้น */

.activity-gallery:hover .gallery-btn {
    opacity: 1;
}


/* ลูกศรซ้าย */

.gallery-btn.prev {
    left: 8px;
}


/* ลูกศรขวา */

.gallery-btn.next {
    right: 8px;
}


/* ตอนเอาเมาส์ไปโดนลูกศร */

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}


/* ==========================================
   จุดแสดงจำนวนรูป
========================================== */

.gallery-dots {
    position: absolute;

    bottom: 10px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    gap: 6px;

    z-index: 5;
}


.gallery-dots span {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.6);

    cursor: pointer;

    transition: all 0.3s ease;
}


.gallery-dots span.active {
    width: 20px;

    border-radius: 10px;

    background: white;
}


/* ==========================================
   ข้อมูลฝั่งขวา
========================================== */

.activity-info {
    padding-top: 3px;
    padding-left: 0;
}


.activity-info h3 {
    margin-top: 0;
    margin-bottom: 10px;

    font-size: 21px;

    color: #333;
}


.activity-info p {
    margin-top: 0;
    margin-bottom: 12px;

    line-height: 1.7;

    color: #555;
}


.activity-info a {
    color: #4b267f;

    font-weight: bold;

    text-decoration: none;

    transition: color 0.3s ease;
}


.activity-info a:hover {
    color: #e91e63;
}


/* ==========================================
   มือถือ
========================================== */

@media (max-width: 768px) {

    .activity-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .activity-gallery img {
        height: 280px;
    }

    .activity-info h3 {
        font-size: 19px;
    }

}