/* ==========================================================================
   products-editorial — asymmetric bestsellers grid, like a photo shoot:
   cards of different sizes (data-size="l|m|s") on a 12-column grid, with
   offsets. Built from the product-card molecule; each image keeps its own
   ratio (--card-ratio), so mixed source ratios never break the layout.
   Mobile: 2 columns. Tablet: 2 columns, large cards span both.
   ========================================================================== */
.products-editorial {
  padding-block: var(--space-xl) var(--space-2xl);
}

.products-editorial__header {
  display: grid;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
}

.products-editorial__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
}

.products-editorial__page {
  font-variant-numeric: tabular-nums;
  text-transform: none; /* keep the lowercase "p." */
}

.products-editorial__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl) var(--grid-gutter);
  align-items: start;
}

.products-editorial__item {
  min-width: 0;
}

.products-editorial__item[data-size='l'],
.products-editorial__item[data-size='m'] {
  grid-column: 1 / -1;
}

.products-editorial__item .product-card__media {
  --image-ratio: var(--card-ratio, 4 / 5);
}

.products-editorial__item[data-size='l'] .product-card__title {
  font-size: var(--text-xl);
}

.products-editorial__item[data-size='l'] .product-card__media {
  border-radius: var(--radius-lg);
}

/* "See all" tile: a lime block that closes the grid */
.products-editorial__more {
  display: grid;
  align-content: space-between;
  gap: var(--space-lg);
  min-height: 14rem;
  padding: var(--space-md);
  background-color: var(--palette-lime);
  color: var(--palette-ink);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.products-editorial__more:hover {
  background-color: var(--palette-green);
}

.products-editorial__more:focus-visible {
  outline: 2px solid var(--palette-blue);
  outline-offset: 3px;
}

.products-editorial__more-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

.products-editorial__more-icon {
  justify-self: end;
}

/* Tablet: two columns, large cards span both */
@media (min-width: 48em) {
  .products-editorial__item[data-size='m'] {
    grid-column: auto;
  }
}

/* Desktop: 12-column composition with offsets */
@media (min-width: 64em) {
  .products-editorial__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    row-gap: var(--space-2xl);
  }

  .products-editorial__item:nth-child(1) {
    grid-column: 1 / span 6;
  }

  .products-editorial__item:nth-child(2) {
    grid-column: 8 / span 5;
    margin-top: var(--space-3xl);
  }

  .products-editorial__item:nth-child(3) {
    grid-column: 1 / span 4;
  }

  .products-editorial__item:nth-child(4) {
    grid-column: 5 / span 8;
  }

  .products-editorial__item:nth-child(5) {
    grid-column: 2 / span 4;
  }

  .products-editorial__item:nth-child(6) {
    grid-column: 7 / span 6;
    margin-top: var(--space-xl);
  }

  .products-editorial__item:nth-child(7) {
    grid-column: 1 / span 4;
  }

  .products-editorial__item:nth-child(8) {
    grid-column: 5 / span 4;
    margin-top: var(--space-xl);
  }

  .products-editorial__item:nth-child(9) {
    grid-column: 10 / span 3;
  }
}
