.cpp-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.cpp-gallery figure {
  margin: 0;
  grid-column: span 4;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.cpp-gallery figure a {
  display: block;
  line-height: 0;
}

.cpp-gallery img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.cpp-gallery figure:hover img {
  transform: scale(1.03);
}

.cpp-gallery figcaption {
  position: absolute;
  inset: auto 8px 8px 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  backdrop-filter: saturate(140%) blur(2px);
  display: none;
}

.cpp-gallery figure:hover figcaption {
  display: block;
}

@media (max-width: 1024px) {
  .cpp-gallery figure {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .cpp-gallery figure {
    grid-column: span 12;
  }
}
