body {
  font-family: Arial, sans-serif;
  background-color: #f5f6fa;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

figure {
  width: calc(33.333% - 20px);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin: 0;
}

figure img {
  width: 100%;
  height: 87%;
  display: block;
}

figcaption {
  padding: 10px;
  text-align: center;
  font-weight: bold;
  background-color: white;
  color: #333;
}

@media (max-width: 768px) {
  figure {
    width: calc(50% - 20px);
  }
}

@media (max-width: 500px) {
  figure {
    width: 100%;
  }
}
