/* Natural project media: the container follows the image, never crops it. */
body .story-hero,
body .standalone-project .story-hero,
body .story-hero[data-project]{height:auto;min-height:0;max-height:none;aspect-ratio:auto;background:transparent;overflow:visible}
body .story-hero[data-project]>img,
body .story-hero>img{position:relative;inset:auto;display:block;width:100%;height:auto;max-height:none;object-fit:contain;object-position:center;transform:none!important}
body .story-hero>div{bottom:clamp(18px,4vw,50px)}
body .gallery-image-frame{display:block;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;background:transparent;overflow:visible}
body .gallery-image-frame img,
body .space-figure>img{display:block;width:100%;max-width:100%;height:auto;max-height:none;object-fit:contain;object-position:center;margin:0;transform:none}
body .listing-card .listing-photo,
body .project-card .project-image,
body .project-card:first-child .project-image,
body[data-page=projects] .project-card .project-image,
body[data-page=projects] .project-card:first-child .project-image{height:auto;min-height:0;max-height:none;aspect-ratio:auto;background:transparent;overflow:visible}
body .listing-card .listing-photo img,
body .project-card .project-image img,
body .project-card:hover .project-image img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;object-position:center;transform:none!important;transition:none}
body .project-grid{align-items:start}
body .gallery img{height:auto;object-fit:contain}
@media(max-width:700px){
 body .standalone-project .story-hero h1{font-size:clamp(28px,8vw,42px);margin-bottom:8px}
 body .story-hero .eyebrow{margin-bottom:8px}
 body .story-hero>div{left:20px;right:20px;bottom:18px}
}
/* Align listing information at the bottom; preserve each complete photograph. */
body .listing-track{align-items:stretch}
body .listing-card .listing-meta{margin-top:auto;display:grid;grid-template-rows:auto auto auto auto;align-content:end}
body .listing-card .listing-meta .eyebrow{min-height:2.8em}
body .listing-card .listing-meta h3{min-height:2.3em}
/* Compact listing photography and controls floating beside the images. */
body .listing-stage{position:relative;container-type:inline-size}
body .listing-stage .listing-track{scrollbar-width:none;padding-bottom:0}
body .listing-stage .listing-track::-webkit-scrollbar{display:none}
body .listing-card .listing-photo{aspect-ratio:1.65;overflow:hidden}
body .listing-card .listing-photo img{width:100%;height:100%;object-fit:cover;object-position:center}
body .listing-meta .text-link{justify-self:start}
body .listing-stage .listing-controls{position:absolute;inset:0;z-index:3;pointer-events:none;display:block}
body .listing-stage .listing-controls button,body .gallery-float{position:absolute;display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0;border:1px solid #d1d8ce;border-radius:50%;background:rgba(248,246,237,.94);color:#173f34;box-shadow:0 2px 10px #0002;font-size:24px;line-height:1;pointer-events:auto;cursor:pointer}
body .listing-stage .listing-controls button{top:calc((100cqw - 26px)/6.6 - 20px)}
body #listingPrev{left:10px}body #listingNext{right:10px}
body .gallery-image-frame{position:relative}
body .gallery-image-frame.gallery-trimmed{overflow:hidden}
body .gallery-image-frame.gallery-trimmed img{width:100%;height:100%;object-fit:cover;object-position:center}
body .gallery-float{top:50%;transform:translateY(-50%);z-index:2}
body .gallery-prev{left:12px}body .gallery-next{right:12px}
body .gallery-float:hover,body .listing-stage .listing-controls button:hover{background:#173f34;color:#fff}
body .gallery-float:focus-visible,body .listing-stage .listing-controls button:focus-visible{outline:3px solid #b79c63;outline-offset:3px}
@media(max-width:700px){body .listing-stage .listing-controls button{top:calc(100cqw / 3.3 - 20px)}body .gallery-float,body .listing-stage .listing-controls button{width:40px;height:40px}body .gallery-prev,body #listingPrev{left:8px}body .gallery-next,body #listingNext{right:8px}}

/* Decode incoming photos before a stable-height crossfade; keep arrows mounted. */
body .gallery-image-frame{isolation:isolate}
body .gallery-image-frame img.gallery-incoming{position:absolute;inset:0;width:100%;height:100%;z-index:1}
body .gallery-float:disabled{opacity:.38;cursor:default;background:rgba(248,246,237,.94);color:#173f34}
body .gallery-image-frame[data-stable]{overflow:hidden} body .gallery-image-frame[data-stable]>img{width:100%;height:100%;object-fit:contain} body .gallery-image-frame.gallery-trimmed[data-stable]>img{object-fit:cover}
body .gallery-image-frame[data-stable]{height:auto;min-width:0;max-width:100%}
/* Portfolio cards use one image format and consistent text rows. */
body[data-page=projects] .project-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:40px 26px}
body[data-page=projects] .project-card,body[data-page=projects] .project-card:first-child{display:flex;flex-direction:column;grid-column:auto;min-width:0;height:100%}
body[data-page=projects] .project-card .project-image,body[data-page=projects] .project-card:first-child .project-image{width:100%;height:auto;aspect-ratio:1.5;overflow:hidden;flex:none}
body[data-page=projects] .project-card .project-image img{width:100%;height:100%;object-fit:cover;object-position:center}
body[data-page=projects] .project-card[data-project=nido] .project-image img{object-position:50% 72%}
body[data-page=projects] .project-card:is([data-project=villaSerena],[data-project=casaSiena],[data-project=casaSolana],[data-project=casaAurea]) .project-image img{object-fit:contain}
body[data-page=projects] .project-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:start;margin-top:18px;flex:1}
body[data-page=projects] .project-meta>div{display:grid;grid-template-rows:minmax(2.4em,auto) minmax(2.8em,auto) minmax(1.6em,auto);align-content:start}
body[data-page=projects] .project-meta h3{font-size:clamp(22px,2.35vw,30px);line-height:1.2;margin:0}
body[data-page=projects] .project-meta p{line-height:1.4;margin:0}
body[data-page=projects] .project-meta .sold-price{padding-top:8px;letter-spacing:0;text-transform:none}
body[data-page=projects] .project-meta>span{margin-top:5px;white-space:nowrap}
@media(max-width:700px){body[data-page=projects] .project-grid{grid-template-columns:minmax(0,1fr);gap:32px}body[data-page=projects] .project-meta h3{font-size:25px}body[data-page=projects] .project-meta{gap:12px}body[data-page=projects] .project-meta>div{grid-template-rows:auto auto auto;gap:8px}}
