/* --------------------- Gallery Masonry Grid --------------------- */
.kailashGallery-gallery {
  column-count: 3;
  column-gap: 15px;
  padding: 0;
}

.kailashGallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
}

.kailashGallery-item img,
.kailashGallery-item video {
  width: 100%;
  display: block;
  border-radius: 10px;
  transition: transform 0.5s;
}

.kailashGallery-item:hover img,
.kailashGallery-item:hover video {
  transform: scale(1.1);
}

.kailashGallery-item::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1em;
  opacity: 0;
  transition: opacity 0.3s;
}

.kailashGallery-item:hover::after {
  opacity: 1;
}

/* --------------------- Modal --------------------- */
.kailashGallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  padding: 20px;
  overflow: hidden;
}

.kailashGallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 80%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.kailashGallery-modal-content img,
.kailashGallery-modal-content video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  transition: transform 0.4s, opacity 0.4s;
  cursor: pointer;
}

.kailashGallery-caption {
  color: #fff;
  font-size: 1.2em;
  margin-top: 15px;
  text-align: center;
}

.kailashGallery-close,
.kailashGallery-prev,
.kailashGallery-next {
  position: absolute;
  font-size: 2.5em;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s;
  user-select: none;
}

.kailashGallery-close {
  top: 20px;
  right: 30px;
}

.kailashGallery-prev {
  left: 10px;
}

.kailashGallery-next {
  right: 10px;
}

.kailashGallery-close:hover,
.kailashGallery-prev:hover,
.kailashGallery-next:hover {
  color: #ff6347;
}

/* Align prev/next vertically with image on mobile */
@media (max-width: 768px) {
  .kailashGallery-prev,
  .kailashGallery-next {
    top: 50%; /* default */
    transform: translateY(-50%);
  }
}

@media (max-width: 480px) {
  .kailashGallery-prev,
  .kailashGallery-next {
    top: auto; /* remove fixed top */
  }
  .kailashGallery-prev {
    left: 5px;
    transform: translateY(0);
    display: flex;
    align-items: center;
  }
  .kailashGallery-next {
    right: 5px;
    transform: translateY(0);
    display: flex;
    align-items: center;
  }
}

/* --------------------- Thumbnails --------------------- */
.kailashGallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  scroll-behavior: smooth;
  overflow-x: auto;
}

.kailashGallery-thumbs img,
.kailashGallery-thumbs video {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.kailashGallery-thumbs .active {
  border-color: #ff6347;
}

/* Make thumbs smaller on mobile */
@media (max-width: 768px) {
  .kailashGallery-thumbs img,
  .kailashGallery-thumbs video {
    width: 40px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .kailashGallery-thumbs img,
  .kailashGallery-thumbs video {
    width: 35px;
    height: 25px;
  }
}

/* --------------------- Actions --------------------- */
.kailashGallery-actions {
  position: absolute;
  top: 20px;
  left: 30px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.kailashGallery-actions button {
  padding: 8px 12px;
  font-size: 0.9em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  transition: 0.3s;
}

.kailashGallery-actions button:hover {
  background: #ff6347;
  color: #fff;
}

/* Share dropdown */
.kailashGallery-share-options {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background: #fff;
  color: #000;
  padding: 5px 0;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 20;
}

.kailashGallery-share-options button {
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

/* --------------------- Responsive Masonry --------------------- */
@media (max-width: 1024px) { 
  .kailashGallery-gallery { column-count: 2; } 
}
@media (max-width: 768px) { 
  .kailashGallery-gallery { column-count: 2; } 
}
@media (max-width: 480px) { 
  .kailashGallery-gallery { column-count: 2; } /* Mobile: 2 columns instead of 1 */
}
