.gallerycontainer {
    height: auto; 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    max-width: 100%;
}

.wrapperforgallery {
    right: 0%;
      width: 105%;
  margin-right: -5%;
  transform: none;
  transform-origin: top right;
    height: 100%; /* Matches the height of the container */
    display: flex;
    justify-content: center; /* Centers the gallerycontainer horizontally */
    align-items: center; /* Centers the gallerycontainer vertically */
}

@media (min-width: 1200px) {
  .wrapperforgallery {
    transform: scale(0.9);
     transform-origin: top right;
  }
}

/* once you hit 1200px, apply a static shrink to 0.8 */
@media (min-width: 1600px) {
  .wrapperforgallery {
    transform: scale(0.95);
  }
}
/* once you hit 1200px, apply a static shrink to 0.8 */
@media (min-width: 2100px) {
  .wrapperforgallery {
    transform: scale(0.75);
  }
}

    .containerforgallery {
         max-height: 110vh; 
        width: 100%; /* Full width */
    padding-right: 0px;
    padding-left: 10%;
    position: relative;
     overflow: hidden;
    display: flex;
    flex-direction: column;
    }

#gallery-modal .gallery-swiper {
    border-radius: 15px;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

#gallery-modal .gallery-swiper .swiper-button-next:after, #gallery-modal .gallery-swiper .swiper-button-prev:after {
    content: '' !important;
    font-family: swiper-icons;
    font-size: 1em;
    font-variant: initial;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none !important;
}

#gallery-modal .gallery-swiper .swiper-button-prev svg {
    transform: rotate(180deg);
}

#gallery-modal .gallery-swiper .swiper-pagination {
    display: none;
}

#gallery-modal .gallery-swiper .swiper-slide {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    position: relative;
    width: 100%;
}

#gallery-modal .gallery-swiper .swiper-slide img {
    border-radius: 15px;
     height: 100vh;
    width: 100vw;
    object-fit: contain;
}

.gallerycontainer {
    height: auto; 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    max-width: 100%;
}

.gallery-large {
    display: grid;
    /* aspect-ratio: 1; */
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 100%;
    cursor: pointer;
}

.gallery-item:hover {
    box-shadow: 0px 0px 0px #B7DB57;
    transform: translate(2px,2px);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.gallery-large img {
    border-radius: 22px;
   height: 85%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.gallery-small {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);  /* Three columns initially */
    grid-template-rows: repeat(3, 1fr);     /* Exactly 3 rows defined */
    grid-auto-flow: row dense;              /* Continue filling horizontally after defined rows */
    cursor: pointer;
}

.gallery-small-item img {
    border-radius: 16px;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    width: 100%;
}

.gallery-small-item:nth-child(n+10) {
  display: none;
}

.gallerytitle {
    cursor: pointer;
      margin-bottom: 10px;
}

.icon-arrow {
    height: .8em;
}

.modal {
    align-items: center;
    background: rgba(255,255,255,.95);
    display: none;
    height: 100%;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.modal-close-btn {
    background: none;
    border: none;
    color: black;
    cursor: pointer;
    font-size: 30px;
    position: absolute;
    right: 55px;
    top: 55px;
    z-index: 20;
}

.modal-close-btn:hover {
    color: red;
}

.modal.active {
    display: flex;
}

.overlay {
    background: none;
    bottom: 30px;
    box-sizing: border-box;
    color: white;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 15px 20px;
    position: absolute;
    text-align: center;
    width: 100%;
    z-index: 10;
}

.overlay h3 {
    color: #fff;
    margin: 0;
    margin: 2px 0 0;
}

.overlay p {
    margin: 2px 0 0;
}

.overlaytext {
    background: #509E2F;
    border-radius: 12px;
    padding: 2px 10px 2px 10px;
    width: auto;
}

@media screen and (max-width: 768px) {
    .gallery-large {
        align-items: baseline;
        aspect-ratio: 1;
        display: flex;
        grid-column: 1;
        grid-row: 1 / span 3;
        justify-content: flex-end;
        width: 100%;
    }

    .gallery-large img {
        border-radius: 12px;
    }

    .gallery-small {
        display: grid;
        gap: 5px;
        grid-auto-rows: 1fr;
        grid-column: 2;
        grid-template-columns: repeat(3,1fr);
    }

    .gallery-small-item img {
        border-radius: 8px;
        height: 100%;
        object-fit: cover;
        width: 100%;
    }

}