/* ==========================================================================
   Component: Filterable post list (category page)
   Sticky head with subcategory filter tabs, horizontal list cards, load more.
   JS: assets/js/components/post-filter.js
   ========================================================================== */

/* ---------- Head + filter tabs ---------- */
.post-list__head {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px -24px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface);
}
.post-list__head .bar-title { flex: none; white-space: nowrap; }

.filter-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: none;
  padding: 5px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--mist);
  color: var(--sub);
  font: 600 .76rem/1.5 var(--font);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tabs-arrow {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.tabs-arrow[hidden] { display: none; }
.tabs-arrow .icon { width: 12px; height: 12px; }
.tabs-arrow:hover { border-color: var(--brand); background: var(--brand); }
.tabs-arrow:hover .icon { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .tabs-arrow .icon { filter: invert(1); }

/* ---------- List card ---------- */
.list-card {
  position: relative;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.list-card:last-of-type { padding-bottom: 0; border-bottom: 0; }

.list-card__thumb {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 10;
}
.list-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.list-card:hover .list-card__thumb img { transform: scale(1.05); }

.list-card__title {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}
.list-card__title a:hover { color: var(--brand); }

.list-card__excerpt {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  font-size: .85rem;
  color: var(--sub);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-list__empty {
  padding: 24px 0;
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 575.98px) {
  .post-list__head { flex-wrap: wrap; margin: -20px -20px 20px; padding: 14px 20px; }
  .filter-tabs-wrap { margin-left: 0; width: 100%; }
}
