/* Phase AB: Property Gallery Lightbox */
.hm-property-gallery__hero.hm-gallery-lightbox-link {
  display: block;
  position: relative;
  cursor: zoom-in;
  text-decoration: none;
  color: inherit;
}

.hm-property-gallery__thumbs a.hm-gallery-lightbox-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  cursor: zoom-in;
  background: #eef1ef;
}

.hm-property-gallery__thumbs a.hm-gallery-lightbox-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .18s ease, opacity .18s ease;
}

.hm-property-gallery__thumbs a.hm-gallery-lightbox-link:hover img,
.hm-property-gallery__thumbs a.hm-gallery-lightbox-link:focus-visible img {
  transform: scale(1.035);
  opacity: .92;
}

.hm-gallery-open-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}

.hm-gallery-open-badge::before {
  content: '⌕';
  font-size: 14px;
}

.hm-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  background: rgba(10, 18, 28, .92);
  color: #fff;
}

.hm-gallery-lightbox.is-open {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

html.hm-gallery-lightbox-is-open,
html.hm-gallery-lightbox-is-open body {
  overflow: hidden;
}

.hm-gallery-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,0));
}

.hm-gallery-lightbox__title {
  min-width: 0;
}

.hm-gallery-lightbox__title strong,
.hm-gallery-lightbox__title span {
  display: block;
}

.hm-gallery-lightbox__title strong {
  overflow: hidden;
  max-width: min(760px, 72vw);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-gallery-lightbox__title span {
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.hm-gallery-lightbox__close,
.hm-gallery-lightbox__nav {
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.hm-gallery-lightbox__close {
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
}

.hm-gallery-lightbox__close:hover,
.hm-gallery-lightbox__nav:hover,
.hm-gallery-lightbox__close:focus-visible,
.hm-gallery-lightbox__nav:focus-visible {
  background: rgba(255,255,255,.24);
  outline: none;
  transform: translateY(-1px);
}

.hm-gallery-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px 76px 18px;
}

.hm-gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
  user-select: none;
}

.hm-gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 36px;
  line-height: 1;
  transform: translateY(-50%);
}

.hm-gallery-lightbox__nav:hover,
.hm-gallery-lightbox__nav:focus-visible {
  transform: translateY(-50%) translateY(-1px);
}

.hm-gallery-lightbox__prev { left: 22px; }
.hm-gallery-lightbox__next { right: 22px; }

.hm-gallery-lightbox__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px 18px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 767px) {
  .hm-gallery-open-badge {
    right: 12px;
    bottom: 12px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .hm-gallery-lightbox__bar {
    padding: 12px 14px;
  }

  .hm-gallery-lightbox__title strong {
    max-width: 70vw;
    font-size: 13px;
  }

  .hm-gallery-lightbox__stage {
    padding: 6px 12px 12px;
  }

  .hm-gallery-lightbox__image {
    max-height: calc(100vh - 140px);
    border-radius: 12px;
  }

  .hm-gallery-lightbox__nav {
    top: auto;
    bottom: 18px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.18);
  }

  .hm-gallery-lightbox__prev { left: 18px; }
  .hm-gallery-lightbox__next { right: 18px; }

  .hm-gallery-lightbox__footer {
    padding-bottom: 72px;
  }
}
