/* Product-photo framing is chosen per item; the original files stay intact. */
.art-product-grid .visual-product-card {
  display: flex;
  flex-direction: column;
}

.art-product-grid .visual-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.art-product-grid .product-availability {
  margin-top: auto;
}

.art-photo-media {
  --art-frame-height: 250px;
  flex: none;
  background: #edf0f4;
}

.art-photo-link {
  display: block;
  color: var(--pms-blue);
  text-decoration: none;
}

.art-photo-link:focus-visible {
  outline: 3px solid var(--pms-red);
  outline-offset: -3px;
}

.art-photo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--art-frame-height);
  overflow: hidden;
}

.art-photo-crop {
  position: relative;
  display: block;
  flex: none;
  width: min(100%, calc(var(--art-frame-height) * var(--art-photo-ratio)));
  aspect-ratio: var(--art-photo-ratio);
  overflow: hidden;
}

.art-photo-media .art-photo-crop img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  object-position: var(--art-photo-position, center);
}

/* A subject frame (the stag) hides the sign below without losing antlers/feet. */
.art-photo-crop--subject img {
  position: absolute;
  top: 0;
  left: 0;
}

.art-photo-media .art-photo-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  font-size: 0.68rem;
}

.art-photo-caption > span:last-child {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.art-viewer-open {
  overflow: hidden;
}

.art-photo-dialog {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 70px #0006;
}

.art-photo-dialog::backdrop {
  background: #071833c9;
}

.art-photo-dialog__header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
}

.art-photo-dialog__header h2 {
  margin: 0;
  font-size: 1rem;
}

.art-photo-dialog__header button {
  flex: none;
  min-height: 44px;
}

.art-photo-dialog__image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 8px;
  background: #edf0f4;
}

.art-photo-dialog__image img {
  display: block;
  width: 100%;
  height: min(76vh, 850px, calc(100vh - 180px));
  height: min(76dvh, 850px, calc(100dvh - 180px));
  object-fit: contain;
}

.art-photo-dialog__original {
  display: block;
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
}

@media (max-width: 700px) {
  .art-photo-media--portrait {
    --art-frame-height: min(520px, 65vh);
    --art-frame-height: min(520px, 65svh);
  }

  .art-photo-media--square {
    --art-frame-height: min(410px, 58vh);
    --art-frame-height: min(410px, 58svh);
  }

  .art-photo-media--landscape {
    --art-frame-height: min(300px, 45vh);
    --art-frame-height: min(300px, 45svh);
  }

  .art-photo-dialog__header h2 {
    font-size: 0.85rem;
  }

  .art-photo-dialog__image img {
    height: min(66vh, calc(100vh - 180px));
    height: min(66dvh, calc(100dvh - 180px));
  }
}
