/* A shared square measures the visible tool rather than the source canvas. */
.home-showcase-layout{--home-category-height:180px;--home-category-side:140px;--home-product-side:125px}
main.container .home-showcase-main .home-category-tile .home-category-art{position:relative;inset:auto;display:grid;place-items:center;height:var(--home-category-height);padding:0 0 30px;box-sizing:border-box;overflow:hidden}
main.container .home-showcase-main .home-category-tile .home-category-art img,
main.container .showcase-product-image img.home-balanced-image{width:var(--home-category-side);height:var(--home-category-side);max-width:none;max-height:none;padding:0;margin:0;object-fit:contain;transform-origin:center;flex:none}
main.container .showcase-product-image{overflow:hidden}
main.container .showcase-product-image img.home-balanced-image{width:var(--home-product-side);height:var(--home-product-side)}
@media(max-width:650px){.home-showcase-layout{--home-category-height:155px;--home-category-side:118px;--home-product-side:100px}}
@media(min-width:1921px){.home-showcase-layout{--home-category-height:var(--itp-wide-art);--home-category-side:calc(var(--itp-wide-art) - 40px);--home-product-side:calc(var(--itp-wide-art) - 20px)}}

/* Quick view uses the same visible-silhouette fit as catalogue and detail pages. */
.showcase-preview-content{--preview-tool-side:280px}
#home-preview-dialog .showcase-preview-art{width:min(100%,var(--preview-tool-side));aspect-ratio:1;display:grid;place-items:center;overflow:hidden;margin:0 auto;align-self:start}
#home-preview-dialog .showcase-preview-art>img.preview-balanced-image{display:block;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;object-fit:contain;transform-origin:center;mix-blend-mode:multiply}
@media(min-width:1921px){.showcase-preview-content{--preview-tool-side:360px}}
@media(min-width:3000px){.showcase-preview-content{--preview-tool-side:440px}}
@media(max-width:650px){.showcase-preview-content{--preview-tool-side:180px}}

/* Let category captions use the available tile width before wrapping. */
main.container .home-showcase-main .home-category-tile>div:not(.home-category-art){max-width:100%;box-sizing:border-box}
main.container .home-showcase-main .home-category-tile h3{max-width:none;box-sizing:border-box;white-space:normal}

/* Full-width captions for every homepage category tile. */
main.container .home-showcase-main .home-category-tile>div:not(.home-category-art){left:0;right:0;width:100%}
main.container .home-showcase-main .home-category-tile h3{width:100%;max-width:none}

/* One responsive quick-view frame for every product. */
#home-preview-dialog{width:min(820px,94vw);height:min(560px,90dvh);max-height:90dvh;max-width:94vw;box-sizing:border-box;overflow:hidden;padding:28px}
#home-preview-dialog[open]{display:grid;grid-template-rows:30px minmax(0,1fr);gap:12px}
#home-preview-dialog>[data-home-preview-close]{justify-self:end;align-self:start;margin:0;width:30px;height:30px;display:grid;place-items:center;line-height:1;padding:0}
#home-preview-dialog>[data-home-preview-body]{min-height:0;overflow:auto}
#home-preview-dialog .showcase-preview-content{height:100%;min-height:0;grid-template-columns:minmax(0,40%) minmax(0,1fr);gap:24px}
#home-preview-dialog .showcase-preview-content>div:not(.showcase-preview-art){display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
#home-preview-dialog .showcase-preview-content>div:not(.showcase-preview-art)>p{min-height:0;overflow:auto;flex:1 1 auto;margin:12px 0}
#home-preview-dialog .showcase-preview-content>div:not(.showcase-preview-art)>span,
#home-preview-dialog .showcase-preview-content h2,
#home-preview-dialog .showcase-preview-content dl,
#home-preview-dialog .showcase-preview-content .primary{flex:none}
#home-preview-dialog .showcase-preview-content h2{margin:8px 0;line-height:1.25}
#home-preview-dialog .showcase-preview-content .primary{margin-top:auto;align-self:stretch;text-align:center}
@media(min-width:1921px){#home-preview-dialog{width:min(980px,90vw);height:min(620px,90dvh);padding:28px}}
@media(min-width:3000px){#home-preview-dialog{width:min(1120px,90vw);height:min(720px,90dvh);padding:34px}}
@media(max-width:650px){
 #home-preview-dialog{width:94vw;height:90dvh;padding:16px}
 #home-preview-dialog[open]{grid-template-rows:28px minmax(0,1fr);gap:8px}
 #home-preview-dialog .showcase-preview-content{display:flex;flex-direction:column;gap:10px}
 #home-preview-dialog .showcase-preview-art{width:min(100%,180px,24dvh);flex:none}
 #home-preview-dialog .showcase-preview-content>div:not(.showcase-preview-art){flex:1 1 auto;overflow:auto}
 #home-preview-dialog .showcase-preview-content>div:not(.showcase-preview-art)>p{flex:1 1 auto;margin:8px 0}
 #home-preview-dialog .showcase-preview-content h2{font-size:19px;margin:5px 0}
 #home-preview-dialog .showcase-preview-content dl{margin:8px 0}
}
