:where(.wp-site-blocks) > * {
  margin-block-start: 0 !important;
  margin-block-end: 0;
}

.content-wrapper {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  z-index: 5;
}

:where(.wp-site-blocks) * {
  margin: 0;
  padding: 0;
  border: 0;
}

:root :where(.is-layout-constrained) > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

body {
  margin: 0;
  margin-top: 65px;
  padding: 0;
  font-family: "Noto Sans Thai", sans-serif; /* Use Noto Sans Thai for Thai text */
  font-size: 16px;
  color: #333;
  background-color: #f0f0f0; /* Light background for better contrast */
  width: 100%;
  overflow-x: hidden;
  background: url(../img/background.jpg) top center;
  background-size: cover;
}

.content-container {
  margin-top: 65px !important;
  min-height: 80vh;
}

.jx3-content-category {
  color: #7c612b; /* สีของตัวอักษร "ประเภทข่าว" */
  font-size: 24px; /* ปรับขนาด font ตามความเหมาะสม (จากรูปน่าจะประมาณ 40-50px) */
  font-weight: bold; /* ตัวอักษรค่อนข้างหนา */
  text-align: left; /* จัดตำแหน่งข้อความ (ในรูปตัวอย่างชิดซ้าย) */
  position: relative; /* สำหรับวางขีดล่าง */
  padding-bottom: 2px; /* เว้นระยะห่างระหว่างข้อความกับขีดล่าง */
  display: inline-block; /* ทำให้ element มีความกว้างเท่ากับเนื้อหา */
  line-height: 1.2; /* ปรับ line-height หากต้องการ */
}

.jx3-content-category a {
  color: #7c612b; /* สีของลิงก์ */
  text-decoration: none; /* ไม่มีขีดเส้นใต้ */
}

.jx3-content-category a:hover {
  color: #f5ad3d; /* เปลี่ยนสีเมื่อ hover */
  text-decoration: underline; /* ขีดเส้นใต้เมื่อ hover */
}

.jx3-content-category::after {
  content: ""; /* ต้องมี content เพื่อให้ ::after แสดงผล */
  position: absolute;
  left: 0; /* ชิดซ้าย */
  bottom: 0; /* อยู่ด้านล่างของ .news-category-title */
  width: 100%; /* ความยาวของขีดล่างเท่ากับความกว้างของข้อความ */
  height: 3px; /* ความหนาของขีดล่าง */
  background-color: #f5ad3d; /* สีของขีดล่าง */
}

.jx3-content-post-featured-image,
.jx3-content-post-item-featured-image {
  position: relative;
  width: 100%;
  height: auto;
  margin-bottom: 20px; /* เว้นระยะห่างด้านล่าง */
  display: block;
}

.jx3-content-post-featured-image img,
.jx3-content-post-item-featured-image img {
  box-sizing: border-box;
  height: auto;
  max-width: 100%;
  vertical-align: bottom;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9; /* กำหนดอัตราส่วนภาพ */
}

.jx3-content-post-featured-image::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-47.75%, -48%);
  width: 230%;
  height: 110%;
  background: url(../img/frame_head.webp) no-repeat center center;
  background-size: contain;
  z-index: 5;
}

.jx3-content-post-item-featured-image::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -49%);
  width: 100%;
  height: 110%;
  background: url(../img/frame.webp) no-repeat center center;
  background-size: contain;
  z-index: 5;
}

#main-banner .swiper {
  margin: 10% 0;
}

#main-banner .swiper-slide {
  overflow: unset;
}

#main-banner .swiper-slide .jx3-content-post-featured-image {
  opacity: 0; /* เริ่มต้นด้วยความโปร่งใส 0 */
}

#main-banner .swiper-slide.swiper-slide-prev .jx3-content-post-featured-image,
#main-banner .swiper-slide.swiper-slide-next .jx3-content-post-featured-image {
  opacity: 0.2; /* ความโปร่งใสสำหรับสไลด์ก่อนหน้าและถัดไป */
}

#main-banner .swiper-slide.swiper-slide-active .jx3-content-post-featured-image {
  opacity: 1;
}

/*UL*/
.jx3-content-post-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
}

/*LI 2 Columns*/
.jx3-content-post-list li {
  width: calc(50% - 10px); /* กำหนดความกว้างของแต่ละรายการ */
  margin-bottom: 20px; /* เว้นระยะห่างด้านล่าง */
  box-sizing: border-box; /* ทำให้ padding และ border ไม่ทำให้ขนาดเปลี่ยน */
  position: relative; /* สำหรับวางกรอบ */
}

.jx3-content-post-list li a {
  color: #000;
  text-decoration: none;
}

.jx3-content-post-list li p {
  display: flex;
  background: url(../img/news_header.webp) no-repeat center center;
  aspect-ratio: 848 / 174; /* กำหนดอัตราส่วนภาพ */
  background-size: contain;
  padding: 20px;
  justify-content: center;
  align-items: center;
}

.jx3-content-post-list li p span.title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  font-size: 24px;
  line-height: 32px;
  font-weight: bold;
  height: 64px;
}

.mobile .jx3-content-post-list li {
  width: 100%; /* กำหนดความกว้างของแต่ละรายการเป็น 100% สำหรับมือถือ */
}

.tablet .jx3-content-post-list li p {
  background-size: contain;
  padding: 0px;
  justify-content: center;
  align-items: center;
}

.tablet .jx3-content-post-list li p span.title {
  font-size: 20px; /* ปรับขนาด font สำหรับแท็บเล็ต */
  line-height: 28px; /* ปรับ line-height สำหรับแท็บเล็ต */
}

.news-more-button {
  text-align: center;
  margin: 20px 0;
}

.news-more-button img {
  width: 100%;
  max-width: 500px; /* กำหนดความกว้างสูงสุดของปุ่ม */
  height: auto;
}

.pagination {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.pagination .page-numbers {
  margin: 0 5px;
  padding: 10px 15px;
  background-color: #f5ad3d; /* สีพื้นหลังของปุ่ม */
  color: #fff; /* สีตัวอักษร */
  border-radius: 5px; /* มุมโค้ง */
  text-decoration: none; /* ไม่มีขีดเส้นใต้ */
}

.pagination .page-numbers.current {
  background-color: #7c612b; /* สีพื้นหลังของปุ่มที่ถูกเลือก */
  color: #fff; /* สีตัวอักษร */
}

.pagination .page-numbers:hover {
  background-color: #f5ad3d; /* เปลี่ยนสีพื้นหลังเมื่อ hover */
  color: #fff; /* สีตัวอักษรเมื่อ hover */
}

.pagination .next {
  display: flex;
  align-items: center;
}

.pagination .previous {
  display: flex;
  align-items: center;
}
