/* Airbnb-style property photo grid */
.airbnb-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  height: min(56vh, 520px);
  min-height: 300px;
  max-height: 560px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.airbnb-gallery__tile {
  position: relative;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

.airbnb-gallery__tile--hero {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
  position: relative;
}

.airbnb-gallery__tile a {
  display: block;
  width: 100%;
  height: 100%;
}

.airbnb-gallery__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.airbnb-gallery__tile:hover img {
  transform: scale(1.03);
  filter: brightness(0.92);
}

.airbnb-gallery__tile--last {
  position: relative;
}

.airbnb-gallery__show-all {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #222;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.airbnb-gallery__show-all:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.airbnb-gallery__show-all-icon {
  display: inline-flex;
  font-size: 13px;
}

.property-gallery-popup-sources {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Fewer than 5 photos */
.airbnb-gallery--1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  height: min(50vh, 420px);
}

.airbnb-gallery--1 .airbnb-gallery__tile--hero {
  grid-column: 1;
  grid-row: 1;
}

.airbnb-gallery--2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  height: min(42vh, 380px);
}

.airbnb-gallery--2 .airbnb-gallery__tile--hero {
  grid-column: 1;
  grid-row: 1;
}

.airbnb-gallery--3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.airbnb-gallery--3 .airbnb-gallery__tile--hero {
  grid-row: 1 / span 2;
}

.airbnb-gallery--4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.airbnb-gallery--4 .airbnb-gallery__tile--hero {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.property .property_head_line {
  margin-bottom: 16px;
}

.airbnb-gallery__show-all--mobile {
  display: none;
}

@media only screen and (max-width: 767px) {
  .airbnb-gallery {
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
  }

  .airbnb-gallery__tile:not(.airbnb-gallery__tile--hero) {
    display: none !important;
  }

  .airbnb-gallery__tile--hero {
    display: block;
    width: 100%;
    min-height: 240px;
    height: 52vw;
    max-height: 420px;
  }

  .airbnb-gallery__tile--hero img {
    min-height: 240px;
    height: 100%;
  }

  .airbnb-gallery__show-all--desktop {
    display: none !important;
  }

  .airbnb-gallery__show-all--mobile {
    display: inline-flex;
    right: 12px;
    bottom: 12px;
    padding: 8px 14px;
    font-size: 13px;
  }
}
