body.modal-open {
  overflow: hidden;
}
.post-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 670px;
  margin: 2rem auto 1rem;
  overflow: hidden;
  cursor: zoom-in;
  text-align: center;
}
.post-image-wrapper img {
  width: 100%;
  height: auto;
  object-fit: fill;
  transition: transform 0.3s ease;
}
.post-image-wrapper:hover img {
  transform: scale(1.05);
}
.modal-img {
  width: 100%;
  height: auto;
}

/* Related Posts Section */
.related-posts {
  margin-top: 3rem;
}
.posts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.post-item {
  flex: 1 1 calc(33.333% - 1rem);
  max-width: calc(33.333% - 1rem);
  overflow: hidden;
  border-radius: 6px;
  transition: transform 0.3s ease;
}
.post-item img {
  width: 100%;
  height: auto;
  object-fit: fill;
  border: 1px solid #eee;
}
.post-item img:hover {
  transform: scale(1.05);
}
.related-posts .post-title {
  display: none;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}
.modal-content {
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  max-width: 90%;
  max-height: 90vh;
}

.modal-img {
  max-width: 100%;
  max-height: 85vh; /* allow some breathing room */
  width: auto;
  height: auto;
  object-fit: contain;
}
.modal .close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 99999;
}
.post-title {
  font-weight: 400; /* Normal */
  font-size: 1.25rem; /* Optional: slightly smaller than <h2> */
  color: #333; /* Optional: softer black */
  text-align: center;
  margin-top: 1rem;
}
/* Responsive Tweaks */
@media (max-width: 768px) {
  .post-image-wrapper {
    margin: 1rem auto 0.5rem;
    padding: 0 1rem;
  }
  .post-image-wrapper img {
    object-fit: contain;
    max-height: 400px;
  }
  .posts-grid {
    flex-direction: column;
  }
  .post-item {
    max-width: 100%;
  }
  .modal-content {
    max-width: 95%;
    max-height: 80vh;
  }
  .modal .close {
    font-size: 28px;
    top: 10px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  .post-image-wrapper img {
    max-height: 300px;
  }
  .modal .close {
    font-size: 24px;
  }
  .related-posts {
    margin-top: 2rem;
    padding: 0 1rem;
  }
}

@media (max-height: 500px) {
  .modal-content {
    max-height: 70vh;
  }
}

.zoom-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 6px 8px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  transition: background-color 0.3s ease;
}

.zoom-icon i {
  font-size: 18px;
  color: #000;
}

.zoom-icon:hover {
  background-color: rgba(255, 255, 255, 1);
}
