.photos-content,
.meme-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  align-items: start;
  gap: clamp(14px, 2vw, 22px);
}

.photos-content.alternating-masonry,
.meme-content.alternating-masonry {
  position: relative;
  display: block;
}

.alternating-masonry > .photo-item,
.alternating-masonry > .meme-item {
  position: absolute;
}

.photo-item,
.meme-item {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-medium);
  background: var(--surface-muted);
  box-shadow: 0 6px 18px rgba(20, 43, 104, 0.07);
}

.photo-item img,
.meme-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.photo-info,
.meme-info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #fff;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.photo-title,
.meme-title {
  margin-right: 0;
  padding: 6px 11px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  background: rgba(15, 18, 27, 0.48);
  border-radius: 999px;
}

.photo-info .date,
.meme-info .date {
  display: none;
}

.photo-item:hover .photo-info,
.meme-item:hover .meme-info,
.photo-item:focus-within .photo-info,
.meme-item:focus-within .meme-info {
  opacity: 1;
}

.photo-item:hover img,
.meme-item:hover img {
  transform: scale(1.02);
  filter: saturate(1.05);
}

@media (hover: none) {
  .photo-info,
  .meme-info {
    opacity: 1;
  }
}

@media (max-width: 800px) {
  .photos-content,
  .meme-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-item,
  .meme-item {
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .photo-info,
  .meme-info {
    position: static;
    justify-content: flex-start;
    padding: 8px 2px 2px;
    color: var(--brand-primary);
    opacity: 1;
  }

  .photo-title,
  .meme-title {
    padding: 0;
    color: var(--brand-primary);
    background: transparent;
    border-radius: 0;
  }
}
