/* ==========================================
   All News Page
   ========================================== */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  /* เดิมใช้ space-between ดันปุ่มตัวกรองชิดซ้ายสุด กล่องค้นหาชิดขวาสุด ดูไม่กึ่งกลางเหมือนหัวข้อด้านบน
     เปลี่ยนเป็น center ให้ทั้งแถบ (ปุ่มตัวกรอง + กล่องค้นหา) รวมกันอยู่กึ่งกลางแทน */
  justify-content: center;
  background-color: white;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .filter-bar {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 768px) {
  .filter-buttons {
    width: auto;
  }
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: none;
  cursor: pointer;
}

@media (min-width: 640px) {
  .filter-btn {
    font-size: 0.875rem;
  }
}

.filter-btn:hover {
  background-color: var(--slate-200);
}

.filter-btn.active {
  background-color: var(--brand-600);
  color: white;
}

.search-box {
  position: relative;
  width: 100%;
  right: 0px;
}

@media (min-width: 768px) {
  .search-box {
    width: 100%;
    max-width: 24rem;
    flex: 1;
    min-width: 16rem;
  }
}

.search-input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  line-height: 28px;
  padding: 0 1rem;
  padding-left: 2.5rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 2px solid transparent;
  outline: none;
  background-color: #f3f3f4;
  color: #0d0c22;
  transition: 0.3s ease;
}

.search-input::placeholder {
  color: #9e9ea7;
}

.search-input:focus,
.search-box:hover .search-input {
  outline: none;
  border-color: rgba(255, 130, 0, 0.4);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 130, 0, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  stroke: #f97316;
  fill: none;
  pointer-events: none;
}

.no-results {
  text-align: center;
  padding: 4rem 0;
}

.no-results-icon {
  width: 4rem;
  height: 4rem;
  background-color: var(--slate-100);
  color: var(--slate-400);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem auto;
}

.no-results p {
  color: var(--slate-500);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ==========================================
   News: Mobile-specific overrides (max-width: 480px)
   ========================================== */
@media (max-width: 480px) {
  .filter-bar {
    padding: 0.75rem;
    border-radius: 0.75rem;
  }

  .filter-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
  }
}
