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

.photo-card {
  position: relative;
  grid-column: span 4;
  min-height: 290px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #0c2734;
}

.photo-card:nth-child(7n + 1),
.photo-card:nth-child(7n + 5) {
  grid-column: span 8;
}

.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.photo-card::after {
  position: absolute;
  content: "";
  inset: 42% 0 0;
  background: linear-gradient(0deg, rgba(4, 17, 24, 0.92), transparent);
  pointer-events: none;
}

.photo-card figcaption {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 17px;
  left: 20px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

@media (max-width: 1000px) {
  .photo-card,
  .photo-card:nth-child(7n + 1),
  .photo-card:nth-child(7n + 5) {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  .photo-gallery {
    grid-template-columns: 1fr;
  }

  .photo-card,
  .photo-card:nth-child(7n + 1),
  .photo-card:nth-child(7n + 5) {
    grid-column: auto;
    min-height: 245px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-card img {
    transition: none;
  }
}
