body {
    margin: 0;
    padding: 0;
  }
ul.buttons {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

ul.buttons li {
  padding: 8px 16px;
  background-color: #d7d7e299;
  cursor: pointer;
  transition: background-color 0.2s;
  user-select: none;
  color: #4a4747;
  font-size: 14px;
}

ul.buttons li:hover {
  background-color: #dd0000;
  color: #fff;
}

ul.buttons li.active {
  background-color: #dd0000;
  color: #fff;
}

 #gallery {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.grid-sizer, .grid-item {
  width: 46%;
  float: left;
  margin-left:2%;
}

@media (min-width: 768px) {
  .grid-sizer, .grid-item {
    width: 23.333%;
    margin-left:0;
  }
}

.grid-item {
  margin-bottom: 8px;
}


#viewer {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8); display: none;
  justify-content: center; align-items: center; z-index: 9999;
}
#viewer img { max-width: 90%; max-height: 90%; }

#viewer button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-right:20%;
  margin-left:20%;
  z-index: 10000; 
  
}
#prevBtn { left: 10px; }
#nextBtn { right: 10px; }



#closeBtn {
  position: absolute;
  top: 20% !important;
  right: 5%;
  font-size: 1.8rem;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10000;
}

#closeBtn:hover {
  color: #ccc;
}

#viewerImg {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
}
#viewerImg.fade {
  opacity: 0;
}
.gallery-content{margin:0 auto; width:100%;}

.grid-item img.thumb {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item img.thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}



@media (max-width:767px){
    
#closeBtn {
 top: 100px !important;
  right: 30px;}
  
  .gallery-content{margin:0 auto; width:100%;}
  #viewer button {margin-right:0%;
  margin-left:0%;}
    
}
