/* Phase 05X39 (2026-11-23): mixed-ratio CMS cover and gallery contract.
 * List slots remain 16:9, gallery slots remain 3:2.
 * Landscape: width first; align to top, clip ONLY excess below frame.
 * Portrait: height first, centered horizontally at natural aspect ratio.
 * No grey letterboxing. JS marks portrait photos based on natural dimensions.
 * Preserve all Home video/TikTok and the Designer's carousel behavior. */

/* Shared list cards, excluding Homepage cards and editorial detail covers. */
.content .body.qs-cms-ratio-list .info-body > .row > [class*="col-"] > a > .image {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: 0 !important;
  aspect-ratio: 16 / 9 !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: hidden;
  padding: 0 !important;
  background: transparent !important;
}
.content .body.qs-cms-ratio-list .info-body > .row > [class*="col-"] > a > .image > img.equal-height {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: fill !important;
  object-position: center top !important;
  margin: 0 auto !important;
  background: transparent !important;
}
/* Only vertical photos use frame height; intrinsic aspect ratio is preserved. */
.content .body.qs-cms-ratio-list .info-body > .row > [class*="col-"] > a > .image > img.equal-height.qs-cms-portrait-photo {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}
/* Do not disrupt existing TikTok iframe preview or missing-cover message. */
.content .body.qs-cms-ratio-list .info-body > .row > [class*="col-"] > a > .image > .qs-cms-no-image,
.content .body.qs-cms-ratio-list .info-body > .row > [class*="col-"] > a > .image > .qs-video-card-tiktok-preview {
  width: 100%;
  height: 100%;
}

/* Gallery thumbs inside content detail. Fancybox opens unmodified original. */
.content .body .qs-cms-gallery-section .qs-cms-gallery-cell .image {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  aspect-ratio: 3 / 2 !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: hidden;
  padding: 0 !important;
  background: transparent !important;
}
.content .body .qs-cms-gallery-section .qs-cms-gallery-cell .image > img.qs-cms-gallery-photo {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: fill !important;
  object-position: center top !important;
  margin: 0 auto !important;
  background: transparent !important;
}
.content .body .qs-cms-gallery-section .qs-cms-gallery-cell .image > img.qs-cms-gallery-photo.qs-cms-portrait-photo {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}
@media print {
  .content .body .qs-cms-gallery-section .qs-cms-gallery-cell .image {
    overflow: visible;
  }
}
