/* --- Base gallery styles --- */
.intuix-gallery {
  margin: 30px 0;
}

.intuix-gallery .gallery-item {
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intuix-gallery .gallery-item img {
  height: 280px;
  width: auto;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intuix-gallery .gallery-item:hover img {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* --- Lightbox overlay --- */
#intuix-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.25s ease;
}

#intuix-lightbox.active {
  display: flex;
}

#intuix-lightbox img {
  max-width: 80%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: zoomIn 0.25s ease;
}

@media (max-width: 768px) {
  #intuix-lightbox img {
    max-width: 100%;
    border-radius: 0;
  }
}

/* --- Close button --- */
#intuix-lightbox .lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 100%;
    cursor: pointer;
    background: url(../img/close.svg) center center / 12px no-repeat;
    transition: transform 0.2s ease;
    background-color: #1d1d1d;
    border: none !important;
}

#intuix-lightbox .lightbox-close:hover {
  transform: scale(1.1);
}

/* --- Lightbox arrows --- */
#intuix-lightbox .lightbox-prev,
#intuix-lightbox .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(29, 29, 29, 0.8);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#intuix-lightbox .lightbox-prev {
  left: 30px;
  background-image: url('../img/chevron-left.svg');
}
#intuix-lightbox .lightbox-next {
  right: 30px;
  background-image: url('../img/chevron-right.svg');
}

#intuix-lightbox .lightbox-prev:hover,
#intuix-lightbox .lightbox-next:hover {
  background-color: rgba(29, 29, 29, 1);
  transform: translateY(-50%) scale(1.1);
}


/* --- Animation --- */
@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- MASONRY GRID MODE --- */
.intuix-gallery.grid-mode {
  column-count: 4; /* desktop default */
  column-gap: var(--gallery-gap, 20px);
  width: 100%;
}

@media (max-width: 1024px) {
  .intuix-gallery.grid-mode {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .intuix-gallery.grid-mode {
    column-count: 2;
  }
}
@media (max-width: 480px) {
  .intuix-gallery.grid-mode {
    column-count: 1;
  }
}

.intuix-gallery.grid-mode .gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: var(--gallery-gap, 20px);
  border-radius: 12px;
  overflow: hidden;
}

.intuix-gallery.grid-mode .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  break-inside: avoid; /* key for masonry alignment */
}

.intuix-gallery.grid-mode .gallery-item:hover img {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
