/* Images have their own grid row. No viewport-specific photo offsets or cropping. */
.category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  height: auto;
  min-height: 400px;
  min-width: 0;
  padding: 24px;
  align-items: start;
}
.category-card-title {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 0;
}
.category-card-title h3 { line-height: 1.15; overflow-wrap: anywhere; }
.category-art {
  --art-height: 180px;
  --photo-ratio: 1.7910447761;
  grid-column: 1;
  grid-row: 2;
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  height: var(--art-height);
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.category-organic-fertilizers .category-art,
.category-chemical-reagents .category-art,
.category-laboratory-glassware .category-art { --photo-ratio: 1.8320610687; }
.category-food-chemistry .category-art { --photo-ratio: 1; }
.category-photo {
  position: relative;
  width: min(100%, calc(var(--art-height) * var(--photo-ratio)));
  aspect-ratio: var(--photo-ratio);
  flex: 0 1 auto;
  isolation: isolate;
}
.category-photo > img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: darken;
}
.category-card-bottom {
  grid-column: 1;
  grid-row: 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: none;
  margin: 0;
}
.category-card-bottom ul { max-height: none; overflow: visible; }
.category-card-bottom > .text-link { margin-top: auto; }
.category-card.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr auto;
}
.category-card.wide .category-art { --art-height: 250px; grid-column: 2; grid-row: 1; }
.category-card.wide .category-card-bottom { grid-column: 1 / -1; grid-row: 2; }

/* Frame only the empty margins of the original photographs; keep every product whole. */
.category-photo { display: block; background: var(--light); }
.category-photo .category-source { mix-blend-mode: darken; }
.category-photo .label-cover { fill: #234493; }
.category-photo .label-tint { fill: #009966; mix-blend-mode: hue; }
.category-photo .brand-label { mix-blend-mode: multiply; }
.category-precursors .category-art { --photo-ratio: .8955223881; }
.category-organic-fertilizers .category-art { --photo-ratio: .8620689655; }
.category-chemical-reagents .category-art,
.category-laboratory-glassware .category-art { --photo-ratio: .7633587786; }
.category-standard-titers .category-art { --photo-ratio: .8955223881; }
.category-art.custom-art { --photo-ratio: 1; }

@media (max-width: 1100px) {
  .category-card.wide { grid-column: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .category-card.wide .category-art { --art-height: 180px; grid-column: 1; grid-row: 2; }
  .category-card.wide .category-card-bottom { grid-column: 1; grid-row: 3; }
}
@media (max-width: 600px) {
  .category-card { min-height: 0; padding: 22px; gap: 12px; }
  .category-art, .category-card.wide .category-art { --art-height: 180px; }
  .category-card-title h3 { max-width: none; }
}
@media (max-width: 359px) {
  .category-card { padding: 18px; }
}
