/* Carosello v36: finestra virtuale corta, stabile anche su Safari/iOS. */
.gallery[data-carousel-engine="v45"] {
  isolation: isolate;
  contain: layout paint;
  touch-action: pan-y;
}

.gallery[data-carousel-engine="v45"] .gallery-track.carousel-virtual-track {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  height: 100%;
  display: flex;
  animation: none !important;
  animation-delay: 0s !important;
  transition: none !important;
  transform-style: flat;
  backface-visibility: visible;
  will-change: transform;
}

.gallery[data-carousel-engine="v45"] .project-slide,
.gallery[data-carousel-engine="v45"] .project-slide img {
  transform: none !important;
  backface-visibility: visible !important;
}

.gallery[data-carousel-engine="v45"] .project-slide {
  pointer-events: none;
  contain: layout paint;
}

.gallery[data-carousel-engine="v45"] .project-slide img {
  opacity: 1;
  image-rendering: auto;
  transition: none !important;
}

.gallery[data-carousel-engine="v45"] .project-slide img.is-loaded {
  opacity: 1;
}

/* Le due tavole approvate con inquadratura completa conservano il loro fondo. */
.gallery[data-carousel-engine="v45"] .project-slide img[src*="/005.webp"] {
  object-fit: contain !important;
  object-position: center !important;
  background: #000 !important;
}

.gallery[data-carousel-engine="v45"] .project-slide img[src*="/079.webp"] {
  object-fit: contain !important;
  object-position: center !important;
  background: #fff !important;
}

.carousel-manual-control[data-carousel-control="v45"] {
  position: relative;
  z-index: 3;
}

.carousel-manual-control[data-carousel-control="v45"] .carousel-control-auto[aria-pressed="true"] {
  color: #000;
  background: #fff;
  border-color: #fff;
}

/* New plates retain their full subject inside the established square cells. */
.gallery .project-slide img[src*="/polis-v36/carousel/"]{object-fit:cover!important}
.gallery .project-slide img[src*="/polis-v36/carousel/024.webp"],
.gallery .project-slide img[src*="/polis-v36/carousel/024A.webp"]{object-fit:contain!important;object-position:center!important;background:#fff!important}
.gallery .project-slide img[src*="/polis-v36/carousel/044A.webp"]{object-fit:contain!important;object-position:center!important;background:#000!important}
.gallery .project-slide img[src*="/polis-v36/carousel/044B.webp"]{object-fit:contain!important;object-position:center!important;background:#e4e3e1!important}
.gallery .project-slide img[src*="/polis-v36/carousel/024B.webp"]{object-position:center 32%!important}
.gallery .project-slide img[src*="/polis-v36/carousel/044C.webp"]{object-position:center 40%!important}
.gallery .project-slide img[src*="/polis-v36/carousel/050A.webp"]{object-position:center 42%!important}

/* Photo 36: the approved square includes its white top/bottom margins. */
.gallery .project-slide img[src*="/polis-v37/carousel/036.webp"]{object-fit:contain!important;object-position:center!important;background:#fff!important;padding:0!important}

/* Photo 24: full project at intermediate zoom; crop only the left road edge. Source viewport x=368.38, y=0, size=1054 square; picture shifted right by 3%. */
.gallery[data-carousel-engine="v45"] .project-slide{position:relative}
.gallery[data-carousel-engine="v45"] .project-slide img[src*="/polis-v36/carousel/024.webp"]{position:absolute;left:-34.950664%;top:0;width:141.366224%!important;height:100%!important;max-width:none!important;margin:0;object-fit:contain!important;object-position:center!important}

/* New views use the existing square cells, with the facade/entrance centered. */
.gallery .project-slide img[src*="/polis-v45/carousel/078A.webp"]{object-fit:cover!important;object-position:25% center!important}
.gallery .project-slide img[src*="/polis-v45/carousel/078C.webp"]{object-fit:contain!important;object-position:center!important;background:#000!important;padding:0!important}

/* Photo 24B: retain the full height, including the entrance and ground. */
.gallery[data-carousel-engine="v45"] .project-slide img[src*="/polis-v36/carousel/024B.webp"]{object-fit:contain!important;object-position:center!important;background:#fff!important;padding:0!important}

/* Photo 78C: retain the complete left edge and gate; crop only the blank right wall.
   Viewport width 1070 of the 1425x833 source; no empty lateral margins. */
.gallery[data-carousel-engine="v45"] .project-slide img[src*="/polis-v45/carousel/078C.webp"]{position:absolute;left:0;top:11.074766%;width:133.177570%!important;height:77.850467%!important;max-width:none!important;margin:0!important;padding:0!important;object-fit:contain!important;object-position:center!important;background:#000!important}

/* Photo 78B retains the approved square source of the former 56. */
.gallery[data-carousel-engine="v45"] .project-slide img[src*="/polis-v45/carousel/078B.webp"]{object-fit:fill!important;object-position:center!important}
