/* ── Post grid ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  list-style: none;
}

.post-grid li:first-child {
  grid-column: 1 / -1;
}

/* ── Post card ── */
.post-card {
  background: var(--white);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.post-card::before {
  content: '';
  display: block;
  height: 5px;
  width: 100%;
}

/* Card top-bar colours by position */
.post-grid li:nth-child(1) .post-card::before { background: var(--blue); }
.post-grid li:nth-child(2) .post-card::before { background: var(--green); }
.post-grid li:nth-child(3) .post-card::before { background: var(--orange); }
.post-grid li:nth-child(4) .post-card::before { background: var(--purple); }
.post-grid li:nth-child(5) .post-card::before { background: var(--teal); }
.post-grid li:nth-child(6) .post-card::before { background: var(--red); }
.post-grid li:nth-child(7) .post-card::before { background: var(--green); }

/* ── Card body ── */
.card-body {
  padding: 1.25rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card .post-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* ── Badge ── */
.post-card .badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  color: var(--white);
  margin-right: 0.4rem;
}

.post-grid li:nth-child(1) .badge { background: var(--blue); }
.post-grid li:nth-child(2) .badge { background: var(--green); }
.post-grid li:nth-child(3) .badge { background: var(--orange); }
.post-grid li:nth-child(4) .badge { background: var(--purple); }
.post-grid li:nth-child(5) .badge { background: var(--teal); }
.post-grid li:nth-child(6) .badge { background: var(--red); }
.post-grid li:nth-child(7) .badge { background: var(--green); }

/* ── Card headings ── */
.post-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  letter-spacing: -0.3px;
}

.post-grid li:first-child .post-card h2 {
  font-size: 1.8rem;
}

.post-card h2 a {
  text-decoration: none;
  color: var(--text);
}

.post-card h2 a:hover {
  color: var(--blue);
}

/* ── Excerpt ── */
.post-card .post-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
  margin-bottom: 1.1rem;
}

.post-grid li:first-child .post-excerpt {
  font-size: 1rem;
}

/* ── Read more button ── */
.read-more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  padding: 0.45rem 1rem;
  transition: opacity 0.15s;
}

.read-more:hover {
  opacity: 0.85;
}

.post-grid li:nth-child(1) .read-more { background: var(--blue); }
.post-grid li:nth-child(2) .read-more { background: var(--green); }
.post-grid li:nth-child(3) .read-more { background: var(--orange); }
.post-grid li:nth-child(4) .read-more { background: var(--purple); }
.post-grid li:nth-child(5) .read-more { background: var(--teal); }
.post-grid li:nth-child(6) .read-more { background: var(--red); }
.post-grid li:nth-child(7) .read-more { background: var(--green); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .post-grid li:first-child {
    grid-column: auto;
  }
  .post-grid li:first-child .post-card h2 {
    font-size: 1.25rem;
  }
}