/* Scoped to approved mixed-media gallery only.
   Production's map hero, icon actions, photo carousel, alerts and other panels are untouched. */
body.rpmx-listing-v2 .rpmx-listing-gallery>.rpmx-hero-gallery--mixed{
  position:relative!important;isolation:isolate;display:grid!important;
  grid-template-columns:minmax(0,1.15fr) repeat(2,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;width:100%!important;height:clamp(390px,39vw,555px)!important;
  min-height:0!important;max-height:none!important;margin:0 0 56px!important;
  padding:0!important;border-radius:22px!important;
  overflow:visible!important;background:#eeeae5!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo{
  position:relative!important;display:block!important;grid-column:auto;grid-row:auto;
  width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
  padding:0!important;margin:0!important;border:0;border-radius:12px!important;
  overflow:hidden!important;background:#ece9e4!important;cursor:zoom-in;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo.is-primary{
  display:grid!important;place-items:center;
  grid-column:1!important;grid-row:1/-1!important;
  position:relative;isolation:isolate;background:#ece9e4!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo>img:not(.rpmx-gallery-video-ambient){
  position:relative;display:block;width:100%;height:100%;object-fit:contain;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed .rpmx-gallery-video-ambient{
  position:absolute;z-index:0;inset:-35px;width:calc(100% + 70px);height:calc(100% + 70px);
  max-width:none;max-height:none;object-fit:cover;
  filter:blur(35px) brightness(.76) saturate(.85);pointer-events:none;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed .rpmx-gallery-hero-video{
  position:relative;z-index:1;display:block;width:100%;height:100%;max-height:100%;
  object-fit:contain;background:transparent;pointer-events:none;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-gallery-all{
  position:absolute!important;right:0!important;top:calc(100% + 8px)!important;
  bottom:auto!important;z-index:5!important;min-height:40px;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed.is-single{
  display:flex!important;align-items:stretch;justify-content:center;height:min(68vh,620px)!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed.is-single>.rpmx-gallery-single-ambient{
  position:absolute;inset:-40px;width:calc(100% + 80px);height:calc(100% + 80px);
  object-fit:cover;filter:blur(35px) brightness(.7);pointer-events:none;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed.is-single>.rpmx-hero-photo.is-primary{
  position:relative;z-index:2;display:grid!important;flex:0 1 auto;
  aspect-ratio:var(--rpmx-featured-ratio,9/16);width:auto!important;max-width:100%!important;
  height:100%!important;background:transparent!important;
}
body.rpmx-listing-v2 .rpmx-lightbox__frame figure video[data-rpmx-lightbox-video]{
  display:block;max-width:min(1100px,93vw);max-height:79vh;object-fit:contain;background:#0c0e10;border-radius:10px;
}
body.rpmx-listing-v2 .rpmx-lightbox__frame figure video[hidden]{display:none!important}
body.rpmx-listing-v2 .rpmx-lightbox__frame figure img[hidden]{display:none!important}
body.rpmx-listing-v2 .rpmx-hero-gallery--carousel .rpmx-hero-photo__play{
  position:absolute;right:12px;top:12px;z-index:5;border-radius:50%;padding:5px 10px;
  background:rgba(12,19,23,.75);color:white;pointer-events:none;
}
@media(max-width:640px){
 body.rpmx-listing-v2 .rpmx-listing-gallery>.rpmx-hero-gallery--mixed{
   grid-template-columns:repeat(4,minmax(0,1fr))!important;
   grid-template-rows:minmax(0,1fr) 96px!important;
   gap:6px!important;height:min(75vh,620px)!important;
   margin-bottom:54px!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo.is-primary{
   grid-column:1/-1!important;grid-row:1!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo:not(.is-primary){
   grid-row:2!important;height:96px!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed.is-single{
   display:flex!important;height:min(72vh,620px)!important;
 }
}
/* Vertical-first layout for approved inline video; preserves production listing shell.
   The primary track has the video's actual aspect ratio, so object-fit:contain
   does not create horizontal letterbox bars. */
body.rpmx-listing-v2 .rpmx-listing-gallery>.rpmx-hero-gallery--mixed:not(.is-single){
  --rpmx-gallery-frame-h:clamp(440px,43vw,620px);
  grid-template-columns:minmax(0,calc(var(--rpmx-gallery-frame-h) * var(--rpmx-featured-ratio-decimal,0.5625))) repeat(2,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  height:var(--rpmx-gallery-frame-h)!important;
  align-items:stretch!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo.is-primary{
  aspect-ratio:var(--rpmx-featured-ratio,9/16)!important;
  background:#eeeae6!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed .rpmx-gallery-hero-video{
  width:100%!important;height:100%!important;
  object-fit:contain!important;background:transparent!important;
}
body.rpmx-listing-v2 .rpmx-hero-gallery--mixed .rpmx-gallery-video-ambient{
  display:none!important;
}
@media(max-width:640px){
 body.rpmx-listing-v2 .rpmx-listing-gallery>.rpmx-hero-gallery--mixed:not(.is-single){
  --rpmx-gallery-frame-h:min(112vw,620px);
  display:grid!important;
  grid-template-columns:minmax(0,calc(var(--rpmx-gallery-frame-h) * var(--rpmx-featured-ratio-decimal,0.5625))) minmax(0,1fr)!important;
  grid-template-rows:repeat(4,minmax(0,1fr))!important;
  height:var(--rpmx-gallery-frame-h)!important;
  gap:6px!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo.is-primary{
  grid-column:1!important;grid-row:1/-1!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed>.rpmx-hero-photo:not(.is-primary){
  grid-column:2!important;grid-row:auto!important;
  height:100%!important;min-height:0!important;
 }
 body.rpmx-listing-v2 .rpmx-hero-gallery--mixed.is-single{
  height:min(76vh,640px)!important;
 }
}
