:root {
  --row-h: 220px;   /* target row height: bigger = fewer, larger images per row */
  --gap: 6px;
}

.post-list ul {
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* keeps the LAST row from stretching to full width */
.post-list ul::after {
  content: "";
  flex-grow: 1000000;
}

.post-list li {
  --ar: 1;
  flex: calc(var(--ar) * 100) 1 calc(var(--row-h) * var(--ar)) !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  margin: 0 !important;
}

.post-list li a.thumbnail-wrapper,
.post-list li .thumbnail-wrapper {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: var(--ar);
}

.post-list li .thumbnail {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background-size: cover;
}