/* =========================================================
   AMJ uniform image frames
   Square 1:1 frames, no distortion, 4px purple border, rounded corners,
   slow subtle zoom on hover. Matches the catsearch.html pattern.
   ========================================================= */

:root {
  --amj-frame-border: #b8a6e8;   /* purple border */
  --amj-frame-width: 4px;
  --amj-frame-radius: 10px;
}

/* The square frame. ::after holds the 1:1 aspect ratio. */
.amj-frame {
  position: relative;
  display: block;
  overflow: hidden;                     /* clips the zoom */
  border: var(--amj-frame-width) solid var(--amj-frame-border);
  border-radius: var(--amj-frame-radius);
  background: #fff;                     /* letterbox fill for odd shapes */
  margin: 0 auto;
}

.amj-frame::after {
  content: "";
  display: block;
  padding-bottom: 100%;                 /* perfect square */
}

/* The image fills the frame, cropped from center, never stretched. */
.amj-frame > img,
.amj-frame > a > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;                    /* no distortion */
  object-position: center;
  transition: transform 1.6s cubic-bezier(.2, .6, .2, 1);
  will-change: transform;
  display: block;
}

/* Slow, subtle zoom on hover/focus */
.amj-frame:hover > img,
.amj-frame:hover > a > img,
.amj-frame:focus-within > img,
.amj-frame:focus-within > a > img {
  transform: scale(1.06);
}

/* Anchor inside a frame must fill it so the whole tile is clickable */
.amj-frame > a {
  position: absolute;
  inset: 0;
  display: block;
}

/* Card wrapper: keeps titles aligned across a row */
.amj-card {
  margin-bottom: 28px;
}

.amj-card .amj-card-title {
  margin: 10px 0 4px;
  font-size: 15px;
  line-height: 1.3;
  min-height: 2.6em;                    /* uniform row heights */
}

.amj-card .amj-card-meta {
  color: #666;
  font-size: 13px;
  margin: 0 0 8px;
}

/* Contain (not crop) variant — used for product detail main image
   where seeing the whole item matters more than a perfect square. */
.amj-frame--contain > img,
.amj-frame--contain > a > img {
  object-fit: contain;
  padding: 6px;
}

/* Gallery thumbnails on product pages */
.amj-frame--thumb {
  border-width: var(--amj-frame-width);
}

@media (prefers-reduced-motion: reduce) {
  .amj-frame > img,
  .amj-frame > a > img {
    transition: none;
  }
  .amj-frame:hover > img,
  .amj-frame:hover > a > img {
    transform: none;
  }
}

/* --- Gallery wall pages: purple border + slow zoom on masonry tiles --- */
.wall_j_item .wall_image,
.wall_j_item > a {
  display: block;
  overflow: hidden;
  border: var(--amj-frame-width) solid var(--amj-frame-border);
  border-radius: var(--amj-frame-radius);
}

.wall_j_item img,
.gallery_isotope_container .item_image {
  transition: transform 1.6s cubic-bezier(.2, .6, .2, 1);
  will-change: transform;
  display: block;
  width: 100%;
}

.wall_j_item:hover img,
.gallery_isotope_container .isotope_item:hover .item_image {
  transform: scale(1.06);
}

.gallery_isotope_container .isotope_item {
  overflow: hidden;
}

.gallery_isotope_container .isotope_item .wall_image,
.gallery_isotope_container .isotope_item > a {
  border: var(--amj-frame-width) solid var(--amj-frame-border);
  border-radius: var(--amj-frame-radius);
  overflow: hidden;
  display: block;
}

/* --- Responsive video embed (product pages) --- */
.amj-video {
  position: relative;
  padding-bottom: 56.25%;               /* 16:9 */
  height: 0;
  overflow: hidden;
  border: var(--amj-frame-width) solid var(--amj-frame-border);
  border-radius: var(--amj-frame-radius);
  background: #000;
  margin: 12px 0 20px;
}
.amj-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
