/* หน้ารวมบทความ /articles */
body { margin: 0; padding: 0; font-family: sans-serif; background: #fff; }

/* min-width:0 จำเป็น เพราะ footer.css ตั้ง body เป็น flex ทำให้แถบหมวด (เลื่อนแนวนอน) ดันหน้ากว้างเกินจอมือถือ */
.articles-page { max-width: 1200px; width: 100%; min-width: 0; box-sizing: border-box; margin: 0 auto; padding: 30px 16px 60px; }

.articles-head { text-align: center; margin-bottom: 24px; }
.articles-head h1 { color: #998208; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 8px; }
.articles-underline { width: 120px; height: 5px; margin: 0 auto 14px; border-radius: 5px; background: linear-gradient(90deg, #FFD90D, #FFA200); }
.articles-head p { color: #5c4a47; margin: 0; }

.articles-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 30px; }
.articles-tabs a { padding: 8px 18px; border-radius: 999px; border: 2px solid #FFA200; color: #8a5a00; text-decoration: none; font-weight: bold; font-size: .95rem; background: #fff; }
.articles-tabs a span { font-weight: normal; opacity: .75; }
.articles-tabs a.active, .articles-tabs a:hover { background: linear-gradient(90deg, #FFD90D, #FFA200); color: #3a2f00; border-color: transparent; }

.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

.article-card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.1); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.article-card-img { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #fff8d6, #ffe58a); overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card-cat { align-self: flex-start; font-size: .8rem; font-weight: bold; color: #8a5a00; background: #fff3b0; padding: 3px 10px; border-radius: 999px; }
.article-card h2 { font-size: 1.15rem; line-height: 1.45; color: #4a3d3a; margin: 0; }
.article-card p { font-size: .95rem; line-height: 1.6; color: #6b5d5a; margin: 0; flex: 1; }
.article-card time { font-size: .85rem; color: #8a7a55; }

.articles-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; }
.articles-pagination a, .articles-pagination span { min-width: 42px; padding: 8px 12px; text-align: center; border-radius: 8px; text-decoration: none; color: #8a5a00; border: 1px solid #f0d78a; }
.articles-pagination span { border-color: transparent; }
.articles-pagination a.active { background: linear-gradient(90deg, #FFD90D, #FFA200); color: #3a2f00; border-color: transparent; font-weight: bold; }
.articles-pagination a:hover { background: #fff3b0; }

.articles-empty { text-align: center; color: #5c4a47; padding: 40px 0; }
.articles-empty a { color: #b07800; }

@media (max-width: 600px) {
  .articles-page { padding-top: 20px; }
  .articles-grid { grid-template-columns: 1fr; gap: 18px; }
  .articles-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .articles-tabs::-webkit-scrollbar { display: none; }
  .articles-tabs a { white-space: nowrap; }
}
