/* Blog index — filter strip and post cards.
 *
 * ADAPTED FROM the "Index / filter page" block in src/blog-static/blog.css, which
 * has shipped to production since the blog launched and been DEAD the whole time:
 * the 18 posts load blog.css and use only `.filter-pill` as a decorative label,
 * while /blog/ renders through base.njk and never loads blog.css at all.
 *
 * THREE MANDATORY CHANGES on the way over, each of which would otherwise be a bug:
 *
 *  1. `.card-grid` → `.post-grid`. site.css:114 ALSO defines `.card-grid`, with a
 *     different grid, so keeping the name means this stylesheet silently reflows
 *     /tenders/, /glossary/ and /funding/ the moment any of them loads it.
 *  2. `.piece-card` → `.post-card`, and the `.is-planned` / `.is-backlog` /
 *     `.status-dot` / `.type-tag-*` states are dropped. They describe an editorial
 *     pipeline; these are 18 published posts.
 *  3. Every hardcoded hex becomes var(--token, literal). /blog/ has the tokens
 *     today, but radar.css's header records what happens to a stylesheet that
 *     assumes them: it applies and still renders nothing.
 */

/* === Filter strip === */
.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  margin: 8px 0 28px;
  background: var(--card-mist, rgba(15, 20, 35, 0.60));
  border: 1px solid var(--glass-edge, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-card, 20px);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint, rgba(255, 255, 255, 0.45));
  min-width: 74px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-edge, rgba(255, 255, 255, 0.06));
  color: var(--text-dim, rgba(255, 255, 255, 0.65));
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
}
.filter-pill[aria-pressed='true'] {
  background: rgba(56, 130, 150, 0.40);
  border-color: var(--plasma-cyan, rgba(180, 220, 240, 0.4));
  color: var(--text, #fff);
}
.filter-pill .count {
  font-size: 11px;
  color: var(--text-faint, rgba(255, 255, 255, 0.45));
  font-weight: 400;
}
.filter-pill[aria-pressed='true'] .count { color: rgba(255, 255, 255, 0.7); }

.filter-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-edge, rgba(255, 255, 255, 0.06));
  color: var(--text, #fff);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.filter-search:focus {
  border-color: var(--plasma-cyan, rgba(180, 220, 240, 0.4));
  background: rgba(255, 255, 255, 0.06);
}
.filter-search::placeholder { color: rgba(255, 255, 255, 0.3); }

.filter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint, rgba(255, 255, 255, 0.5));
}
.filter-reset {
  background: none;
  border: none;
  color: var(--plasma-cyan, rgba(180, 220, 240, 0.85));
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* === Cards === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
}

.post-card {
  background: var(--card-mist, rgba(15, 20, 35, 0.60));
  border: 1px solid var(--glass-edge, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-card, 20px);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}
.post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.post-card__cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}
.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  flex: 1;
}
.post-card__topic {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(56, 130, 150, 0.28);
  border: 1px solid var(--glass-edge, rgba(255, 255, 255, 0.06));
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.75));
}
/* 17px, not site.css's 27px h2 — the heading LEVEL is h2 so the page stops
   jumping h1 → h3, but a card title is not a section heading. */
.post-card__title {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text, rgba(255, 255, 255, 0.92));
}
.post-card__excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim, rgba(255, 255, 255, 0.62));
}
.post-card__meta {
  margin: auto 0 0;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-faint, rgba(255, 255, 255, 0.38));
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--glass-edge, rgba(255, 255, 255, 0.10));
  border-radius: var(--radius-card, 20px);
  color: var(--text-dim, rgba(255, 255, 255, 0.62));
}
