/* Borgo Punta Villa — 6.9.0. Stable, justified apartment photo rows.
 * Removes the automatic CSS multicolumn rebalance during image downloads.
 * Rows follow Eagle Booking slider order; image dimensions are reserved
 * server-side so loading an image never changes its neighbors' positions.
 */
.gallery-grid.apartment-gallery-grid.bpv-gallery-ordered {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 14px !important;
  columns: auto !important;
  column-count: auto !important;
  column-gap: normal !important;
  column-fill: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row {
  display: flex;
  flex-flow: row nowrap;
  gap: 14px;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
}
body.bpv-editorial-interior .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item,
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item,
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item.main,
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item:not(.main) {
  /* Each image receives a share of the row proportional to its real aspect ratio.
     Every image in the same row therefore has the same natural height. */
  flex: var(--bpv-photo-ratio, 1.333333) 1 0% !important;
  width: 0;
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  aspect-ratio: var(--bpv-photo-ratio, 1.333333);
  display: block;
  position: relative;
  padding: 0;
  break-inside: auto;
  overflow: hidden;
  border-radius: 12px;
  background: #e9f1f7;
  line-height: 0;
}
body.bpv-editorial-interior .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row .gallery-item img,
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row .gallery-item img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center;
}
/* A gallery with just one image should not produce a 1200-pixel-tall column. */
.apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row--one { max-width: 850px; margin-inline: auto; }
@media (max-width: 900px) {
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row {gap: 10px;}
  .gallery-grid.apartment-gallery-grid.bpv-gallery-ordered {gap: 10px !important;}
}
@media (max-width: 700px) {
  /* One image per line, in the original order, with a reserved natural height. */
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row {flex-direction: column; gap: 10px;}
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item,
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item.main,
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row > .gallery-item:not(.main) {
    flex: none !important;
    width: 100%;
    margin: 0 !important;
    aspect-ratio: var(--bpv-photo-ratio, 1.333333);
    border-radius: 10px;
  }
  .apartment-gallery-grid.bpv-gallery-ordered .bpv-gallery-row--one {max-width: 100%;}
}
@media (prefers-reduced-motion: reduce) {
  .apartment-gallery-grid.bpv-gallery-ordered .gallery-item img {transition: none !important;}
}
