/* โหลดฟ้อนต์ Kanit */
@import url('https://fonts.googleapis.com/css2?family=Kanit&display=swap');

/* SDGs tag styles */
.sdg-tag {
  padding: 3px 7px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  margin-right: 5px;
  display: inline-block;
}
.sdg-red { background-color: #e53935; }
.sdg-orange { background-color: #fb8c00; }
.sdg-green { background-color: #43a047; }
.sdg-blue { background-color: #1e88e5; }
.sdg-yellow { background-color: #fdd835; color: #333; }
.sdg-purple { background-color: #8e24aa; }
.sdg-pink { background-color: #d81b60; }
.sdg-brown { background-color: #6d4c41; }
.sdg-gray { background-color: #757575; }
.sdg-teal { background-color: #00897b; }
.sdg-darkgreen { background-color: #2e7d32; }
.sdg-navy { background-color: #3949ab; }
.sdg-olive { background-color: #827717; }
.sdg-maroon { background-color: #4e342e; }
.sdg-cyan { background-color: #00acc1; }

/* หน้าเพจ */
.cesm-awards-pride-page {
  font-family: 'Kanit', sans-serif;
  margin: 0;
  padding: 0;
  color: #222;
  background: #fff;
}

/* พื้นหลังไล่สี */
.cesm-awards-pride-background {
   background: rebeccapurple;
  background-size: cover;
  padding: 40px 0;
  box-sizing: border-box;
}

/* หัวข้อเรื่องเด่น */
.cesm-awards-pride-section {
  width: 100%;
  max-width: none;
  margin: 0 0 40px 0;
  padding: 0 20px;
  text-align: center;
  color: #fff;
  position: relative;
}

.cesm-awards-pride-section h2 {
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
  letter-spacing: 0.05cm;
}

.cesm-awards-pride-section h2::after {
  content: "";
  width: 60px;
  height: 3px;
  background: #a68dff;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.cesm-awards-pride-section h2 a {
  font-weight: 400;
  font-size: 18px;
  color: #d1c5ff;
  margin-left: 10px;
  text-decoration: none;
  border-left: 1px solid #d1c5ff;
  padding-left: 12px;
  transition: color 0.3s ease;
}

.cesm-awards-pride-section h2 a:hover {
  color: #fff;
}

/* กริดการ์ดข่าวแบบ flex */
.cesm-awards-pride-grid {
  display: flex;
  flex-wrap: nowrap; /* ไม่ให้การ์ดแถวใหม่ */
  justify-content: space-between; 
  gap: 10px;
  padding: 0 20px 10px 20px;
  width: 100%;
  box-sizing: border-box;
}



/* การ์ดข่าว */
.cesm-awards-pride-card {
  flex: 0 0 24.5%; /* ปรับความกว้างของแต่ละการ์ด */
  max-width: 24.5%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 20px rgb(0 0 0 / 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #222;
  padding-bottom: 20px;
  transition: all 0.3s ease;
}

/* รูปภาพ */
.cesm-awards-pride-card img {
  width: calc(100% - 30px);
  height: 600px; /* เพิ่มขนาดรูปภาพหลัก */
  object-fit: cover;
  object-position: center center;
  margin: 10px 15px 0;
  display: block;
  transition: transform 0.3s ease;
}

.cesm-awards-pride-card:hover img {
  transform: scale(1.05);
}

/* ป้าย category สีเหลืองส้ม */
.cesm-category-tag {
  background-color: #ecb638;
  color: #422d00;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  display: flex;
  justify-content: flex-start;
  margin: 12px 15px 0;
  max-width: max-content;
  box-shadow: 0 3px 6px rgb(236 182 56 / 0.5);
}

/* เนื้อหา */
.cesm-news-content {
  flex-grow: 1;
  padding: 0 15px 0 15px;
  display: flex;
  flex-direction: column;
}

/* วันที่ */
.cesm-date {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

/* ชื่อข่าว */
.cesm-news-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.3;
}

/* สรุปข่าว */
.cesm-news-summary {
  font-size: 14px;
  color: #444;
  flex-grow: 1;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ปุ่มอ่านเพิ่มเติม (ซ่อน) */
.cesm-read-more {
  display: none;
}

/* ช่องเลขมุมล่างซ้าย (ซ่อน) */
.cesm-count-box {
  display: none;
}

/* ซ่อน .cesm-views และ .cesm-counts */
.cesm-views, .cesm-counts {
  display: none;
}

/* Swiper styles */
.swiper-container-wrapper {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}
.swiper {
  width: 100%;
  padding: 40px 20px;
}

.swiper-slide {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
}

.swiper-slide img {
  width: 100%;
  height: 320px; /* หรือปรับตามที่ต้องการ */
  margin: 0 auto;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.swiper.mySwiper .swiper-button-next,
.swiper.mySwiper .swiper-button-prev {
  color: #cccccccc;
  padding: 10px;
  margin: 0 auto;
  z-index: 10;
  border-radius: 20%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.swiper-container-wrapper .swiper-button-next::after,
.swiper-container-wrapper .swiper-button-prev::after {
  font-size: 30px; /* ปรับขนาดไอคอนที่แท้จริง */
}

.swiper-container-wrapper .swiper-button-next:hover{
  background-color: white;
  color: #ff00aa;
  transform: translateX(30%) scale(1.15);
}
.swiper-container-wrapper .swiper-button-prev:hover {
  background-color: white;
  color: #ff00aa;
  transform: translateX(-30%) scale(1.15);
}

.swiper-pagination {
  width: 100%;
  margin-bottom: -40px;
  text-align: center;
}

.swiper-container-wrapper .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background-color: #cccccccc;
  opacity: 1;
  transition: background-color 0.3s ease;
  margin: 0 6px;
}

.swiper-pagination-bullet-active {
  background-color: #ff00aa !important; /* สีม่วงเข้ม */
  opacity: 1; /* ทำให้ปุ่มที่เลือกชัดเจน */
}

.cesm-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
}

.cesm-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  max-width: 1000px;
  text-align: center;
  position: relative;
}

.cesm-modal-content-img {
  width: 100%;
  max-width: 1000px;
  height: 600px;
  object-fit: cover;
  object-position: center center;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.cesm-modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #444;
  cursor: pointer;
}

.cesm-modal-read-more {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background-color: #5c50ff;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}
.cesm-modal-read-more:hover {
  background-color: #7f71ff;
}

/* สำหรับภาพที่แสดงใน slide หรือ modal */
img.full-fixed {
  width: 100%;
  height: 350px;              /* ความสูงที่คุณต้องการให้เท่ากันทุกภาพ */
  object-fit: cover;          /* ครอบกรอบแต่รักษาสัดส่วนภาพ */
  object-position: center;    /* จัดตำแหน่งภาพให้อยู่กลาง */
  border-radius: 12px;        /* ถ้าต้องการขอบมน */
  display: block;
}

/* Responsive */

/* มือถือ */
@media (max-width: 480px) {
  body.cesm-body {
    padding: 20px 10px;
  }

  .cesm-awards-pride-section h2 {
    font-size: 22px;
  }

  .cesm-awards-pride-section h2 a {
    font-size: 14px;
    margin-left: 6px;
    border-left: none;
    padding-left: 6px;
  }

  .cesm-awards-pride-grid {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 10px;
  }

  .cesm-awards-pride-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .cesm-awards-pride-card img {
    height: 200px; /* เพิ่มขนาดรูปภาพมือถือ */
    width: 100%; /* เต็มความกว้าง */
    margin: 0;
  }

  .cesm-news-title {
    font-size: 16px;
  }

  .cesm-news-summary {
    font-size: 13px;
  }
}

/* แท็บเล็ต */
@media (min-width: 481px) and (max-width: 768px) {
  .cesm-awards-pride-grid {
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 15px;
  }

  .cesm-awards-pride-card {
    flex: 1 1 45%;
    max-width: 45%;
  }

  .cesm-awards-pride-card img {
    height: 250px; /* เพิ่มขนาดรูปภาพแท็บเล็ต */
    width: 100%;
    margin: 0;
  }

  .cesm-news-title {
    font-size: 17px;
  }

  .cesm-news-summary {
    font-size: 14px;
  }
}

/* เดสก์ท็อป */
@media (min-width: 769px) {
  .cesm-awards-pride-grid {
    flex-wrap: nowrap;
    gap: 15px;
    padding: 0 20px;
  }

  .cesm-awards-pride-card {
    flex: 0 0 24.5%;
    max-width: 24.5%;
  }

  .cesm-awards-pride-card img {
    height: 320px; /* เพิ่มขนาดรูปภาพเดสก์ท็อป */
    width: calc(100% - 30px);
    margin: 10px 15px 0;
  }

  .cesm-news-title {
    font-size: 18px;
  }

  .cesm-news-summary {
    font-size: 14px;
  }
}
