/* RAM accessories: supplier product photos (Brandon, 24 Nov 2026: Turn 14 / brand product photos may be used).
   Loaded on /accessories/ pages only, after the theme's site.css (same tokens: square corners, hairlines, mono labels).
   Product photos sit whole on white, never cropped and never enlarged (object-fit: scale-down: a photo smaller than its
   frame keeps its real size, centred, instead of being blown up and blurred); every frame has a fixed ratio, so nothing
   shifts while a photo loads. */

/* Catalogue cards: the small (600 px) photo in the card's 4:3 frame. Without a photo, the category placeholder stays. */
.ust-part-card__media--photo { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.ust-stock-card__media.ust-part-card__media--photo .ust-part-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: scale-down; padding: var(--space-4); box-sizing: border-box;
}

/* Part page: the main photo, then up to four more; each opens the site's photo viewer (assets/gallery.js). No credit
   or caption (Brandon, 26 Nov 2026). */
.ust-part__media { margin: 0 0 var(--space-6); }
.ust-part__photo { margin: 0; }
.ust-part__media .ust-gallery__link { display: block; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.ust-part__media .ust-gallery__link:focus-visible { box-shadow: var(--focus); }
.ust-part__media .ust-gallery__link img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
  object-fit: scale-down; padding: var(--space-3); box-sizing: border-box;
}
.ust-part__photo .ust-gallery__link img { padding: clamp(var(--space-4), 3vw, var(--space-6)); }
.ust-part__thumbs {
  list-style: none; padding: 0; margin: var(--space-3) 0 0 !important;
  display: grid; gap: var(--space-2); grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ust-part__thumbs > li { margin: 0 !important; min-width: 0; }
.ust-part__thumbs .ust-gallery__link:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Part page without a photo: a slim version of the card placeholder (no broken image, no empty frame). The full
   column width, its height capped (without width: 100%, the cap would narrow it through the aspect ratio). */
.ust-part__nophoto {
  display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 1; max-height: 14rem;
  margin: 0 0 var(--space-6); background: var(--graphite);
}

@media (prefers-reduced-motion: reduce) {
  .ust-stock-card__link:hover .ust-stock-card__media.ust-part-card__media--photo img { transform: none; }
}
