/* ==========================================================================
   วิทยาลัยการอาชีพเถิน — Custom Theme Layer
   --------------------------------------------------------------------------
   ชั้น CSS เสริม โหลดต่อท้าย css/style.css (ห้ามแก้ style.css เดิม)
   คงโทนสีน้ำเงิน–ทองของวิทยาลัย แต่ยกระดับให้ดูพรีเมียมและอ่านง่ายขึ้น
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* น้ำเงินประจำวิทยาลัย */
  --c-navy-900: #04163f;
  --c-navy-800: #06246a;
  --c-navy-700: #0b327f;
  --c-navy-600: #12439b;
  --c-navy-500: #1d59bd;

  /* ทอง */
  --c-gold-600: #c98a00;
  --c-gold-500: #e8a900;
  --c-gold-400: #ffb600;
  --c-gold-300: #ffc947;

  /* กลาง ๆ */
  --c-ink: #16243f;
  --c-body: #42506b;
  --c-muted: #7a869e;
  --c-line: #e3e8f0;
  --c-line-soft: #eef2f8;
  --c-surface: #ffffff;
  --c-surface-alt: #f6f8fc;

  /* เงา */
  --sh-xs: 0 1px 2px rgba(6, 36, 106, .06);
  --sh-sm: 0 2px 8px rgba(6, 36, 106, .07);
  --sh-md: 0 8px 24px rgba(6, 36, 106, .10);
  --sh-lg: 0 18px 44px rgba(6, 36, 106, .16);

  /* มุมโค้ง */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* จังหวะ */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   2. Typography — ปรับให้เหมาะกับภาษาไทย
   style.css เดิมตั้ง text-transform:uppercase และ letter-spacing ติดลบ
   ซึ่งทำให้สระ/วรรณยุกต์ไทยชนกันและอ่านยาก จึงยกเลิกทั้งหมด
   -------------------------------------------------------------------------- */
body,
p,
li,
td,
th,
.card-text,
.info-text {
  line-height: 1.75;
  letter-spacing: normal;
}

body {
  color: var(--c-body);
  background: var(--c-surface);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.into-title,
.widget-title,
.card-title,
.action-title,
ul.navbar-nav > li > a,
.btn,
.btn-primary,
.btn-dark {
  text-transform: none;
  letter-spacing: normal;
  word-break: break-word;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--c-navy-800);
  line-height: 1.45;
}

h1 { font-size: clamp(1.65rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem); }
h3 { font-size: clamp(1.18rem, 1rem + .7vw, 1.45rem); }
h4 { font-size: 1.08rem; line-height: 1.6; }
h5 { font-size: 1rem; line-height: 1.6; }

a {
  transition: color .2s var(--ease);
}

/* โฟกัสคีย์บอร์ด — ช่วยให้ใช้งานผ่านคีย์บอร์ดได้ชัดเจน */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--c-gold-400);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--c-gold-300);
  color: var(--c-navy-900);
}

img {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   3. ปุ่ม
   -------------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-dark {
  border-radius: var(--r-pill);
  padding: 11px 26px;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--sh-xs);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-navy-600), var(--c-navy-800));
}

.btn-dark {
  background: linear-gradient(135deg, var(--c-navy-800), var(--c-navy-900));
}

.btn-primary:hover,
.btn-dark:hover,
.btn-white.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-gold-400), var(--c-gold-600));
  color: var(--c-navy-900);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.btn-primary:hover:active,
.btn-primary:hover:focus,
.btn-dark:hover:active,
.btn-dark:hover:focus,
.btn-white.btn-primary:hover:active,
.btn-white.btn-primary:hover:focus {
  background: linear-gradient(135deg, var(--c-gold-600), var(--c-gold-600)) !important;
  color: var(--c-navy-900);
}

.btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   4. แถบบนสุด (top bar)
   -------------------------------------------------------------------------- */
.top-bar {
  background: linear-gradient(90deg, var(--c-navy-900), var(--c-navy-700));
  color: rgba(255, 255, 255, .88);
  padding: 9px 0;
  font-size: .86rem;
  border-bottom: 2px solid var(--c-gold-400);
}

.top-bar a,
.top-bar .info-text,
.top-bar ul.top-info,
.top-bar ul.top-info li {
  color: rgba(255, 255, 255, .88);
}

.top-bar .info-text {
  font-size: .86rem;
  margin: 0;
  font-weight: 400;
  line-height: 1.6;
}

.top-bar ul.top-info li i,
.top-bar .social-icon i {
  color: var(--c-gold-400);
}

/* style.css เดิมตั้ง .top-social ul li a { color:#2c2c2c } ซึ่งเทาเข้มบน
   พื้นน้ำเงิน อ่านแทบไม่ออก — ต้องใช้ selector ที่เฉพาะเจาะจงกว่าเพื่อทับ */
.top-bar .top-social ul li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .92);
  font-size: .86rem;
  padding: 4px 12px 4px 0;
}

.top-bar .top-social ul li a .social-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-bar .top-social ul li a:hover,
.top-bar .top-social a:hover,
.top-bar a:hover {
  color: var(--c-gold-300);
}

.top-bar .top-social ul li a:hover i {
  color: var(--c-gold-300);
}

/* --------------------------------------------------------------------------
   5. โลโก้ + เมนูนำทาง
   -------------------------------------------------------------------------- */
.header-one .logo-area {
  padding: 10px 0;
}

.header-one .logo img {
  height: auto;
  object-fit: contain;
}

.header-one .site-navigation {
  background: linear-gradient(90deg, var(--c-navy-800), var(--c-navy-600));
  box-shadow: var(--sh-sm);
}

/* ตรึงเมนูไว้ด้านบนเมื่อเลื่อนหน้าจอ (เฉพาะจอใหญ่) */
@media (min-width: 992px) {
  .header-one .site-navigation {
    position: sticky;
    top: 0;
    z-index: 1030;
  }
}

ul.navbar-nav > li > a {
  font-size: .94rem;
  font-weight: 500 !important;
  line-height: 1.5;
  padding: 14px 14px !important;
  position: relative;
  border-radius: var(--r-sm);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}

@media (min-width: 992px) {
  /* ขีดทองใต้เมนูตอน hover */
  ul.navbar-nav > li > a::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 2px;
    background: var(--c-gold-400);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease);
  }

  ul.navbar-nav > li:hover > a::before,
  ul.navbar-nav > li.active > a::before {
    transform: scaleX(1);
  }
}

ul.navbar-nav > li:hover > a,
ul.navbar-nav > li.active > a {
  color: var(--c-gold-300) !important;
  background: rgba(255, 255, 255, .06);
}

/* เมนูย่อย */
.navbar-nav .dropdown-menu {
  border: 0;
  border-top: 3px solid var(--c-gold-400);
  border-radius: 0 0 var(--r-md) var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 8px;
  margin-top: 0;
  background: var(--c-surface);
}

.navbar-nav .dropdown-menu li > a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  color: var(--c-navy-800);
  font-size: .9rem;
  line-height: 1.6;
  white-space: normal;
  transition: background-color .18s var(--ease), color .18s var(--ease), padding-left .18s var(--ease);
}

.navbar-nav .dropdown-menu li > a:hover,
.navbar-nav .dropdown-menu li > a:focus {
  background: var(--c-surface-alt);
  color: var(--c-navy-600);
  padding-left: 20px;
}

@media (min-width: 992px) {
  .navbar-nav .dropdown-menu {
    min-width: 260px;
    max-width: 340px;
    animation: ct-drop .2s var(--ease) both;
  }
}

@keyframes ct-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ปุ่มเมนูบนมือถือ */
.navbar-toggler {
  border: 0;
  background: var(--c-gold-400);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  margin: 8px 0;
}

@media (max-width: 991px) {
  .navbar-collapse.collapse.show,
  .navbar-collapse.collapsing {
    max-height: 70vh;
    overflow-y: auto;
  }

  ul.navbar-nav > li > a {
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0;
  }

  .navbar-nav .dropdown-menu {
    background: rgba(255, 255, 255, .06);
    box-shadow: none;
    border-radius: var(--r-sm);
    border-top-color: var(--c-gold-400);
    margin: 4px 0 10px;
  }

  .navbar-nav .dropdown-menu li > a {
    color: #fff;
  }

  .navbar-nav .dropdown-menu li > a:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--c-gold-300);
  }
}

/* --------------------------------------------------------------------------
   6. แบนเนอร์ / สไลด์
   -------------------------------------------------------------------------- */
.banner-carousel .banner-carousel-item {
  background-size: cover;
  background-position: center;
}

.banner-carousel,
.banner-carousel .banner-carousel-item {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   7. กล่อง Call to action
   -------------------------------------------------------------------------- */
.call-to-action-box .action-style-box {
  background: linear-gradient(120deg, var(--c-navy-800) 0%, var(--c-navy-600) 55%, var(--c-navy-700) 100%);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  box-shadow: var(--sh-md);
  position: relative;
  overflow: hidden;
}

/* แถบทองบาง ๆ ด้านซ้าย */
.call-to-action-box .action-style-box::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--c-gold-300), var(--c-gold-600));
}

.call-to-action-box .action-title {
  font-size: clamp(1rem, .9rem + .5vw, 1.25rem);
  line-height: 1.6;
  font-weight: 600;
  color: #fff;
}

.call-to-action-box .btn-dark {
  background: var(--c-gold-400);
  color: var(--c-navy-900);
  white-space: nowrap;
}

.call-to-action-box .btn-dark:hover {
  background: #fff;
  color: var(--c-navy-800);
}

/* --------------------------------------------------------------------------
   8. หัวข้อ section
   -------------------------------------------------------------------------- */
.into-title,
.ts-service-area h1,
#ts-features .into-title {
  font-size: clamp(1.3rem, 1.05rem + .9vw, 1.75rem);
  font-weight: 600;
  color: var(--c-navy-800);
  position: relative;
  padding-bottom: 14px;
  line-height: 1.5;
}

.into-title::after,
.ts-service-area .row.text-center h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--c-gold-400), var(--c-gold-600));
}

.ts-service-area .row.text-center h1 {
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
}

.ts-service-area .row.text-center h1::after {
  left: 50%;
  transform: translateX(-50%);
}

.section-sub-title {
  color: var(--c-muted);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .02em;
  margin-top: 10px;
}

#ts-features,
#ts-service-area {
  padding-top: 52px;
}

/* --------------------------------------------------------------------------
   9. การ์ดข่าวประชาสัมพันธ์
   แก้ปัญหา: รูปสูงไม่เท่ากัน หัวข้อยาวไม่เท่ากัน ทำให้แถวไม่เรียบ
   -------------------------------------------------------------------------- */
#ts-features .row > [class*="col-"] {
  display: flex;
  margin-bottom: 28px;
}

#ts-features .card {
  width: 100%;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}

#ts-features .card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
  border-color: rgba(255, 182, 0, .5);
}

/* รูปสัดส่วน 4:3 เท่ากันทุกใบ */
#ts-features .card > a {
  display: block;
  overflow: hidden;
  background: var(--c-surface-alt);
}

#ts-features .card-img-top {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  transition: transform .5s var(--ease);
}

#ts-features .card:hover .card-img-top {
  transform: scale(1.06);
}

#ts-features .card-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

#ts-features .card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--c-navy-800);
  margin-bottom: 10px;
  /* จำกัด 3 บรรทัด */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#ts-features .card-text {
  font-size: .9rem;
  line-height: 1.75;
  color: var(--c-body);
  margin-bottom: 18px;
  /* จำกัด 4 บรรทัด */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ดันปุ่มไปชิดล่างเสมอ -> ปุ่มทุกใบอยู่ระดับเดียวกัน */
#ts-features .card-body .btn {
  margin-top: auto;
  align-self: flex-start;
  padding: 9px 22px;
  font-size: .875rem;
}

/* --------------------------------------------------------------------------
   10a. บล็อกคลิปวิดีโอเดี่ยว (.ts-video)
   ใช้คู่กับ <section class="ts-video"> ที่แทรกในหน้าแรก
   วางกึ่งกลางหน้า สัดส่วน 16:9 คงที่ ไม่ว่าจอกว้างเท่าไหร่
   -------------------------------------------------------------------------- */
.ts-video {
  padding: 52px 0 8px;

  /* ===== ปรับขนาดคลิปที่บรรทัดเดียวนี้ =====
     1140px = เท่ากับความกว้างเนื้อหาส่วนอื่น (ค่าเดิมของ Bootstrap)
     1400px = ใหญ่ขึ้น เด่นขึ้น (ค่าที่ใช้อยู่)
     1600px = ใหญ่มาก
     100%   = เต็มความกว้างจอ (ดู .ts-video--full ด้านล่าง) */
  --video-max: 1400px;
}

/* ขยายกรอบให้กว้างกว่า .container ปกติ โดยไม่กระทบส่วนอื่นของหน้า */
.ts-video .container {
  max-width: var(--video-max);
}

.ts-video .video-title {
  font-size: clamp(1.3rem, 1.05rem + .9vw, 1.75rem);
  font-weight: 600;
  color: var(--c-navy-800);
  text-align: center;
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 26px;
  line-height: 1.5;
}

.ts-video .video-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 64px;
  height: 4px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--c-gold-400), var(--c-gold-600));
}

.ts-video .video-subtitle {
  text-align: center;
  color: var(--c-muted);
  font-size: .95rem;
  margin: -14px 0 24px;
}

/* กรอบ 16:9 — ใช้เทคนิค padding-top 56.25% ซึ่งรองรับทุกเบราว์เซอร์
   (ไม่ใช้ .embed-responsive ของ Bootstrap เพราะเคยมีปัญหาคำบรรยายหลุด) */
.ts-video .video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--sh-lg);
}

.ts-video .video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ถ้าอยากให้คลิปเต็มความกว้างจอ เพิ่มคลาส ts-video--full ที่ <section>
   เช่น <section class="ts-video ts-video--full"> */
.ts-video--full .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.ts-video--full .row {
  margin-left: 0;
  margin-right: 0;
}

.ts-video--full [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

.ts-video--full .video-frame {
  border-radius: 0;
}

@media (max-width: 575px) {
  .ts-video {
    padding-top: 32px;
  }

  .ts-video .video-frame {
    border-radius: var(--r-md);
  }
}

/* --------------------------------------------------------------------------
   10. วิดีโอ Presentation (ชุด 3 คลิปแบบเดิม — ปัจจุบันถูกลบออกจากหน้าแรกแล้ว
   คงกฎไว้เผื่อนำ markup เดิมกลับมาใช้)
   -------------------------------------------------------------------------- */
/* .embed-responsive ของ Bootstrap วาง iframe แบบ absolute และกันพื้นที่ด้วย
   ::before 56.25% ทำให้คำบรรยายหลุดไปอยู่ใต้วิดีโอและเหลือช่องว่างใหญ่ด้านล่าง
   จึงปิดกลไกนั้นแล้วใช้ aspect-ratio แทน */
.article11566 .embed-responsive {
  position: static;
  overflow: visible;
  height: auto;
}

.article11566 .embed-responsive::before {
  display: none;
}

.article11566 .embed-responsive iframe,
.article11566 .embed-responsive .embed-responsive-item {
  position: static;
  top: auto;
  left: auto;
  bottom: auto;
}

.article11566 .embed-responsive > p:first-child {
  font-weight: 500;
  color: var(--c-navy-800);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 12px;
  min-height: 3.2em;
}

.article11566 iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  background: #000;
}

.article11566 .embed-responsive > p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   11. แผงข่าวประกาศ (.GeneralNew)
   คลาส box-darkred / box-green / veccustom / body-white / News /
   event-title / custom-event-infos ตกค้างจากระบบ DNN เดิม และไม่เคยมี CSS
   รองรับเลย จึงแสดงผลเป็นลิสต์ลิงก์เปล่า ๆ — ส่วนนี้คือการคืนสไตล์ให้
   -------------------------------------------------------------------------- */
.article18477,
.article11569,
[class^="article1"][class*=" row"] {
  margin-left: 0;
  margin-right: 0;
}

.GeneralNew {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: 18px;
  transition: box-shadow .28s var(--ease);
}

.GeneralNew:hover {
  box-shadow: var(--sh-md);
}

/* หัวแผง */
.GeneralNew > h3 {
  margin: 0;
  padding: 16px 22px;
  font-size: clamp(1rem, .92rem + .35vw, 1.2rem);
  font-weight: 600;
  line-height: 1.55;
  color: #fff;
  letter-spacing: normal;
  text-transform: none;
  position: relative;
}

.GeneralNew > h3::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-gold-300), var(--c-gold-600));
}

.box-darkred > h3 {
  background: linear-gradient(120deg, #7d1128, #a81b35);
}

.box-green > h3 {
  background: linear-gradient(120deg, var(--c-navy-800), var(--c-navy-600));
}

/* ตัวแผง — จำกัดความสูงให้สองคอลัมน์เสมอกัน และเลื่อนดูต่อได้ */
.GeneralNew > .body-white {
  background: var(--c-surface);
  padding: 6px 22px 14px;
  max-height: 27rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line) transparent;
}

.GeneralNew > .body-white::-webkit-scrollbar {
  width: 8px;
}

.GeneralNew > .body-white::-webkit-scrollbar-thumb {
  background: var(--c-line);
  border-radius: var(--r-pill);
}

.GeneralNew > .body-white::-webkit-scrollbar-thumb:hover {
  background: var(--c-muted);
}

/* --- รายการข่าว / รายการเอกสาร ---------------------------------------------
   .event-title + .custom-event-infos ถูกใช้ทั้งในแผง .GeneralNew (หน้าแรก)
   และแบบเดี่ยว ๆ ในหน้าอื่น เช่น ข้อมูลงบประมาณและการเงิน
   จึงเขียนสไตล์พื้นฐานแบบไม่ผูกกับ .GeneralNew ก่อน แล้วค่อยปรับเฉพาะในแผง */

/* ซ่อนไอคอนฟอนต์เก่า (simple-line-icons) ที่ไม่มีไฟล์ฟอนต์รองรับในธีมนี้ */
.IconEdit,
.event-title em.icon,
.custom-event-infos em.icon {
  display: none;
}

.event-title {
  position: relative;
  padding: 14px 8px 0 34px;
  line-height: 1.7;
}

/* ไอคอนเอกสารหน้ารายการ (ใช้ Font Awesome 5 ที่ธีมโหลดอยู่แล้ว) */
.event-title::before {
  content: "\f15c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 8px;
  top: 17px;
  font-size: .85rem;
  color: var(--c-gold-500);
  line-height: 1.4;
}

.event-title strong {
  font-weight: 500;
}

.event-title a {
  color: var(--c-navy-800);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(var(--c-gold-400), var(--c-gold-400));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: left 95%;
  transition: background-size .3s var(--ease), color .2s var(--ease);
}

.event-title a:hover,
.event-title a:focus {
  color: var(--c-navy-500);
  background-size: 100% 2px;
}

/* วันที่ — ทำเป็นป้ายเล็ก */
.custom-event-infos {
  padding: 6px 8px 14px 34px;
  border-bottom: 1px solid var(--c-line-soft);
}

.custom-event-infos p {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 12px;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--c-muted);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
}

.custom-event-infos p::before {
  content: "\f133";
  font-family: "Font Awesome 5 Free";
  font-weight: 400;
  color: var(--c-gold-500);
}

/* --- ในแผง .GeneralNew ให้แถวทั้งแถว (.News) เป็นตัวจัดระยะและ hover แทน --- */
.GeneralNew .News {
  padding: 14px 10px 14px 34px;
  border-bottom: 1px solid var(--c-line-soft);
  border-radius: var(--r-sm);
  position: relative;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}

.GeneralNew .News:last-child {
  border-bottom: 0;
}

.GeneralNew .News:hover {
  background: var(--c-surface-alt);
  transform: translateX(3px);
}

.GeneralNew .News::before {
  content: "\f15c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 8px;
  top: 17px;
  font-size: .85rem;
  color: var(--c-gold-500);
  line-height: 1.4;
}

/* ภายในแผง ไอคอน/เส้นคั่น/ระยะขอบเป็นหน้าที่ของ .News แล้ว */
.GeneralNew .News .event-title {
  padding: 0;
}

.GeneralNew .News .event-title::before {
  display: none;
}

.GeneralNew .News .custom-event-infos {
  padding: 0;
  margin-top: 6px;
  border-bottom: 0;
}

/* ลิงก์ "อ่านข่าวเพิ่มเติม" ใต้แผง */
a[id$="lnkMore"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 32px;
  padding: 9px 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--c-navy-600);
  color: var(--c-navy-600);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--c-surface);
  transition: background-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}

a[id$="lnkMore"]::after {
  content: "\f061";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: .75rem;
  transition: transform .22s var(--ease);
}

a[id$="lnkMore"]:hover {
  background: var(--c-navy-600);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

a[id$="lnkMore"]:hover::after {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   11b. หน้าภายใน — แบนเนอร์หัวเรื่อง + breadcrumb
   -------------------------------------------------------------------------- */
.banner-area {
  position: relative;
  background-size: cover;
  background-position: center;
}

.banner-area::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 22, 63, .35), rgba(4, 22, 63, .78));
}

/* หมายเหตุ: .banner-text ของธีมเป็น position:absolute + translateY(-50%)
   เพื่อจัดกึ่งกลางแนวตั้ง — ห้ามเปลี่ยน position ที่นี่
   ตัวมันมี z-index:1 อยู่แล้วจึงอยู่เหนือ ::after โดยอัตโนมัติ */
.banner-area .banner-title {
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
  line-height: 1.4;
  margin-bottom: 0;
}

.banner-area .breadcrumb {
  background: rgba(255, 255, 255, .12);
  border-radius: var(--r-pill);
  display: inline-flex;
  padding: 6px 20px;
  margin-top: 14px;
}

.banner-area .breadcrumb-item,
.banner-area .breadcrumb-item a {
  color: rgba(255, 255, 255, .92);
  font-size: .88rem;
}

.banner-area .breadcrumb-item a:hover {
  color: var(--c-gold-300);
}

/* --------------------------------------------------------------------------
   11c. กล่องข้อมูลติดต่อ / บริการ (.ts-service-box-bg)
   เดิมเป็นสีเทาเข้มและวางชิดกันจนดูเป็นแผ่นเดียว
   -------------------------------------------------------------------------- */
.ts-service-box-bg {
  background: linear-gradient(160deg, var(--c-navy-800), var(--c-navy-900));
  border-radius: var(--r-lg);
  padding: 34px 24px 30px;
  margin-bottom: 26px;
  box-shadow: var(--sh-md);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}

.ts-service-box-bg:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-lg);
}

.ts-service-box-bg h4 {
  color: #fff;
  font-weight: 600;
  margin-bottom: 8px;
}

.ts-service-box-bg p {
  color: rgba(255, 255, 255, .8);
  margin-bottom: 8px;
}

.ts-service-box-bg a,
.ts-service-box-bg a.text-primary {
  color: var(--c-gold-300) !important;
}

.ts-service-box-bg a:hover,
.ts-service-box-bg a.text-primary:hover {
  color: #fff !important;
}

.ts-service-box-bg .ts-service-icon.icon-round {
  box-shadow: 0 6px 18px rgba(255, 182, 0, .3);
}

/* --------------------------------------------------------------------------
   12. ตาราง (หน้าบุคลากร / งบประมาณ)
   -------------------------------------------------------------------------- */
table:not(.no-style) {
  border-collapse: separate;
  border-spacing: 0;
}

.table,
table.table {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  background: var(--c-surface);
}

.table thead th,
table.table thead th {
  background: var(--c-navy-800);
  color: #fff;
  font-weight: 500;
  border: 0;
  vertical-align: middle;
}

.table td,
.table th,
table.table td,
table.table th {
  border-color: var(--c-line-soft);
  vertical-align: middle;
}

.table tbody tr:hover,
table.table tbody tr:hover {
  background: var(--c-surface-alt);
}

/* --------------------------------------------------------------------------
   13. ส่วนท้าย (footer)
   -------------------------------------------------------------------------- */
.footer {
  background: linear-gradient(160deg, var(--c-navy-900) 0%, var(--c-navy-800) 60%, var(--c-navy-700) 100%);
  color: rgba(255, 255, 255, .78);
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-gold-300), var(--c-gold-600), var(--c-gold-300));
}

.footer-main {
  padding: 56px 0 44px;
}

.footer .widget-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.6;
  margin: 0 0 18px;
  padding-left: 14px;
  border-left: 3px solid var(--c-gold-400);
}

.footer p,
.footer a {
  color: rgba(255, 255, 255, .78);
  font-size: .92rem;
  line-height: 1.85;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--c-gold-300);
}

.footer h4 {
  color: #fff !important;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 22px;
  margin-bottom: 10px;
}

/* โลโก้ในฟุตเตอร์ */
.footer .img-thumbnail {
  background: rgba(255, 255, 255, .95);
  border: 0;
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow: var(--sh-md);
  max-width: 150px;
}

@media (max-width: 767px) {
  .footer .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 28px;
    text-align: center;
  }

  /* บนจอเล็กจัดกึ่งกลาง — ใช้ ::after เป็นขีดทอง แทน border-bottom
     เพื่อไม่ให้ลิงก์ตัวถัดไปไหลมาอยู่บรรทัดเดียวกับหัวข้อ */
  .footer .widget-title {
    display: block;
    border-left: 0;
    padding-left: 0;
    padding-bottom: 12px;
    margin-bottom: 16px;
    position: relative;
  }

  .footer .widget-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    border-radius: var(--r-pill);
    background: var(--c-gold-400);
  }

  .footer .img-thumbnail {
    margin: 0 auto 10px;
  }
}

/* --------------------------------------------------------------------------
   14. ปุ่มกลับขึ้นบน
   -------------------------------------------------------------------------- */
.back-to-top {
  right: 24px;
  bottom: 24px;
  z-index: 1040;
}

.back-to-top .btn {
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-gold-400);
  color: var(--c-navy-900);
  box-shadow: var(--sh-md);
}

.back-to-top .btn:hover {
  background: #fff;
  color: var(--c-navy-800);
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   15. ลูกเล่นเล็ก ๆ
   -------------------------------------------------------------------------- */
/* เส้นคั่นนุ่ม ๆ ระหว่าง section ข่าวประกาศ */
#ts-service-area .row.mt-4 {
  margin-top: 36px !important;
}

/* ภาพในเนื้อหาทั่วไป ให้มีมุมโค้งและเงา */
.ts-service-area img:not(.img-thumbnail):not(.card-img-top),
.ts-features img:not(.card-img-top) {
  border-radius: var(--r-md);
}

/* --------------------------------------------------------------------------
   16. เคารพการตั้งค่า "ลดการเคลื่อนไหว" ของผู้ใช้
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  #ts-features .card:hover,
  .btn:hover,
  .back-to-top .btn:hover,
  a[id$="lnkMore"]:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   17. ปรับตามขนาดจอ
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991px) {
  /* col-md-3 = 4 ใบต่อแถว ซึ่งเหลือใบละ ~150px ในช่วงแท็บเล็ต
     แคบเกินกว่าจะอ่านหัวข้อภาษาไทยได้ จึงลดเหลือ 2 ใบต่อแถว */
  #ts-features .row > .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 991px) {
  #ts-features,
  #ts-service-area {
    padding-top: 36px;
  }

  .call-to-action-box .action-style-box {
    padding: 24px;
    text-align: center;
  }

  .call-to-action-box .action-style-box::before {
    width: 100%;
    height: 4px;
    inset: 0 0 auto 0;
    background: linear-gradient(90deg, var(--c-gold-300), var(--c-gold-600));
  }

  .GeneralNew > .body-white {
    max-height: none;
  }
}

@media (max-width: 575px) {
  .GeneralNew > h3 {
    padding: 14px 16px;
  }

  .GeneralNew > .body-white {
    padding: 4px 16px 12px;
  }

  #ts-features .card-body {
    padding: 16px 16px 18px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

/* --------------------------------------------------------------------------
   18. สำหรับการพิมพ์
   -------------------------------------------------------------------------- */
@media print {
  .top-bar,
  .site-navigation,
  .back-to-top,
  .banner-carousel,
  .call-to-action-box {
    display: none !important;
  }

  .GeneralNew > .body-white {
    max-height: none;
    overflow: visible;
  }

  body {
    color: #000;
  }
}
