/* =========================================================
   STUDIO SALE
   ========================================================= */


/* ---------------------------------------------------------
   PAGE
   --------------------------------------------------------- */

.studio-sale-page {
  width: 100%;

  padding:
    clamp(85px, 8vw, 135px)
    var(--page-padding)
    clamp(150px, 14vw, 230px);
}


/* ---------------------------------------------------------
   GALLERY
   --------------------------------------------------------- */

.studio-sale-gallery {
  width: 100%;
  max-width: var(--content-width);

  margin: 0 auto;

  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  column-gap: clamp(24px, 2.6vw, 46px);
  row-gap: clamp(70px, 7vw, 110px);
}


/* ---------------------------------------------------------
   ARTWORK
   --------------------------------------------------------- */

.studio-sale-item {
  position: relative;

  min-width: 0;

  color: inherit;
  text-decoration: none;

  transform: scale(1);
  transform-origin: center center;

  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}


/*
  Hovered artwork enlarges without pushing
  the rest of the grid around.
*/

.studio-sale-item:hover,
.studio-sale-item:focus-visible {
  z-index: 10;

  transform: scale(1.045);
}


/* ---------------------------------------------------------
   IMAGE
   --------------------------------------------------------- */

.studio-sale-item__image {
  width: 100%;
  height: clamp(280px, 30vw, 470px);

  display: flex;
  align-items: flex-end;
  justify-content: flex-start;

  overflow: hidden;

  background: #f7f7f7;
}


.studio-sale-item__image img {
  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: left bottom;

  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}


/*
  Slight extra image enlargement inside
  the enlarged artwork.
*/

.studio-sale-item:hover
.studio-sale-item__image img,
.studio-sale-item:focus-visible
.studio-sale-item__image img {
  transform: scale(1.015);
}


/* ---------------------------------------------------------
   ARTWORK INFORMATION
   --------------------------------------------------------- */

.studio-sale-item__info {
  padding-top: 14px;
}


/* Title */

.studio-sale-item__title {
  margin: 0;

  color: var(--text);

  font-size: clamp(0.78rem, 0.82vw, 0.92rem);
  font-weight: 600;

  line-height: 1.25;
  letter-spacing: -0.01em;
}


/* Medium / dimensions / year */

.studio-sale-item__meta {
  margin: 7px 0 0;

  color: var(--muted);

  font-size: clamp(0.62rem, 0.64vw, 0.72rem);
  font-weight: 400;

  line-height: 1.5;
}


/* ---------------------------------------------------------
   PRICE + STATUS
   --------------------------------------------------------- */

.studio-sale-item__sale {
  margin-top: 15px;

  display: flex;
  align-items: baseline;
  justify-content: space-between;

  gap: 16px;
}


/* Price */

.studio-sale-item__price {
  margin: 0;

  color: var(--text);

  font-size: clamp(0.72rem, 0.76vw, 0.84rem);
  font-weight: 600;

  line-height: 1.2;
}


/* Available / Sold */

.studio-sale-item__status {
  margin: 0;

  color: var(--accent);

  font-size: 0.6rem;
  font-weight: 600;

  line-height: 1;
  letter-spacing: 0.05em;

  text-transform: uppercase;
}


/* Sold stays full-colour.
   Only the status text changes. */

.studio-sale-item.is-sold
.studio-sale-item__status {
  color: var(--muted);
}


.studio-sale-item.is-sold
.studio-sale-item__image img {
  opacity: 1;
}


/* ---------------------------------------------------------
   LOADING / EMPTY STATE
   --------------------------------------------------------- */

.studio-sale-status {
  grid-column: 1 / -1;

  margin: 0;

  color: var(--muted);

  font-size: 0.78rem;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

  .studio-sale-gallery {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }


  .studio-sale-item__image {
    height: clamp(280px, 38vw, 430px);
  }

}


/* =========================================================
   SMALL TABLET
   ========================================================= */

@media (max-width: 800px) {

  .studio-sale-gallery {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    column-gap: 24px;
  }


  .studio-sale-item__image {
    height: clamp(300px, 56vw, 470px);
  }

}


/* =========================================================
   PHONE
   ========================================================= */

@media (max-width: 520px) {

  .studio-sale-page {
    padding-top: 65px;
    padding-bottom: 120px;
  }


  .studio-sale-gallery {
    grid-template-columns: 1fr;

    row-gap: 70px;
  }


  /*
    No enlargement on touch/mobile.
  */

  .studio-sale-item:hover,
  .studio-sale-item:focus-visible {
    transform: none;
  }


  .studio-sale-item:hover
  .studio-sale-item__image img,
  .studio-sale-item:focus-visible
  .studio-sale-item__image img {
    transform: none;
  }


  .studio-sale-item__image {
    height: auto;

    background: transparent;
  }


  .studio-sale-item__image img {
    width: 100%;
    height: auto;

    object-fit: contain;
  }


  .studio-sale-item__title {
    font-size: 0.9rem;
  }


  .studio-sale-item__meta {
    font-size: 0.7rem;
  }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .studio-sale-item,
  .studio-sale-item__image img {
    transition: none;
  }


  .studio-sale-item:hover,
  .studio-sale-item:focus-visible {
    transform: none;
  }


  .studio-sale-item:hover
  .studio-sale-item__image img,
  .studio-sale-item:focus-visible
  .studio-sale-item__image img {
    transform: none;
  }

}
