:root {
            --bg-body: #f1f4f8;
            --bg-nav: #ffffff;
            --text-main: #1e293b;
            --accent-blue: #2563eb;
            --border-color: #e2e8f0;
            --card-bg: #ffffff;
            --transition-speed: 0.3s;
            --text-color: #2563eb;
            --text-date: #bb0a0a;
            --border-bottom: 10px solid white;
            --box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
            --bg-drop: #ffffff;
        }

        [data-theme="dark"] {
            --bg-body: #14181f;
            --bg-nav: #181d25;
            --text-main: #ffffff;
            --accent-blue: #60a5fa;
            --border-color: #334155;
            --card-bg: #1e293b;
            --text-color: #ffffff;
            --text-date: #f5f5f5;
            --border-bottom: 10px solid #181d25;
            --box-shadow: rgba(141, 132, 132, 0.24) 0px 3px 8px;
            --border-con: #afaaaa00;
            --bg-drop: #334155;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Noto Sans Lao', 'Noto Sans Thai', 'Inter', sans-serif;
            scroll-behavior: smooth;
        }

        body {
            background-color: var(--bg-body);
            color: var(--text-main);
            overflow-x: hidden;
        }

        /* --- Header Section --- */
     header.main-banner {
          height: 300px;
          background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('../public/header-image.png') center/cover;
          display: flex;
          align-items: center;
          justify-content: center;
          color: white;
          text-align: center;
     }

     .banner-content h1 { font-size: 3rem; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
     .banner-content img{ width: 100px; height: 100px;}


        /* --- Navigation below Header --- */
        .top-nav {
            height: 60px;
            width: 100%;
            background-color: var(--bg-nav);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 5%;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        .img{
            width: 40px;
            height: 40px;
            border-radius: 5px;
        }
        
        .nav-left, .nav-right { display: flex; align-items: center; gap: 20px; }
        .brand-name { font-size: 1.2rem; font-weight: 700; color: var(--accent-blue); cursor: pointer; }

        .nav-menu-item {
            font-size: 0.95rem;
            cursor: pointer;
            color: var(--text-main);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }
        .nav-menu-item:hover { color: var(--accent-blue); }

        .container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 60px 0; }
        .section-title { font-size: 1.8rem; margin-bottom: 30px; border-left: 6px solid var(--accent-blue); padding-left: 15px; display: flex; justify-content: space-between; align-items: center; }

        /* --- News Grid --- */
        .news-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
            margin-bottom: 80px;
        }

        .news-card {
            background-color: var(--card-bg);
            border-radius: 15px;
            overflow: hidden;
            border: 1px solid var(--border-color);
            transition: all var(--transition-speed) ease;
            text-decoration: none;
            color: inherit;
        }

        .news-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
        .card-img { width: 100%; height: 180px; object-fit: cover; }
        .card-content { padding: 20px; }
        .news-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; line-height: 1.4; height: 3em; overflow: hidden; }
        .infoDate{
            color: var(--text-date); font-weight: bold;
        }
        /* --- Controls --- */
        .theme-switch { width: 40px; height: 20px; background: #cbd5e1; border-radius: 20px; position: relative; cursor: pointer; }
        .switch-dot { width: 16px; height: 16px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: 0.3s; }
        [data-theme="dark"] .theme-switch { background: var(--accent-blue); }
        [data-theme="dark"] .switch-dot { left: 22px; }

        .lang-dropdown { position: relative; cursor: pointer; padding: 5px 12px; background: var(--card-bg); border-radius: 8px; border: 1px solid var(--border-color); }
        .dropdown-menu { display: none; position: absolute; top: 100%; right: 0; background: var(--card-bg); min-width: 120px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 8px; margin-top: 5px; overflow: hidden; }
        .dropdown-menu div { padding: 10px 15px; font-size: 0.9rem; }
        .dropdown-menu div:hover { background: var(--bg-body); color: var(--accent-blue); }
        .show { display: block; }

        /* --- Footer --- */
        footer {
            background-color: var(--card-bg);
            color: var(--text-main);
            padding: 60px 5% 30px 5%;
            margin-top: 50px;
        }

        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 40px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding-bottom: 40px;
        }

        .footer-section h3 { margin-bottom: 20px; font-size: 1.3rem; color: var(--accent-blue); font-weight: bold; }
        .contact-info { list-style: none; }
        .contact-info li { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; opacity: 0.8; }
        .contact-info i { width: 20px; color: var(--accent-blue); }
        .contact-info a { color:var(--text-color); text-decoration: none; transition: opacity 0.2s; }
        .contact-info a:hover { opacity: 1; text-decoration: underline; }
        .ft-link a{ color:var(--text-main);}
        .copyright { text-align: center; padding-top: 30px; font-size: 0.9rem; opacity: 0.6; }

        /* ------------------ ##################### -------------------- */

    .ad-wrapper-modern {
        width: 100%;
        margin: 2px auto;
        padding: 5px;
        text-align: center;
        background: rgba(255, 255, 255, 0.05); /* โปร่งแสงเบาๆ */
        backdrop-filter: blur(10px); /* เอฟเฟกต์กระจกฝ้า */
        border: 1px solid rgba(255, 255, 255, 0.1);
        
        overflow: hidden; /* ป้องกันโฆษณาล้นขอบ */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 2. บังคับให้โฆษณาที่โหลดมา Responsive */
    .ad-wrapper-modern ins, 
    .ad-wrapper-modern iframe, 
    .ad-wrapper-modern div {
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    /* 3. ปรับแต่งข้อความกำกับเล็กๆ ให้ดูเป็นมืออาชีพ */
    .ad-label {
        font-size: 18px;
        color: #074974;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    /* ใช้ ID ร่วมกับคลาสเพื่อเพิ่มความสำคัญในการสั่งแสดง */
        #newsDropdownParent{
            position: relative;
        }
        /* ปรับตำแหน่งใหม่ */
.submenu-container {
    position: absolute;
    top: 100%;       /* <--- เพิ่มบรรทัดนี้สำคัญมาก! เพื่อให้ลงมาอยู่ใต้ปุ่ม */
    left: 0;         
    margin: 0 !important;
    padding: 0;
    z-index: 9999;   
    display: none;   /* ซ่อนไว้ก่อน */
}

#submenuContainer.active {
    display: flex !important; 
    opacity: 1 !important;
    visibility: visible !important;
    /* margin-top ตรงนี้จะเป็นระยะห่างจากขอบปุ่ม */
    margin-top: 10px !important; 
}

        /* ตกแต่งลูกศรชี้ขึ้น */
        .arrow-up {
            position: absolute;
            top: -9px; /* ปรับให้พอดีกับขอบขาว */
            left: 35%;
            transform: translateX(-50%);
            width: 0; 
            height: 0; 
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 10px solid var(--bg-drop); /* สีเดียวกับพื้นหลังเมนูย่อย */
            filter: drop-shadow(0 -2px 1px rgba(0,0,0,0.05));
        }

        /* คลาสสำหรับเงาพื้นหลัง (ถ้าคุณไม่ได้ใช้ของ Tailwind) */
        .bg-shadow {
            background-color: var(--bg-drop);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--border-con);
        }
    
    