/* cards.css — article list + category filter บนหน้าแรก */

#posts-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 140px;
}

/* ── Category filter bar ── */
.cat-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-btn {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cat-btn .cat-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: rgba(0,0,0,0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Section header ── */
.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.posts-header-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hero-muted);
  font-family: var(--mono);
}

/* ── Article list table ── */
.post-list {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.post-list-head {
  display: grid;
  grid-template-columns: 1fr 140px 90px;
  padding: 9px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.post-list-head span {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.post-row {
  display: grid;
  grid-template-columns: 1fr 140px 90px;
  padding: 15px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-l);
  background: var(--surface);
  transition: background 0.12s;
  align-items: center;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background: var(--bg); }

.post-num { display: none; }
.post-list-head span:first-child { display: none; }

.post-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text2);
  padding-right: 16px;
  line-height: 1.4;
  transition: color 0.12s;
}
.post-row:hover .post-title { color: var(--text); }

.post-cat {
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 4px;
  display: inline-block;
  text-transform: uppercase;
  width: fit-content;
}

/* สีแต่ละหมวด */
.cat-microsoft { background: rgba(110,193,228,0.15); color: #2980b9; }
.cat-onedrive  { background: rgba(97,206,112,0.15);  color: #27ae60; }
.cat-windows   { background: rgba(155,89,182,0.15);  color: #8e44ad; }
.cat-youtube   { background: rgba(231,76,60,0.15);   color: #c0392b; }
.cat-general   { background: rgba(149,165,166,0.15); color: #7f8c8d; }
.cat-font      { background: rgba(243,156,18,0.15);  color: #d35400; }

.post-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

/* ── Post cards (mobile fallback) ── */
@media (max-width: 640px) {
  .post-list-head { display: none; }
  .post-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 4px;
    padding: 14px 16px;
  }
  .post-title { grid-row: 1; font-size: 0.95rem; padding-right: 0; }
  .post-cat { grid-row: 2; }
  .post-date { display: none; }
}
