@import url('https://fonts.googleapis.com/css2?family=Kanit&display=swap');

/* Breadcrumb */
.breadcrumb-area {
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    background-color: #0066cc;
    min-height: 150px; /* กำหนดขั้นต่ำ */
    display: flex;
    align-items: center;
    height: 50vh; /* ความสูงของ breadcrumb */
}

.breadcrumb-content h4 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.custom-news-page {
  max-width: 1400px;
  width: 90%;
  margin: 40px auto 80px;
  padding: 0 24px;
  font-family: 'Kanit', sans-serif;
  color: #1E293B;
  background-color: transparent;  /* ไม่มีพื้นหลัง */
  border-radius: 0;
  box-shadow: none; /* ไม่มีเงา */
  user-select: none;
}

/* หัวข้อ */
.custom-news-page > h1 {
  font-size: 2.8rem;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: 48px;
  border-left: 4px solid #3B82F6;
  padding-left: 16px;
  letter-spacing: 0.05em;
  user-select: text;
}

/* ฟอร์มกรองข่าว */
.custom-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: transparent; /* ไม่มีพื้นหลัง */
  padding: 0;
  border-radius: 0;
  border: none;
  align-items: center;
  margin-bottom: 48px;
  user-select: text;
}

.custom-filter-form label {
  flex: 0 0 90px;
  font-weight: 700;
  color: #334155;
  font-size: 1.1rem;
}

.custom-filter-form input[type="text"],
.custom-filter-form select {
  flex: 1 1 220px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1.5px solid #94A3B8;
  font-size: 1rem;
  color: #1E293B;
  background-color: #FFFFFF;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.custom-filter-form input[type="text"]::placeholder {
  color: #64748B;
  font-style: italic;
}

.custom-filter-form input[type="text"]:focus,
.custom-filter-form select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
  background-color: #FFFFFF;
}

/* ปุ่มค้นหา */
.custom-filter-form button {
  flex: 0 0 auto;
  background-color: transparent;
  color: #3B82F6;
  border: 2.5px solid #3B82F6;
  padding: 12px 36px;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.custom-filter-form button i {
  font-size: 1.2rem;
}

.custom-filter-form button:hover,
.custom-filter-form button:focus {
  background-color: #3B82F6;
  color: #fff;
  border-color: #3B82F6;
}

/* Grid แสดงข่าว: 3 ต่อแถว */
.custom-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}

/* การ์ดข่าว — ไม่มีเงา ไม่มีพื้นหลัง แต่มีเส้นขอบบาง */
.custom-news-card {
  background: transparent;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.custom-news-card:hover {
  border-color: #3B82F6;
}

/* รูปภาพข่าว */
.custom-news-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1.5px solid #3B82F6;
  transition: transform 0.35s ease;
}

.custom-news-card:hover .custom-news-image {
  transform: scale(1.03);
}

/* กรณีไม่มีรูป */
.custom-news-image.no-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  color: #94A3B8;
  font-size: 1.1rem;
  font-style: italic;
}

/* เนื้อหาข่าว */
.custom-news-content {
  padding: 18px 22px 28px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* วันที่ */
.custom-news-date {
  font-size: 0.85rem;
  color: #3B82F6;
  font-weight: 700;
  margin-bottom: 10px;
  user-select: none;
}

/* ชื่อข่าว */
.custom-news-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 12px;
  line-height: 1.3;
  flex-grow: 0;
}

/* เนื้อหาย่อ */
.custom-news-summary {
  font-size: 1rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

/* ป้าย SDGs */
.custom-news-sdgs {
  margin-bottom: 16px;
}

.custom-news-sdgs span {
  padding: 4px 12px;
  border-radius: 20px;
  color: #3B82F6;
  font-weight: 600;
  font-size: 0.82rem;
  user-select: none;
  margin-right: 6px;
  display: inline-block;
  border: 1.5px solid #3B82F6;
  background: transparent;
}

/* ผู้เขียน */
.custom-news-author {
  font-size: 0.9rem;
  color: #64748B;
  font-weight: 600;
  margin-top: 6px;
  user-select: none;
}

/* ส่วนล่างของการ์ด */
.custom-news-footer {
  padding: 0 22px 24px;
  margin-top: auto;
}

.custom-news-footer a {
  color: #3B82F6;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  user-select: none;
}

.custom-news-footer a:hover {
  color: #1E40AF;
}

/* สองคอลัมน์หลัก+sidebar */
.custom-news-page.two-columns {
  display: flex;
  gap: 40px;
}

.main-column {
  flex: 3;
}

.sidebar-column {
  flex: 1;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  font-family: 'Kanit', sans-serif;
  color: #1E293B;
  user-select: none;
}

.sidebar-column h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3B82F6;
  margin-bottom: 24px;
  border-left: 4px solid #3B82F6;
  padding-left: 12px;
  user-select: text;
}

.sidebar-news-card {
  margin-bottom: 18px;
  border-bottom: 1px solid #CBD5E1;
  padding-bottom: 10px;
}

.sidebar-news-title a {
  color: #3B82F6;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.sidebar-news-title a:hover {
  color: #1E40AF;
}

.sidebar-news-date {
  font-size: 0.85rem;
  color: #64748B;
  margin-top: 6px;
  user-select: none;
}

/* Pagination */
.pagination {
  margin: 40px 0 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  user-select: none;
}

.pagination a,
.pagination span {
  display: inline-block;
  margin: 0 6px;
  padding: 8px 14px;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a {
  background-color: transparent;
  color: #3B82F6;
  border: 2px solid #3B82F6;
}

.pagination a:hover {
  background-color: #3B82F6;
  color: #fff;
}

.pagination .current {
  background-color: #1E40AF;
  color: #fff;
  cursor: default;
  border: none;
}

.pagination .prev,
.pagination .next {
  font-size: 1.2rem;
  font-weight: 900;
  padding: 8px 16px;
  background-color: transparent;
  color: #3B82F6;
  border: 2px solid #3B82F6;
}

.pagination .prev:hover,
.pagination .next:hover {
  background-color: #1E40AF;
  color: #fff;
}

/* Responsive */
@media (max-width: 991px) {
  .custom-news-page.two-columns {
    flex-direction: column;
  }

  .sidebar-column {
    margin-top: 40px;
    padding: 0;
  }

  .custom-news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 20px;
  }
}

@media (max-width: 575px) {
  .custom-news-grid {
    grid-template-columns: 1fr;
    gap: 20px 0;
  }

  .custom-filter-form {
    flex-direction: column;
    gap: 14px;
  }

  .custom-filter-form label {
    flex: unset;
    font-size: 1.1rem;
  }

  .custom-filter-form input[type="text"],
  .custom-filter-form select,
  .custom-filter-form button {
    flex: unset;
    width: 100%;
  }

  .custom-news-page > h1 {
    font-size: 2.4rem;
  }
}
