.instashade-gallery-masonry {
  width: 100%;
  --instashade-gallery-masonry-dot: #4f4f4f;
}

.instashade-gallery-masonry__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1fr, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.instashade-gallery-masonry__swiper {
  display: none;
}

@media (min-width: 768px) {
  .instashade-gallery-masonry__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.instashade-gallery-masonry__item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  height: clamp(260px, 24vw, 420px);
  cursor: pointer;
}

.instashade-gallery-masonry__item--double {
  grid-column: span 2;
}

@media (max-width: 767px) {
  .instashade-gallery-masonry__item--double {
    grid-column: span 1;
  }
}

.instashade-gallery-masonry__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.instashade-gallery-masonry__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.instashade-gallery-masonry__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.95) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 40%;
  z-index: 2;
  transform: translateY(0);
  transition: transform 0.35s ease;
}

.instashade-gallery-masonry__item:hover .instashade-gallery-masonry__caption {
  transform: translateY(100%);
}

.instashade-gallery-masonry__heading {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.instashade-gallery-masonry__location {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .instashade-gallery-masonry__grid {
    display: none;
  }

  .instashade-gallery-masonry__swiper {
    display: block;
    width: 100%;
    overflow: visible;
    padding-right: 1.2rem;
  }

  .instashade-gallery-masonry__swiper .swiper-wrapper {
    align-items: stretch;
  }

  .instashade-gallery-masonry__swiper .swiper-slide {
    width: calc(100% - 2rem);
    height: auto;
    display: flex;
    flex-shrink: 0;
  }

  .instashade-gallery-masonry__item--mobile {
    width: 100%;
    height: clamp(220px, 56vw, 320px);
  }

  .instashade-gallery-masonry__controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding-right: 0;
  }

  .instashade-gallery-masonry__arrows {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
  }

  .instashade-gallery-masonry__swipe-text {
    font-size: 13px;
    color: #424242;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .instashade-gallery-masonry .swiper-pagination {
    position: static;
    line-height: 1;
  }

  .instashade-gallery-masonry .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    opacity: 0.35;
    background: var(--instashade-gallery-masonry-dot);
  }

  .instashade-gallery-masonry .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.16);
  }

  .instashade-gallery-masonry__arrow {
    position: static;
    width: 1.85rem;
    height: 1.85rem;
    border: 0;
    background: none;
    color: #424242;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .instashade-gallery-masonry__arrow:active {
    transform: scale(0.95);
  }

  .instashade-gallery-masonry__arrow span {
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
  }

  .instashade-gallery-masonry__caption {
    padding: 1.5rem 1rem 1rem;
  }

  .instashade-gallery-masonry__heading {
    font-size: 1rem;
  }

  .instashade-gallery-masonry__location {
    font-size: 0.85rem;
  }
}
