/* Gallery Styles for Chessnut */

/* Gallery Accordion/Carousel Style */
.gallery-grid {
  display: flex;
  height: 500px;
  gap: 8px;
  padding: 0 15px;
  margin-bottom: 3rem;
  overflow: hidden;
}

.gallery-item {
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  transition: flex 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover {
  flex: 2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Gallery Lightbox Modal */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.gallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.gallery-caption {
  color: white;
  text-align: center;
  padding: 15px 20px;
  font-size: 1rem;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  max-width: 100%;
}

.gallery-counter {
  position: absolute;
  top: 20px;
  right: 60px;
  color: white;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 4px;
}

.gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.gallery-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 4px;
  transition: background 0.3s ease;
  z-index: 10001;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-prev {
  left: 20px;
}

.gallery-next {
  right: 20px;
}

/* Tablet Responsive Styles */
@media (max-width: 767.98px) {
  .gallery-grid {
    height: 400px;
    gap: 6px;
    padding: 0 10px;
  }

  .gallery-counter {
    top: 15px;
    right: 15px;
    font-size: 1rem;
    padding: 8px 15px;
  }

  .gallery-prev,
  .gallery-next {
    font-size: 24px;
    padding: 12px 16px;
  }

  .gallery-close {
    width: 45px;
    height: 45px;
    font-size: 35px;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 575.98px) {
  .gallery-grid {
    height: 300px;
    gap: 4px;
    padding: 0 8px;
  }

  .gallery-item {
    border-radius: 8px;
  }

  .gallery-counter {
    top: 10px;
    right: 10px;
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .gallery-prev,
  .gallery-next {
    font-size: 20px;
    padding: 10px 12px;
    left: 10px;
  }

  .gallery-next {
    left: auto;
    right: 10px;
  }

  .gallery-close {
    width: 40px;
    height: 40px;
    font-size: 30px;
    top: 10px;
    right: 10px;
  }

  .gallery-caption {
    font-size: 0.85rem;
    padding: 10px 15px;
  }
}
