/* Main gallery container */
.s3-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto;
    max-width: 1200px;
    align-content: center;
    justify-content: center;
    align-items: center; /* Adjust as needed */
}

/* Each gallery item */
.s3-gallery-item {
  /* flex: 0 0 80%; */
  margin: auto;
  text-align: center;
}

/* Default style for desktop and larger screens */
.s3-gallery-item img {
    display: block;
    margin: 0 auto;
    object-fit: cover;
    height: 350px !important;
    width: 350px; !important /* Center-align the image within its container */
}

/* Style for smaller screens (cell phones) */
@media (max-width: 768px) {
  .s3-gallery-item img {
    width: 100%;    /* Take full width of the container */
    height: auto;   /* Maintain aspect ratio */
  }
}

/* Caption under each image */
.s3-gallery-item p {
  margin: 5px 0;
  font-size: 1rem;
}

/* Fullscreen overlay */
.s3-gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Watermark styling */
.s3-gallery-watermark {
  position: absolute;
  bottom: 10px;
  right: 42%;
  /* Optional transparency */
  opacity: 0.1;
  /* Prevent clicks from affecting the watermark element */
  pointer-events: none;
  /* Ensure it's above the image but below the close/prev/next buttons if needed */
  z-index: 1001;
  max-width: 10%; /* Adjust to desired size */
  height: auto;
}

/* Image in overlay */
.s3-gallery-overlay img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.3s ease;
}

/* Caption in overlay */
.s3-gallery-caption {
  display: none !important;
}

/* Navigation and close buttons */
.s3-gallery-button {
  position: absolute;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001; /* Ensure above the image */
}

.s3-gallery-button--prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.s3-gallery-button--next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.s3-gallery-button--close {
  top: 20px;
  right: 20px;
}

