/* Recent cases: preserve every uploaded image's native proportions.
   No crop or forced frame is applied on desktop or mobile. */
@media (min-width: 761px) {
  .cases-carousel .traditional-gallery {
    grid-auto-columns: minmax(360px, 44vw);
    align-items: start;
  }

  .cases-carousel .traditional-gallery figure img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent;
  }
}

/* Enlarged image viewer: uses almost the full viewport while retaining the
   original file proportion. */
.image-modal {
  width: 99vw;
  max-width: 99vw;
  max-height: 99svh;
  position: fixed;
}

.image-modal img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - 54px);
  object-fit: contain;
}

.image-modal-close {
  right: 8px;
  top: 8px;
}

.image-modal-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(20, 20, 20, .62);
  color: #fff;
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.image-modal-nav:hover {
  background: #fff;
  color: #151515;
}

.image-modal-prev { left: 14px; }
.image-modal-next { right: 14px; }

@media (max-width: 760px) {
  .image-modal-nav {
    width: 46px;
    height: 46px;
    font-size: 27px;
  }
  .image-modal-prev { left: 7px; }
  .image-modal-next { right: 7px; }
}
