/* Контейнер з фото */
#posts {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* Картка фото */
.photo-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  text-align: center;
}

/* Анімація при наведенні */
.photo-card:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-card img:hover {
  transform: scale(1.1);
}

.inner {
  padding: 10px;
  text-align: center;
}

/* Модальне вікно */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

/* Контент модалки */
.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  position: relative;
  animation: zoomIn 0.3s ease forwards;
  max-width: 80%;
  max-height: 80%;
  overflow: hidden;
}

.modal-content img {
  max-width: 100%;
  border-radius: 10px;
}

.modal-content p {
  margin-top: 10px;
  text-align: center;
  color: #333;
}

.close-button {
  background: rgba(255, 255, 255, 0.2);

  border-radius: 50%;
  position: absolute;
  width: 40px;
  height: 40px;
  top: 20px;
  right: 20px;
  font-size: 30px;
  color: #333;
  cursor: pointer;
  transition: transform 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 0; /* This helps with vertical alignment */
}

.close-button:hover {
  transform: rotate(90deg);
}

/* Анімації */
@keyframes zoomIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}
