/* Opt-in layout for uniform card collections. Keep each page's gap and card styles. */
.balanced-cards.balanced-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.balanced-cards > * {
  min-width: 0;
  grid-column: span 2;
}
/* The final row shares the full width, including server-filtered collections. */
.balanced-cards > :nth-child(3n + 1):last-child { grid-column: 1 / -1; }
.balanced-cards > :nth-child(3n + 1):nth-last-child(2),
.balanced-cards > :nth-child(3n + 2):last-child { grid-column: span 3; }
/* Four cards are more readable as two complete rows. */
.balanced-cards:has(> :nth-child(4):last-child) > * { grid-column: span 3; }
@media (max-width: 1000px) {
  .balanced-cards.balanced-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balanced-cards.balanced-cards > :nth-child(n) { grid-column: auto; }
  .balanced-cards.balanced-cards > :nth-child(odd):last-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .balanced-cards.balanced-cards { grid-template-columns: minmax(0, 1fr); }
  .balanced-cards.balanced-cards > :nth-child(n) { grid-column: 1 / -1; }
}
