/* =====================================================================
   SWL Modern Theme (หน้าเว็บไซต์)
   ชั้นตกแต่งเพิ่มเติมเท่านั้น: ไม่เปลี่ยนโครงสร้าง HTML, รูปภาพ หรือการทำงาน
   ลบการ <link> ไฟล์นี้ออกจาก title.php = กลับเป็นหน้าตาเดิมทันที
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600&family=Sarabun:wght@400;500;600&display=swap');

:root {
  --swl-green-900: #0b4d2b;
  --swl-green-800: #0e5f35;
  --swl-green-700: #137341;
  --swl-green-600: #18884d;
  --swl-green-500: #22a05c;
  --swl-green-50:  #eaf6ef;
  --swl-gold:      #f2b632;
  --swl-ink:       #1d2b24;
  --swl-muted:     #5f6f67;
  --swl-bg:        #f2f6f4;
  --swl-card:      #ffffff;
  --swl-line:      #e3ebe6;
  --swl-radius:    16px;
  --swl-shadow:    0 1px 2px rgba(16, 40, 28, .06), 0 8px 24px rgba(16, 40, 28, .07);
  --swl-shadow-hover: 0 2px 4px rgba(16, 40, 28, .08), 0 14px 32px rgba(16, 40, 28, .12);
}

/* ---------- พื้นฐาน ---------- */
html { scroll-behavior: smooth; }
body,
body.grey.lighten-3 {
  background: var(--swl-bg) !important;
  color: var(--swl-ink);
  font-family: 'Sarabun', 'Kanit', sans-serif !important;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body a { font-family: inherit !important; font-size: inherit; transition: color .15s ease; }
body a:hover { text-decoration: none; }
h1, h2, h3, h4, h5, h6,
.card-header, .navbar, .breadcrumb, .page-footer h5 {
  font-family: 'Prompt', 'Kanit', sans-serif !important;
}
::selection { background: var(--swl-green-500); color: #fff; }

/* แถบเลื่อน */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #e9efeb !important; }
::-webkit-scrollbar-thumb { background: #a7bdb0 !important; border-radius: 10px; border: 2px solid #e9efeb; }
::-webkit-scrollbar-thumb:hover { background: var(--swl-green-600) !important; }

/* ---------- แถบเมนูด้านบน ---------- */
body .navbar.bg-dark,
body .navbar.navbar-dark {
  background: linear-gradient(100deg, var(--swl-green-900) 0%, var(--swl-green-700) 55%, var(--swl-green-600) 100%) !important;
  box-shadow: 0 6px 20px rgba(11, 77, 43, .25) !important;
  padding: .55rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}
body .navbar .navbar-brand img {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
body .navbar .navbar-brand:hover img { transform: translateY(-1px); }
body .navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,.92) !important;
  font-weight: 500;
  padding: .5rem .85rem !important;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
/* เมนูหลักหลายรายการ: ไม่ตัดคำ ถ้าไม่พอให้ขึ้นแถวใหม่ทั้งรายการ */
@media (min-width: 768px) {
  body .navbar-expand-md .navbar-nav { flex-wrap: wrap; }
  body .navbar-dark .navbar-nav .nav-link { padding: .45rem .6rem !important; font-size: 15.5px; }
  /* สองเมนูสุดท้ายชิดขวา และเมนูย่อยชั้นถัดไปเปิดไปทางซ้าย ไม่ล้นจอ */
  body .navbar-nav > li.dropdown:nth-last-child(-n+2) > .dropdown-menu { left: auto; right: 0; }
  body .navbar-nav > li.dropdown:nth-last-child(-n+2) .dropdown-menu .dropdown-menu.show { left: auto !important; right: calc(100% - 4px); }
}
@media (min-width: 1200px) {
  body .navbar-dark .navbar-nav .nav-link { padding: .45rem .5rem !important; font-size: 15px; }
}
@media (min-width: 1500px) {
  body .navbar-dark .navbar-nav .nav-link { padding: .5rem .8rem !important; font-size: 16px; }
}
body .navbar-dark .navbar-nav .nav-link:hover,
body .navbar-dark .navbar-nav .show > .nav-link {
  background: rgba(255,255,255,.14);
  color: #fff !important;
}
body .navbar .navbar-toggler {
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px;
  padding: .35rem .6rem;
}

/* เมนูย่อย */
body .navbar .dropdown-menu {
  border: 1px solid var(--swl-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 40, 28, .18);
  padding: .4rem;
  margin-top: .35rem;
  animation: swlFade .14s ease-out;
}
body .navbar .dropdown-menu .dropdown-menu { margin-top: 0; }
body .navbar .dropdown-item {
  border-radius: 9px;
  padding: .3rem .8rem;
  font-size: 15px;
  line-height: 1.4;
  color: var(--swl-ink);
}
body .navbar .dropdown-item:hover,
body .navbar .dropdown-item:focus {
  background: var(--swl-green-50) !important;
  color: var(--swl-green-800) !important;
}
@keyframes swlFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- พื้นที่เนื้อหา ---------- */
main.mt-5.pt-5 { margin-top: 0 !important; padding-top: 0 !important; }

/* การ์ด */
body .card {
  border: 0 !important;
  border-radius: var(--swl-radius) !important;
  box-shadow: var(--swl-shadow) !important;
  background: var(--swl-card);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
body .card:hover { box-shadow: var(--swl-shadow-hover) !important; }
body .card > .card-header,
body .card-header {
  background: linear-gradient(100deg, var(--swl-green-800), var(--swl-green-600)) !important;
  color: #fff !important;
  border: 0 !important;
  padding: .95rem 1.25rem !important;
  font-weight: 600 !important;
  font-size: 17px;
  letter-spacing: .1px;
  position: relative;
}
body .card > .card-header::before {
  content: "";
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--swl-gold);
}
body .card-header a,
body .card-header .card-header1,
body a.card-header1 {
  color: #fff !important;
}
body .card-header .pull-right a.card-header1 {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  padding: .2rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  transition: background-color .15s ease;
}
body .card-header .pull-right a.card-header1:hover { background: rgba(255,255,255,.28); }
body .card-body { padding: 1.25rem 1.35rem; }

/* รายการข่าว */
body .card-body > .media,
body .card-body .media.d-block {
  align-items: flex-start;
  padding: .7rem .75rem;
  margin: 0 -.35rem .15rem !important;
  border-radius: 12px;
  border-bottom: 1px solid var(--swl-line);
  transition: background-color .15s ease;
}
body .card-body > .media:last-child { border-bottom: 0; }
body .card-body > .media:hover { background: var(--swl-green-50); }
body .card-body .media img.z-depth-1 {
  box-shadow: none !important;
  margin-top: .3rem;
  flex-shrink: 0;
}
body .card-body .media .media-body a { color: var(--swl-ink); font-weight: 500; }
body .card-body .media .media-body a:hover { color: var(--swl-green-700); }
body .card-body hr { border-top-color: var(--swl-line); }

/* breadcrumb */
body .breadcrumb {
  background: #fff !important;
  border-radius: 999px !important;
  box-shadow: var(--swl-shadow);
  padding: .65rem 1.25rem !important;
  margin-bottom: 1.25rem;
  font-size: 15px;
}
body .breadcrumb a,
body .breadcrumb .breadcrumb1 { color: var(--swl-green-700) !important; font-weight: 500; }
body .breadcrumb-item.active a,
body .breadcrumb-item.active .breadcrumb1 { color: var(--swl-muted) !important; }
body .breadcrumb-item + .breadcrumb-item::before { color: #9bb0a4 !important; content: "›" !important; }

/* สไลด์ภาพ */
body .carousel,
body .carousel-inner { border-radius: 12px; overflow: hidden; }
body .carousel-indicators li {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.6);
  border: 0;
  margin: 0 4px;
}
body .carousel-indicators .active { background: #fff; width: 26px; border-radius: 6px; }
body .carousel-control-prev-icon,
body .carousel-control-next-icon {
  background-color: rgba(0,0,0,.28);
  border-radius: 50%;
  padding: 18px;
  background-size: 45%;
}

/* รูปภาพในเนื้อหา */
body .card-body img.img-fluid { border-radius: 10px; }
body .col-md-4 .card-body a img.img-fluid { transition: transform .2s ease, box-shadow .2s ease; }
body .col-md-4 .card-body a:hover img.img-fluid { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16,40,28,.15); }

/* ตาราง/เนื้อหาจาก editor */
body .card-body table { max-width: 100%; }
body .card-body iframe { max-width: 100%; border-radius: 10px; }

/* การแบ่งหน้า (Back / 1 / Next) */
body .card-body a[href*="Page="] {
  display: inline-block;
  min-width: 2.2rem;
  padding: .15rem .6rem;
  margin: .15rem;
  border-radius: 999px;
  background: var(--swl-green-50);
  color: var(--swl-green-800) !important;
  text-align: center;
  font-weight: 500;
}
body .card-body a[href*="Page="]:hover { background: var(--swl-green-600); color: #fff !important; }

/* ฟอร์มติดต่อ */
body .form-control {
  border-radius: 12px !important;
  border: 1px solid #cfdcd4 !important;
  padding: .6rem .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body .form-control:focus {
  border-color: var(--swl-green-500) !important;
  box-shadow: 0 0 0 4px rgba(34,160,92,.15) !important;
}
body input[type=submit],
body button[type=submit],
body .btn-primary {
  background: linear-gradient(100deg, var(--swl-green-700), var(--swl-green-500)) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: .6rem 1.6rem !important;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(19,115,65,.25) !important;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
body input[type=submit]:hover,
body .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(19,115,65,.3) !important; }

/* ป๊อปอัป */
body .modal-content { border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
body .modal-header { border-bottom: 0; padding: .6rem .9rem 0; }

/* ส่วนท้าย */
body footer.page-footer {
  background: linear-gradient(180deg, var(--swl-green-900), #073a20) !important;
  color: rgba(255,255,255,.88);
  border-top: 4px solid var(--swl-gold);
}
body footer.page-footer a { color: #fff !important; }
body footer.page-footer hr { border-color: rgba(255,255,255,.15); }
body footer.page-footer .footer-copyright {
  background: rgba(0,0,0,.22) !important;
  color: rgba(255,255,255,.8);
  font-size: 14px;
}
body footer.page-footer .pb-4 a img { transition: transform .15s ease; }
body footer.page-footer .pb-4 a:hover img { transform: translateY(-2px); }

/* ---------- มือถือ ---------- */
@media (max-width: 767.98px) {
  body { font-size: 16px; }
  body .navbar.bg-dark { padding: .5rem .9rem; }
  body .navbar .navbar-collapse {
    background: rgba(255,255,255,.06);
    border-radius: 14px;
    margin-top: .6rem;
    padding: .4rem;
  }
  body .navbar .dropdown-menu { box-shadow: none; border: 0; background: rgba(255,255,255,.96); }
  body .navbar .dropdown-item { min-width: 0; }
  main .container { padding-left: 14px; padding-right: 14px; }
  /* รายการข่าว: ไอคอนอยู่ซ้าย ข้อความชิดซ้าย อ่านง่ายขึ้น */
  body .card-body .media.d-block { display: flex !important; }
  body .card-body .media img.mx-auto { margin: .3rem 0 0 0 !important; }
  body .card-body .media .media-body { text-align: left !important; margin-left: .75rem !important; }
  body .card > .card-header { font-size: 16px; }
  body .card-header .pull-right { float: none !important; display: block; margin-top: .4rem; }
  body .breadcrumb { border-radius: 14px !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
