/* Shared apartment preview geometry. Original-image viewers retain contain/zoom. */
body.fl-refined{--fl-photo-ratio:3/2}
body.fl-refined .recent-listing-photo,
body.fl-refined .property-card .photo-link,
body.fl-refined .listing-group .property-card .photo-card .photo-link,
body.fl-refined .nearby-card .nearby-photo .photo-link,
body.fl-refined .property-photo-grid .photo-gallery .photo-link,
body.fl-refined .listing-photo-preview .photo-lead .photo-link,
body.fl-refined .fl-preview-thumbnail{
 position:relative;display:block;width:100%;height:auto;min-height:0;
 aspect-ratio:var(--fl-photo-ratio);overflow:hidden;
}
/* Direct children only: placeholder logos, UI icons and map tiles keep their sizes. */
body.fl-refined .recent-listing-photo>img,
body.fl-refined .property-card .photo-link>img,
body.fl-refined .fl-directory-gallery [data-fl-preview-main]>img,
body.fl-refined .property-photo-grid .photo-gallery .photo-link>img,
body.fl-refined .listing-photo-preview .photo-lead .photo-link>img,
body.fl-refined .fl-preview-thumbnail>img{
 position:absolute;inset:0;display:block;width:100%;height:100%;
 max-width:100%;max-height:none;object-fit:cover;object-position:center;
}
body.fl-refined .property-photo-grid.single-photo{
 max-width:none;grid-template-columns:repeat(3,minmax(0,1fr));
}
body.fl-refined .listing-photo-preview.single-photo-lead{height:auto}
body.fl-refined .map-preview-photos img,
body.fl-refined .fl-owner-photos img,
body.fl-refined .flg-page-grid img{
 display:block;width:100%;height:auto;aspect-ratio:var(--fl-photo-ratio);
 object-fit:cover;object-position:center;
}
/* The lead is larger than the surrounding thumbnails. Gap-aware columns keep
   every tile at 3:2, including galleries with one, two, three or four photos. */
body.fl-refined .flg-mosaic{
 height:auto;aspect-ratio:auto;grid-template-columns:calc(50% - 2px) repeat(2,minmax(0,1fr));
 grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;
}
body.fl-refined .flg-mosaic .flg-tile{display:block;aspect-ratio:auto;grid-column:auto;grid-row:auto}
body.fl-refined .flg-mosaic .flg-tile:first-child{aspect-ratio:var(--fl-photo-ratio);grid-row:1/3}
body.fl-refined .flg-mosaic .flg-tile>img,
body.fl-refined .flg-mosaic .flg-tile>picture{
 position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:none;
}
body.fl-refined .flg-mosaic .flg-tile img{
 display:block;width:100%;height:100%;max-width:100%;max-height:none;
 object-fit:cover;object-position:center;
}
body.fl-refined .flg-count-1{max-width:860px;margin-inline:auto;grid-template-columns:1fr;grid-template-rows:auto}
body.fl-refined .flg-count-1 .flg-tile:first-child{grid-row:auto}
body.fl-refined .flg-count-2{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto}
body.fl-refined .flg-count-2 .flg-tile{aspect-ratio:var(--fl-photo-ratio);grid-row:auto}
body.fl-refined .flg-count-2 .flg-tile:first-child{grid-row:auto}
body.fl-refined .flg-count-3{grid-template-columns:calc((200% - 4px)/3) minmax(0,1fr)}
body.fl-refined .flg-count-4{grid-template-columns:75% minmax(0,1fr);grid-template-rows:repeat(3,minmax(0,1fr))}
body.fl-refined .flg-count-4 .flg-tile:first-child{grid-row:1/4}
body.fl-refined .flg-v-card button{position:relative;aspect-ratio:var(--fl-photo-ratio)}
body.fl-refined .flg-v-card button>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
body.fl-refined .flg-v-thumb{height:48px}
@media(max-width:900px){
 body.fl-refined .property-photo-grid.single-photo{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.fl-refined .flg-count-5{grid-template-columns:calc((200% - 4px)/3) minmax(0,1fr)}
 body.fl-refined .flg-count-5 .flg-tile:nth-child(n+4){display:none}
}
@media(max-width:600px){
 body.fl-refined .flg-mosaic{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:auto;gap:5px}
 body.fl-refined .flg-mosaic .flg-tile{aspect-ratio:var(--fl-photo-ratio);grid-column:auto;grid-row:auto}
 body.fl-refined .flg-mosaic .flg-tile:first-child{grid-column:1/-1;grid-row:auto}
 body.fl-refined .flg-count-1,body.fl-refined .flg-count-2{grid-template-columns:1fr}
 body.fl-refined .flg-count-4 .flg-tile:nth-child(4){display:none}
 body.fl-refined .flg-v-thumb{height:40px}
}
@media(max-width:560px){body.fl-refined .property-photo-grid.single-photo{grid-template-columns:1fr}}
@media(max-height:500px) and (orientation:landscape){body.fl-refined .flg-v-thumb{height:32px}}
