 /* --- 1. Theme Color Settings --- */
/* --- 1. Theme Color Settings (Updated to Red-Blue) --- */
 :root {
     /* สีน้ำเงินเข้ม (Navy) ให้ความรู้สึกมั่นคง สุขุม */
     --primary-color: #810e8b; 
     
     /* สีน้ำเงินที่เข้มขึ้นสำหรับ Hover หรือส่วนประกอบย่อย */
     --sub-primary-color: #8a3d91; 
     
     /* สีแดงตุ่น (Muted Red) ที่ไม่สดจนเกินไป ช่วยให้ดูซอฟต์ลง */
     --accent-color: #681070; 
     
     /* พื้นหลังเทาอ่อนอมฟ้าเล็กน้อยเพื่อให้เข้ากับโทนน้ำเงิน */
     --bg-light: #f4f7f9; 
     
     /* สีตัวอักษรเทาเข้มเกือบดำ */
     --text-main: #1f1e1e; 
     
     --sub-news-height: 120px;
     --news-gap: 1rem;
 }

 *,
 *:after,
 *:before {
     -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
     box-sizing: border-box;
 }

 html {
     overflow-y: scroll;
     -ms-overflow-style: scrollbar;
     scroll-behavior: smooth;
 }

 body {
     font-family: 'Prompt', sans-serif;
     font-weight: 300;
     font-style: normal;
     font-size: 14px;
     color: var(--text-main);
     height: 100vh;
     display: flex;
     flex-direction: column;
     margin: 0;
    background-color: #ffffff;
background-image: url('data:image/svg+xml,<svg width="100%" height="100%" viewBox="0 0 1440 590" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="gradient" x1="0%" y1="50%" x2="100%" y2="50%"><stop offset="0%" stop-color="%23E9D5FF"/><stop offset="50%" stop-color="%23F5F3FF"/><stop offset="100%" stop-color="%23FFFFFF"/></linearGradient></defs><rect width="100%" height="100%" fill="url(%23gradient)"/><path d="M 0,600 L 0,150 C 87.29,129.33 174.58,108.66 269,90 C 363.41,71.33 464.95,54.68 551,80 C 637.04,105.31 707.58,172.58 810,196 C 912.41,219.41 1046.68,198.97 1157,184 C 1267.31,169.02 1353.65,159.51 1440,150 L 1440,600 L 0,600 Z" fill="%23C4B5FD" fill-opacity="0.25"/><path d="M 0,600 L 0,350 C 77.12,379.27 154.25,408.54 243,408 C 331.74,407.45 432.09,377.09 552,363 C 671.90,348.90 811.35,351.09 908,336 C 1004.64,320.90 1058.46,288.54 1140,288 C 1221.53,287.45 1330.76,318.72 1440,350 L 1440,600 L 0,600 Z" fill="%23A78BFA" fill-opacity="0.18"/></svg>');
background-attachment: fixed;
     background-size: cover;
     padding-top: 50px;
 }
@view-transition {
  navigation: auto;
}
 ::-webkit-scrollbar {
     width: 7px;
     background-color: var(--primary-color);
     -webkit-appearance: none
 }

 ::-webkit-scrollbar-track {
     background: transparent
 }

 ::-webkit-scrollbar-thumb {
     background-color: #fff;
     border-radius: 20px;
     border: transparent
 }

.bg-primary{
   background-color: var(--primary-color) !important;
}

 h1,
 h2,
 h3,
 h4,
 h5,
 h6,
 .text-title {
     font-family: 'Prompt', sans-serif;
     margin-top: 0;
     margin-bottom: 0;
 }

 .container {
     max-width: 1440px;
 }

 a {
     text-decoration: none;
 }

 img {
     object-fit: cover;
 }

 /*fonts size*/
 .fs9 {
     font-size: 9px !important
 }

 .fs10 {
     font-size: 10px !important
 }

 .fs11 {
     font-size: 11px !important
 }

 .fs12 {
     font-size: 12px !important
 }

 .fs13 {
     font-size: 13px !important
 }

 .fs14 {
     font-size: 14px !important
 }

 .fs16 {
     font-size: 16px !important
 }

 .fs18 {
     font-size: 18px !important
 }

 .fs20 {
     font-size: 20px !important
 }


 /* --- 2. Navbar (Fixed & Smooth Animation Fix) --- */
 .navbar {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     width: 100%;
     z-index: 1030;

     height: auto;
     min-height: auto;

     /* ใช้ Padding คุมความสูง */
     padding-top: 5px !important;
     padding-bottom: 5px !important;

     background-color: #fff;
     box-shadow: 0 4px 6px -1px rgba(0, 51, 153, 0.1);
     border-top: 4px solid var(--accent-color);
 }

 .navbar .nav-item i {
     font-size: 0.75rem;
     padding-right: 3px;
 }

 .navbar-brand {
     font-weight: 700;
     color: var(--primary-color) !important;
     font-size: 1.25rem;
     display: flex;
     align-items: center;
     padding: 0;
     margin: 0;
     line-height: 1;
     & img{
        position: absolute;
        top: -2px;
        height: 45px;
        z-index: 1;

     }
     & span{
        margin-left: 50px;
     }
 }

 .nav-link {
     line-height: normal;
     padding: 10px 15px !important;
     color: #555 !important;
     font-weight: 500;
     transition: all 0.2s;
     position: relative;
     display: block;
 }

 .navbar-toggler {
     border: none;
     padding: 0.25rem 0.75rem;
     align-self: center;
 }

 .navbar-toggler:focus {
     box-shadow: none;
 }

 .dropdown-menu[data-bs-popper] {
    margin-top: 0;
 }
 /* --- Desktop Menu Styles --- */
 @media (min-width: 992px) {
     .navbar-expand-lg .navbar-nav .nav-link {
         padding-right: 1rem;
         padding-left: 1rem;
     }

     .nav-link:hover,
     .nav-link.active {
         color: var(--primary-color) !important;
         background: transparent;
         border-radius: 4px;
     }

     .nav-link.active::after {
         content: '';
         position: absolute;
         bottom: 5px;
         left: 15px;
         right: 15px;
         height: 3px;
         background-color: var(--accent-color);
     }

     /* Dropdown Styles for Desktop */
     .nav-item.dropdown {
         position: relative;
     }

     .dropdown-menu {
         display: none;
         position: absolute;
         top: 100%;
         left: 0;
         min-width: 220px;
         background: #fff;
         border: none;
         border-radius: 8px;
         box-shadow: 0 10px 30px rgba(0, 51, 153, 0.15);
         padding: 10px 0;
         margin-top: 0;
         opacity: 0;
         visibility: hidden;
         transform: translateY(-10px);
         transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
         z-index: 1000;
         border-top: 3px solid var(--accent-color);
     }

     .nav-item.dropdown:hover .dropdown-menu,
     .dropdown-menu:hover {
         display: block;
         opacity: 1;
         visibility: visible;
         transform: translateY(0);
     }

     .dropdown-item {
         padding: 10px 20px;
         color: #555;
         font-weight: 500;
         font-size: 0.95rem;
         transition: all 0.2s;
         display: flex;
         align-items: center;
         gap: 10px;
     }

     .dropdown-item i {
         width: 20px;
         color: var(--primary-color);
         transition: transform 0.2s;
     }

     .dropdown-item:hover {
         background-color: #f0f4ff;
         color: var(--primary-color);
         padding-left: 20px;
     }

     .dropdown-item:hover i {
         transform: translateX(3px);
     }

     .dropdown-divider {
         margin: 8px 0;
         border-top: 1px solid #eef2ff;
     }

     /* Dropdown Arrow Indicator */

     .nav-item.dropdown:hover>.nav-link::after {
         transform: rotate(180deg);
     }

     .carousel-indicators {
         margin-bottom: 3.2rem;
     }
 }

 /* --- Mobile Menu Styles (The Fix) --- */
 @media (max-width: 991.98px) {

     /* 1. กล่องนอก (Collapsing Wrapper) - ต้องใสและไม่มี Padding */
     .navbar-collapse {
         position: absolute;
         top: 100%;
         left: 0;
         right: 0;
         width: 100%;

         background-color: transparent;
         border: none;
         padding: 0 !important;
         margin: 0 !important;
         box-shadow: none;
        
         max-height: 80vh;
         overflow-y: hidden;
     }

     /* 2. กล่องใน (Content) - ย้ายความสวยงามมาใส่ตรงนี้ */
     .navbar-collapse .navbar-nav {
         background-color: #fff;
         padding: 20px;
         box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
         border-bottom-left-radius: 12px;
         border-bottom-right-radius: 12px;

     }

     .nav-link {
         padding: 12px 20px !important;
         border-radius: 8px;
         margin: 5px 0;
     }

     .nav-link:hover,
     .nav-link.active {
         background-color: #f0f4ff;
         color: var(--primary-color) !important;
         padding-left: 25px !important;
     }

     /* Mobile Dropdown Styles */
     .dropdown-menu {
         display: none;
         position: static !important;
         transform: none !important;
         box-shadow: none;
         border: none;
         background: #f8f9fc;
         margin: 5px 0;
         padding: 5px 0;
         border-radius: 8px;
     }

     .dropdown-menu.show {
         display: block !important;
         opacity: 1 !important;
         visibility: visible !important;
     }

     .dropdown-item {
         padding: 10px 20px 10px 35px !important;
         font-size: 0.9rem;
     }

     /* Show inline chevron on mobile */
     .nav-item.dropdown .fa-chevron-down {
         display: inline-block;
         transition: transform 0.3s;
     }

     /* Rotate chevron when dropdown is open */
     .nav-item.dropdown .show+.fa-chevron-down,
     .nav-item.dropdown:has(.dropdown-menu.show) .fa-chevron-down {
         transform: rotate(180deg);
     }

     /* Hide ::after arrow on mobile */
     .nav-item.dropdown>.nav-link::after {
         display: none;
     }
 }

 /* --- 3. Quick Menu Cards --- */
 .quick-menu-container {
     margin-top: -40px;
     position: relative;
     z-index: 10;
 }

 @media (max-width: 767.98px) {
     .quick-menu-container {
         margin-top: 40px;
     }
 }

 .carousel-indicators [data-bs-target] {
     width: 25px;
     height: 5px;
     border-radius: 10px;
     margin-right: 5px;
     margin-left: 5px;
     background-color: var(--accent-color);
     opacity: .3;
 }

 .carousel-indicators .active {
     opacity: 1;
 }

 .quick-card {
     background: #fff;
     border-radius: 15px;
     padding: 25px 15px;
     text-align: center;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
     transition: all 0.3s ease;
     height: 100%;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     text-decoration: none !important;
     border: 1px solid rgba(0, 0, 0, 0.05);
     border-top: 5px solid var(--accent-color);
 }

 .quick-card:hover {
     transform: translateY(-5px);
     box-shadow: 0 15px 30px rgba(0, 51, 153, 0.15);
     border-color: #eef2ff;
     border-top-color: var(--primary-color);
 }

 .quick-icon {
     font-size: 2.5rem;
     color: var(--primary-color);
     margin-bottom: 15px;
     transition: transform 0.3s, color 0.3s;
 }

 .quick-card:hover .quick-icon {
     color: var(--accent-color);
     transform: scale(1.1);
 }

 .quick-title {
     font-size: 1.1rem;
     font-weight: 600;
     color: var(--text-main);
     margin: 0;
     line-height: 1.3;
 }

 /* --- 4. Section Headers --- */
 .section-header-group {
     display: flex;
     justify-content: space-between;
     align-items: center;
     border-left: 6px solid var(--accent-color);
     padding-left: 15px;
     margin-bottom: 25px;
     background: linear-gradient(90deg, rgba(210, 31, 60, 0.05) 0%, transparent 100%);
     padding-top: 5px;
     padding-bottom: 5px;
     border-radius: 0 50px 50px 0;
 }

 .section-title {
     margin: 0;
     font-weight: 700;
     color: var(--primary-color);
     font-size: 1.5rem;
 }

 .btn-view-all {
     font-size: 0.85rem;
     color: var(--accent-color);
     border: 1px solid var(--accent-color);
     border-radius: 50px;
     padding: 6px 18px;
     background: #fff;
     transition: all 0.3s;
     font-weight: 500;
 }

 .btn-view-all:hover {
     background-color: var(--accent-color);
     color: #fff;
     box-shadow: 0 4px 6px -1px rgba(210, 31, 60, 0.3);
 }

 /* --- 5. News Layout --- */

 .news-highlight {
     position: relative;
     border-radius: 12px;
     overflow: hidden;
     height: calc((var(--sub-news-height) * 3) + (var(--news-gap) * 2));
     box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
     border-bottom: 4px solid var(--accent-color);
 }

 .news-highlight img {
     width: 100%;
     height: 100%;
     transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
 }

 .news-highlight:hover img {
     transform: scale(1.05);
 }

 .news-highlight-overlay {
     position: absolute;
     bottom: 0;
     left: 0;
     right: 0;
     padding: 30px;
     background: linear-gradient(to top, rgba(0, 34, 102, 0.95) 10%, transparent);
     color: #fff;
     z-index: 2;
 }

 .news-list-item {
     position: relative;
     background: #fff;
     border-radius: 10px;
     overflow: hidden;
     border: 1px solid #eef2ff;
     transition: transform 0.3s, box-shadow 0.3s ease;
 }

 .news-list-content .badge {
     background-color: #f7f2f2;
     color: #000;
     font-size: 0.65rem;
     font-weight: 300;
 }

 .news-list-item::before {
     content: "";
     position: absolute;
     top: 0;
     bottom: 0;
     left: 0;
     width: 5px;
     background-color: transparent;
     z-index: 5;
     transition: background-color 0.3s ease;
 }

 .news-list-item:hover {
     transform: translateY(-3px);
     box-shadow: 0 10px 20px rgba(0, 51, 153, 0.15);
     border-color: #dbeafe;
 }

 .news-list-item:hover::before {
     background-color: var(--primary-color);
 }

 .news-list-item img {
     width: 100%;
     height: 100%;
 }

 .news-list-content {
     padding: 15px;
     display: flex;
     flex-direction: column;
     justify-content: center;
 }

 .news-date {
     font-size: 0.75rem;
     color: var(--accent-color);
     margin-bottom: 5px;
     font-weight: 600;
 }

 .news-list-title {
     font-size: 1rem;
     font-weight: 600;
     line-height: 1.4;
     color: var(--text-main);
     display: -webkit-box;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
     overflow: hidden;
     transition: color 0.2s;
 }

 .news-list-item:hover .news-list-title {
     color: var(--primary-color);
 }

 /* --- 6. Video Grid --- */
 .video-card {
     border: none;
     background: transparent;
     cursor: pointer;
 }

 .video-thumbnail {
     position: relative;
     border-radius: 12px;
     overflow: hidden;
     aspect-ratio: 16/9;
     box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
 }

 .video-thumbnail img {
     width: 100%;
     height: 100%;
     transition: transform 0.3s;
 }

 .video-card:hover .video-thumbnail img {
     transform: scale(1.05);
 }

 .play-btn {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 50px;
     height: 50px;
     background: rgba(255, 255, 255, 0.2);
     backdrop-filter: blur(4px);
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     border: 2px solid #fff;
     color: #fff;
     font-size: 1.2rem;
     transition: all 0.3s;
 }

 .video-card:hover .play-btn {
     background: var(--accent-color);
     border-color: var(--accent-color);
     transform: translate(-50%, -50%) scale(1.1);
 }

 .video-title {
     margin-top: 10px;
     font-size: 0.95rem;
     font-weight: 500;
     color: var(--text-main);
 }

 .video-card:hover .video-title {
     color: var(--primary-color);
 }

 /* --- 7. Sidebar --- */
 .sidebar-box {
     background: #fff;
     border-radius: 12px;
     padding: 10px 25px;
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
     margin-bottom: 25px;
     border-top: 4px solid var(--primary-color);
 }

 .admin-img {
     border-radius: 50%;
     border: 4px solid #fff;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
     overflow: hidden;
     margin: 0 auto;
 }

 .director {
     width: 180px;
     height: 180px;
 }

 .sub-director {
     width: 150px;
     height: 150px;
 }

/**page bar cover*/
.cover-container {
    position: relative;
    width: 100%;
    height: 50vh; /* สูงน้อยลงสำหรับ desktop */
  }

  .cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #ffffff, rgba(0, 0, 0, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 1rem;
  }

  .cover-overlay h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }

  .cover-overlay p {
    font-size: 1.2rem;
    margin: 0;
    max-width: 90%;
  }

  /* ✅ Responsive สำหรับมือถือ */
  @media (max-width: 768px) {
    .cover-container {
      height: 60vh;
    }

    .cover-overlay h1 {
      font-size: 1.8rem;
    }

    .cover-overlay p {
      font-size: 1rem;
    }
  }

  .breadcrumb-custom {
    background: linear-gradient(to top, var(--primary-color), var(--primary-color));
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
  }

  .breadcrumb-custom .breadcrumb-item a {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
  }

  .breadcrumb-custom .breadcrumb-item a:hover {
    text-decoration: underline;
    opacity: 1;
  }

  .breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    color: #ffffffb3;
  }

  .breadcrumb-custom .breadcrumb-item.active {
    color: #ffffffcc;
  }

 /* --- 8. Footer --- */
 .main-footer {
     background-color: var(--sub-primary-color);
     color: #cbd5e1;
     padding-top: 50px;
     margin-top: 10px;
     position: relative;
 }

 .main-footer::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     height: 5px;
     background: var(--accent-color);
 }

.footer-logo img{
    width: 70%;
}

 .footer-title {
     font-size: 1.5rem;
     font-weight: 700;
     color: #fff;
     margin-bottom: 15px;
     display: block;
 }


 .footer-heading {
     color: #fff;
     font-weight: 600;
     margin-bottom: 20px;
     position: relative;
     padding-bottom: 10px;
 }

 .footer-heading::after {
     content: '';
     position: absolute;
     left: 50%;
     bottom: 0;
     width: 40px;
     height: 3px;
     background-color: var(--accent-color);
     transform: translateX(-50%);
 }

 @media (min-width: 768px) {
     .footer-heading::after {
         left: 0;
         transform: none;
     }
 }

.footer-links {
     list-style: none;
     padding: 0;
 }

 .footer-links li {
     margin-bottom: 13px;
 }

 .footer-links a {
     color: #cbd5e1;
     text-decoration: none;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     position: relative;
 }

 /* ตั้งค่า Icon Font Awesome */
 .footer-links a::before {
     content: "\f105";          /* รหัส Unicode ของ Font Awesome (chevron-right) */
     font-family: "Font Awesome 6 Free"; 
     font-weight: 900;          /* จำเป็นสำหรับ Font Awesome แบบ Solid */
     margin-right: 10px;
     font-size: 0.65rem;
     color: #fff; /* ใช้สี Accent หรือสีฟ้า */
     transition: all 0.3s ease;
 }

 /* เอฟเฟกต์ตอน Hover */
 .footer-links a:hover {
     color: #fff;
     padding-left: 2px; /* ขยับทั้งเมนูไปทางขวา */
 }

 .footer-links a:hover::before {
     margin-right: 15px; /* เพิ่มระยะห่างของไอคอนตอน hover ให้ดูมีมิติ */
     color: #fff;        /* เปลี่ยนสีไอคอนตามความเหมาะสม */
 }

 .social-links {
     display: flex;
     justify-content: center;
 }

 @media (min-width: 768px) {
     .social-links {
         justify-content: flex-start;
     }
 }

 .social-links a {
     display: inline-flex;
     width: 36px;
     height: 36px;
     background: rgba(255, 255, 255, 0.1);
     color: #fff;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     margin: 0 4px;
     transition: all 0.3s;
 }

 @media (min-width: 768px) {
     .social-links a {
         margin-right: 8px;
         margin-left: 0;
     }
 }

 .social-links a:hover {
     background: var(--accent-color);
     transform: translateY(-3px);
 }

 .copyright-bar {
     background-color: rgba(0, 0, 0, 0.2);
     padding: 20px 0;
     margin-top: 10px;
     font-size: 0.85rem;
     border-top: 1px solid rgba(255, 255, 255, 0.05);
 }

 .contact-item {
     display: flex;
     justify-content: center;
     gap: 10px;
     margin-bottom: 10px;
 }

 @media (min-width: 768px) {
     .contact-item {
         justify-content: flex-start;
     }
 }

 /* --- Responsive Adjustments --- */
 @media (max-width: 991.98px) {
     .news-highlight {
         height: 350px;
         margin-bottom: 20px;
     }
 }

 @media (max-width: 767.98px) {

     .navbar-brand {
        font-weight: 600;
        font-size: .95rem;
     & img{
        height: 42px;
     }
     & span{
        margin-left: 50px;
     }

 }

     .news-list-item .mobile-img-container {
         height: 180px;
     }

     .news-list-content {
         padding: 20px 15px;
     }

     .news-list-item::before {
         display: none;
     }

      .footer-logo img{
        width: 50%;
    }
 }

 @media (min-width: 768px) {
     .news-list-item {
         height: var(--sub-news-height);
     }

     .news-list-item .mobile-img-container {
         height: 100%;
     }
 }

 @media screen and (max-width: 767px) {
          .copyright-bar {
        margin-top: 50px;
      }

      .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;    /* จัดกลุ่มเมนูทั้งหมดให้อยู่กลางจอ */
        padding: 0 10px;
        text-align: left;       /* ให้ตัวอักษรภายในยังคงชิดซ้าย */
    }

    .footer-links li {
        width: fit-content;      /* สำคัญมาก: บังคับให้กว้างเท่าเนื้อหาเพื่อให้จัดกลางได้ */
        min-width: 150px;       /* (Optional) กำหนดความกว้างขั้นต่ำเพื่อให้ดูสมดุล */
        margin-left: auto;      /* ช่วยในการประคองให้อยู่กลางร่วมกับ parent flex */
        margin-right: auto;
    }

    .footer-links a {
        display: flex;
        justify-content: flex-start; /* ไอคอนกับข้อความชิดซ้ายในบล็อกตัวเอง */
        width: 100%;
    }
 }

 