/*
 * The five kinds of jewellery, each in a photograph.
 *
 * These were five cut-outs on pink beside their heading. Each is now one of
 * the studio's own frames of a design of that kind (four worn, the bracelet on
 * silk), a fifth of the page wide, under a heading of its own. commerce.js
 * writes the tiles; test/landing/category-tiles.test.ts holds both files to
 * that, and to the catalogue's worn renders staying off this page.
 */
.category-ribbon {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding-block: 44px 40px;
}

.category-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.category-intro h2 {
  font-size: clamp(30px, 2.6vw, 40px);
}

.category-intro h2 br {
  display: none;
}

.category-intro .text-link {
  margin: 0 0 6px;
  white-space: nowrap;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.category {
  min-width: 0;
}

.category-image,
.category:nth-child(n) .category-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  position: relative;
  display: block;
  border-radius: 4px;
  background: var(--champagne);
}

.category img {
  width: 100%;
  height: 100%;
  max-width: none;
  position: absolute;
  inset: 0;
  object-fit: cover;
  transform: none;
}

.category:hover img {
  transform: none;
}

.category-label {
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding-inline: 2px;
  border-bottom: 1px solid var(--champagne);
  color: var(--berry);
  font: 400 17px/1.2 Jost, sans-serif;
}

.category-label .icon {
  width: 16px;
  height: 16px;
}

.category:active {
  transform: translateY(1px);
}

@media (min-width: 768px) and (max-width: 1100px) {
  .category-grid {
    gap: 10px;
  }

  .category-label {
    min-height: 46px;
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .category-ribbon {
    gap: 16px;
    padding-block: 30px 24px;
  }

  .category-intro h2 {
    font-size: 28px;
  }

  .category-grid {
    display: flex;
    gap: 10px;
    margin-inline: -16px;
    padding-inline: 16px;
    padding-bottom: 2px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  .category-grid::-webkit-scrollbar {
    display: none;
  }

  .category {
    flex: 0 0 min(58vw, 236px);
    scroll-snap-align: start;
  }

  .category-label {
    min-height: 48px;
    font-size: 16px;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .category img {
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
  }

  .category:hover img,
  .category:focus-visible img {
    transform: scale(1.04);
  }
}
