/* photos-page.css — requires style.css */

img {
  display: block;
}

.container {
  margin: var(--space-xxl) auto;
  padding: 0 var(--space-lg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 220px;
  gap: var(--space-md);
  grid-auto-flow: dense;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 3px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Every 4th image spans 2x2 */
.gallery img:nth-child(4n) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery img:hover {
  transform: scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-faint);
}

@media (max-width: 768px) {
  h1 {
    font-size: 3.8rem;
  }

  #title-text {
    font-size: 1.5rem;
    padding: 1rem var(--space-lg);
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 180px;
    gap: var(--space-sm);
  }

  .gallery img:nth-child(4n) {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 450px) {
  h1 {
    font-size: 2.8rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
}
