/* Theo Properties RC1.0.11.20.18 — Responsive Property Media & Focal Crop Lock
   Media-only production hardening. No auth, routing, workflow, data or backend changes. */

/* --------------------------------------------------------------------------
   Focal position contract
   Any media wrapper may opt into one of these classes/data attributes, or set
   --tp-media-position directly (for example: style="--tp-media-position:40% 32%").
   -------------------------------------------------------------------------- */
body.theo-app .media-focus-center,
body.theo-app [data-media-focus="center"]{--tp-media-position:50% 50%}
body.theo-app .media-focus-top,
body.theo-app [data-media-focus="top"]{--tp-media-position:50% 22%}
body.theo-app .media-focus-bottom,
body.theo-app [data-media-focus="bottom"]{--tp-media-position:50% 78%}
body.theo-app .media-focus-left,
body.theo-app [data-media-focus="left"]{--tp-media-position:28% 50%}
body.theo-app .media-focus-right,
body.theo-app [data-media-focus="right"]{--tp-media-position:72% 50%}

/* Real <img> surfaces. */
body.theo-app #explore .hero-property-image,
body.theo-app #explore .journey-stage-media>img,
body.theo-app #explore .premium-category-media,
body.theo-app .media-crop>img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  object-fit:cover!important;
  object-position:var(--tp-media-position,50% 50%)!important;
}

/* Background-image surfaces used by marketplace and owner workflows. */
body.theo-app .property-gallery .gallery-image-layer,
body.theo-app .property-existing-thumb,
body.theo-app .property-upload-existing i,
body.theo-app .review-photo,
body.theo-app .listing-life-image>span,
body.theo-app .listing-preview-gallery span{
  background-repeat:no-repeat!important;
  background-size:cover!important;
  background-position:var(--tp-media-position,50% 50%)!important;
}

/* --------------------------------------------------------------------------
   Marketplace cards — stable ratios regardless of source image orientation.
   -------------------------------------------------------------------------- */
body.theo-app #explore .marketplace-results .premium-property-card .property-photo.property-gallery{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:16/10!important;
  overflow:hidden!important;
  background-color:#e8edef!important;
  --tp-media-position:50% 50%;
}
body.theo-app #explore .marketplace-results .premium-property-card .property-photo-overlay{
  width:100%!important;
  height:auto!important;
  aspect-ratio:16/10!important;
}
body.theo-app #explore .mobile-property-image.property-gallery{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:4/3!important;
  overflow:hidden!important;
  background-color:#e8edef!important;
  --tp-media-position:50% 50%;
}

/* Property detail should favour image completeness over a severe crop. */
body.theo-app .rc107-property-detail .detail-photo.property-gallery,
body.theo-app #explore .detail-photo.property-gallery{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:16/9!important;
  overflow:hidden!important;
  background:#e7ecef!important;
}
body.theo-app .rc107-property-detail .detail-photo.property-gallery .gallery-image-layer,
body.theo-app #explore .detail-photo.property-gallery .gallery-image-layer{
  background-size:contain!important;
  background-position:var(--tp-media-position,50% 50%)!important;
  background-color:#e7ecef!important;
}

/* Owner/listing workflow thumbnails and previews. */
body.theo-app .property-existing-thumb,
body.theo-app .property-upload-existing i,
body.theo-app .listing-life-image>span{
  display:block!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:4/3!important;
  background-color:#e8edef!important;
}
body.theo-app .review-photo,
body.theo-app .owner-review-card .review-photo{
  height:auto!important;
  min-height:0!important;
  aspect-ratio:16/10!important;
  background-color:#e8edef!important;
}
body.theo-app .listing-preview-gallery span{
  background-color:#e8edef!important;
}

/* Explicit full-image utility for portrait/special imagery when needed. */
body.theo-app .media-fit-contain>img{
  object-fit:contain!important;
  background:#e7ecef!important;
}
body.theo-app .media-fit-contain .gallery-image-layer,
body.theo-app .media-fit-contain.gallery-image-layer{
  background-size:contain!important;
  background-color:#e7ecef!important;
}

/* Curated Theo media focal locks. */
body.theo-app #explore .marketplace-hero-visual{--tp-media-position:50% 47%}
body.theo-app #explore .journey-stage-media{--tp-media-position:50% 46%}
body.theo-app #explore .category-showcase-card.residential{--tp-media-position:50% 48%}
body.theo-app #explore .category-showcase-card.commercial{--tp-media-position:50% 50%}
body.theo-app #explore .category-showcase-card.industrial{--tp-media-position:50% 50%}
body.theo-app #explore .category-showcase-card.agricultural{--tp-media-position:50% 50%}

/* --------------------------------------------------------------------------
   Device locks
   -------------------------------------------------------------------------- */

/* iPad portrait / mid tablets: keep card media consistent and unclipped. */
@media (min-width:701px) and (max-width:899px){
  body.theo-app #explore .marketplace-results .premium-property-card .property-photo.property-gallery,
  body.theo-app #explore .marketplace-results .premium-property-card .property-photo-overlay{
    aspect-ratio:16/10!important;
  }
  body.theo-app .rc107-property-detail .detail-photo.property-gallery,
  body.theo-app #explore .detail-photo.property-gallery{
    aspect-ratio:16/10!important;
  }
}

/* iPad 9th gen landscape / compact tablets: reduce the tall hero crop. */
@media (min-width:900px) and (max-width:1180px) and (orientation:landscape){
  body.theo-app #explore .premium-marketplace-hero{
    min-height:500px!important;
  }
  body.theo-app #explore .marketplace-hero-visual{
    height:500px!important;
    min-height:500px!important;
    max-height:500px!important;
    --tp-media-position:50% 47%;
  }
}

/* Phones: slightly taller listing media is easier to read; detail still shows full image. */
@media (max-width:700px){
  body.theo-app #explore .marketplace-results .premium-property-card .property-photo.property-gallery,
  body.theo-app #explore .marketplace-results .premium-property-card .property-photo-overlay,
  body.theo-app #explore .mobile-property-image.property-gallery{
    aspect-ratio:4/3!important;
  }
  body.theo-app .rc107-property-detail .detail-photo.property-gallery,
  body.theo-app #explore .detail-photo.property-gallery{
    aspect-ratio:4/3!important;
  }
  body.theo-app #explore .marketplace-hero-visual{--tp-media-position:50% 46%}
  body.theo-app #explore .journey-stage-media{--tp-media-position:50% 45%}
}

/* Phone landscape: avoid excessively tall media blocks. */
@media (max-width:900px) and (orientation:landscape) and (max-height:520px){
  body.theo-app #explore .mobile-property-image.property-gallery{aspect-ratio:16/10!important}
  body.theo-app .rc107-property-detail .detail-photo.property-gallery,
  body.theo-app #explore .detail-photo.property-gallery{aspect-ratio:16/9!important}
}
