.gallery-title {
    display: flex;
    flex-direction: column;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5em;
}

.gallery-container__box {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 0.5em;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(224, 0, 0, 0.07);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-container__box.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-container__box a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  transform: translateZ(0);
}

.gallery-container__box a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  transform: scale(1) translateZ(0);
}

.gallery-container__box a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-container__box a:hover img {
  transform: scale(1.025) translateZ(0);
}

.gallery-container__box a:hover::after {
  opacity: 1;
}

@media (max-width: 1200px) {
  .gallery-container { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .gallery-container { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .gallery-container { grid-template-columns: repeat(2, 1fr); }
}