/* Homepage previews only: keep the shared card visuals and stored item counts.
   Two-column odd counts start with a full-width first card, then normal pairs.
   The data-count specificity wins over shared and later inline overview rules. */
.homepage-overview .collection-grid.collection-grid--grid[data-count]{
  display:grid;
  grid-template-columns:minmax(0,1fr);
}

@media (min-width:601px){
  .homepage-overview .collection-grid.collection-grid--grid[data-count]{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count] > .collection-card:first-child:nth-last-child(odd){
    grid-column:1 / -1;
  }
}

@media (min-width:1001px){
  .homepage-overview .collection-grid.collection-grid--grid[data-count]{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count] > .collection-card:first-child:nth-last-child(odd){
    grid-column:auto;
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="1"]{
    grid-template-columns:minmax(0,1fr);
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="2"],
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="4"]{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  /* Preserve the desktop three-plus-two arrangement. The explicit first-child
     selector restores its two-track span after the higher-specificity reset. */
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="5"]{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="5"] > .collection-card,
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="5"] > .collection-card:first-child{
    grid-column:span 2;
  }
  .homepage-overview .collection-grid.collection-grid--grid[data-count][data-count="5"] > .collection-card:nth-last-child(-n+2){
    grid-column:span 3;
  }
}
