/* Gallery CSS */
.grid_gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--a-gap-text-small);
  height: 500px; /* Adjust this height as necessary */
}
.img0 {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  overflow: hidden;
}
.img1, .img2 {
  grid-column: 2 / 3;
  overflow: hidden;
}
.img1 img, .img2 img, .img0 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.img2 {
  position: relative;
}
/*
@media only screen and (max-width: 700px) {
  .button {
    width: 100%;
  }
}
*/
@media only screen and (max-width: 900px) { 
  .grid_gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--a-gap-text-small);
    height: auto;
  }
  .img0 {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
    overflow: hidden;
  }
  .img1 {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    overflow: hidden;
  }
  .img2 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    overflow: hidden;
  }
  .img0 img, .img1 img, .img2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.see-all-photos {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
  max-width: max-content;
  margin-left: 10px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999; /* Ensure the modal is on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 100%;
  max-width: 1200px;
  background-color: #fff;
}

@media only screen and (max-width: 700px) {
  .modal-content {
    padding: 20px 0px;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  padding: 10px;
  z-index: 2;
}

.image-counter {
  font-size: 18px;
  color: #333;
}

.close, .close-image-viewer {
  color: #000;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.close-image-viewer {
  color: white;
  position: absolute;
  top: 10px;
  right: 20px;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.modal-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
}

.image-viewer {
  display: none;
  position: fixed;
  z-index: 9999; /* Ensure the image viewer is on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.image-viewer img {
  max-width: 90%;
  max-height: 80%;
  margin: auto; /* Center the image */
  transition: transform 0.5s ease; /* Smooth transition for image change */
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 50px;
  color: white;
  cursor: pointer;
  user-select: none;
}

.left-arrow {
  left: 10px;
}

.right-arrow {
  right: 10px;
}

.darken {
  animation: darkenAnimation 0.8s forwards;
}

@keyframes darkenAnimation {
  0% {
    filter: brightness(100%);
  }
  50% {
    filter: brightness(50%);
  }
  100% {
    filter: brightness(100%);
  }
}
