/*(232,240,246,1)*/
/*(250,252,255,1)*/
/*(200,210,220,1)*/

.gallery {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  position: relative;
  text-align: center;
  color: #fff;
  /*background-color: #ffb84d;*/
  /*background-color: rgba(200,210,220,1);*/
  margin: 150px 0 20px;
  box-shadow: 0 0 15px rgba(0,0,0,.35);
}
.gallery h1 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  padding: 0 20px;
}
.gallery .slider_track {
  display: flex;
  transition: transform 1s ease-in-out;
  width: 100%;
}
.gallery .main_image {
  min-width: 100%;
  height: 400px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0,0,0,.75);
	opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
@media (min-width: 801px) {
  .gallery {
    max-height: none;
    padding: 20px 0;
  }
  .gallery .slider_track {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    transition: none;
  }
  .gallery .main_image {
    min-width: calc(50% - 1rem);   /* 2 images per row */
    max-width: calc(50% - 1rem);
    height: auto;                  /* keep original aspect ratio */
    flex: 1 1 calc(50% - 1rem);
		
		border-radius: 5px;
  }
  /* Optional: 3 images per row on very wide screens */
  @media (min-width: 1200px) {
    .gallery .main_image {
      min-width: calc(33.333% - 1rem);
      max-width: calc(33.333% - 1rem);
      flex: 1 1 calc(33.333% - 1rem);
    }
  }
}
/*------------- makes the images in .gallery appear one by one after the section appears ------*/
.gallery.scroll_fade_in_out.visible .main_image {
  opacity: 1;
  transform: translateY(0);
}
.gallery.scroll_fade_in_out.visible .main_image:nth-child(1) { transition-delay: 0.1s; }
.gallery.scroll_fade_in_out.visible .main_image:nth-child(2) { transition-delay: 0.3s; }
.gallery.scroll_fade_in_out.visible .main_image:nth-child(3) { transition-delay: 0.5s; }
.gallery.scroll_fade_in_out.visible .main_image:nth-child(4) { transition-delay: 0.7s; }
.gallery.scroll_fade_in_out.visible .main_image:nth-child(5) { transition-delay: 0.9s; }
.gallery.scroll_fade_in_out.visible .main_image:nth-child(6) { transition-delay: 1.1s; }
/* Add more if you have more images */

@media (max-width: 800px) {
  .gallery.scroll_fade_in_out.visible .main_image:nth-child(1) { transition-delay: 0.2s; }
  .gallery.scroll_fade_in_out.visible .main_image:nth-child(2) { transition-delay: 0.4s; }
  /* etc. */
}

/*---------------- .lightbox --------------------*/
@media (min-width: 801px) {
  .gallery .lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .gallery .lightbox.active {
    display: flex;
    opacity: 1;
  }
  .gallery .lightbox-image {
		max-width: 90vw;
		max-height: 90vh;
		height: 90vh;
		width: auto;
		object-fit: contain;
		border-radius: 8px;
		box-shadow: 0 0 30px rgba(0,0,0,0.6);
	}
  .gallery .lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
  }
  .gallery .lightbox-close:hover {
    color: #ff6b6b;
  }
	.gallery .lightbox-nav {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		background: rgba(0,0,0,0.6);
		color: #fff;
		appearance: none;
		-webkit-appearance: none;
		-moz-appearance: none;
		border: none;
		border-radius: 5px;
		padding: 5px 10px;
		margin: 0;
		font-size: 1.8rem;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		user-select: none;
		z-index: 10;
		transition: background 0.3s;
	}
	.gallery .lightbox-nav:hover {
		background: rgba(0,0,0,0.9);
	}
	.gallery .lightbox-prev { left: 30px; }
	.gallery .lightbox-next { right: 30px; }
}
/* Optional: hide arrows on very small lightbox */
@media (max-width: 801px) {
	.gallery .lightbox { display: none; }
	.gallery .lightbox-nav { display: none; }
}