.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 0px;
  font-size: 14px;
}

.gallery-item {
  overflow: hidden;
  position: relative;
  padding: 0rem;
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  grid-template-rows: 1fr 0.65fr; 
  overflow: hidden;  
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  background-color: #ffffff;
  overflow: hidden;
  border: rgb(224, 224, 224) 1px solid;
  box-shadow: 0 2px 8px #0000001a;
  border-radius: 16px;
  /* border-bottom: rgba(233, 233, 233, 1) 1px solid; */
}
.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.3s ease;
  object-fit: cover;
}
.post-gallery a.category-post {
  position: absolute;
  top: 10px;
  left: 10px;
}

.post-gallery a.category-post {
  position: absolute;
  top: 10px;
  left: 10px;
}



.gallery-body {
  padding: 1rem;
}
.gallery-item h2 {
  color: #000;
  margin: 10px 0 10px;
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 7px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0px;
  word-wrap: break-word;
  word-break: keep-all;
}

.gallery-item h2 i:before {
  margin-left: 5px;
  font-size: 12px;
}
.gallery-item h2 a:hover {
  color: #f44336;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item .post-detail {
  margin-top: 10px;
  font-size: 14px;
}
.gallery-item .post-detail li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 3px;
}
.gallery-item .post-detail li label {
  position: absolute;
  left: 0px;
}
@media (max-width: 1600px){
    .gallery {
        grid-template-columns: repeat(3, 1fr);
      }
}
@media (max-width: 1199.98px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item {
    grid-template-rows: 1fr 0.45fr;
  }
}
@media (max-width: 991.98px) {
  .gallery {
    grid-template-columns: repeat(1, 1fr);
  }

  .gallery-item {
    grid-template-rows: 1fr 0.4fr;
  }
  .gallery-item img {
    object-fit: cover;
  }
}

@media (max-width: 767.98px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item {
    grid-template-rows: 1fr 0.36fr;
  }
  .gallery-item img {
    object-fit: cover;
  }
}

@media (max-width: 575.98px) {
  .gallery {
    grid-template-columns: repeat(1, 1fr);
  }
}
