/* Shared by the homepage and the OS's listing-preview pane. */
.preview-image-stage{width:100%;display:grid;place-items:center;--preview-max-height:min(48vh,520px);--preview-available-height:max(120px,calc(100dvh - var(--detail-start,240px) - 100px))}
.preview-image-frame{width:calc(min(100%,760px)*var(--preview-scale,1));max-width:100%;min-width:0;overflow:hidden}
.preview-image-frame:not([data-ratio="auto"]){width:min(100%,calc(var(--preview-available-height)*var(--preview-aspect)),calc(min(100%,760px,calc(var(--preview-max-height)*var(--preview-aspect)))*var(--preview-scale,1)));aspect-ratio:var(--preview-aspect)}
.preview-image-stage .preview-image-frame img{display:block;width:100%;height:100%;max-width:100%;max-height:none;object-fit:var(--preview-fit,contain);object-position:var(--preview-x,50%) var(--preview-y,50%);margin:0;aspect-ratio:auto;background:transparent}
.preview-image-stage .preview-image-frame[data-ratio="auto"] img{height:auto;max-height:min(var(--preview-available-height),calc(var(--preview-max-height)*var(--preview-scale,1)));object-fit:contain}
.preview-image-grid{margin-bottom:8px;--preview-max-height:380px;--preview-available-height:760px}
/* Grid fills by default and honours its own fit, ratio, zoom and position. */
.preview-image-stage.preview-image-grid .preview-image-frame{width:100%;max-width:100%}
.preview-image-grid .preview-image-frame img{object-fit:var(--preview-fit,cover);object-position:var(--preview-grid-x,50%) var(--preview-grid-y,50%);transform:scale(var(--preview-grid-scale,1));transform-origin:var(--preview-grid-x,50%) var(--preview-grid-y,50%)}
.preview-image-grid .preview-image-frame[data-ratio="auto"] img{height:auto;max-height:none;object-fit:var(--preview-fit,cover)}
.listing-preview{margin:0;min-height:100dvh;display:grid;align-items:center}
.listing-preview #preview-content{padding:24px;width:100%}
.listing-preview .preview-image-stage{--preview-max-height:min(48vh,520px);--preview-available-height:calc(100dvh - 100px)}
.listing-preview .hover-caption{margin:18px auto 0;max-width:760px;text-align:center;justify-content:center}
