/* (PART A) GALLERY CONTAINER */
.gallery {
  /* (A1) GRID LAYOUT - 3 PER ROW */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  /* (A2) OPTIONAL */
  grid-gap: 10px;
  max-width: 800px;
  padding: 10px; margin: 0 auto;
  overflow: hidden;
}

/* (PART B) IMAGES */
.gallery > img {
  width: 100%; object-fit: cover;
  aspect-ratio: 1/1;
  transition: all 0.3s;
}

/* (PART C) SMALL SCREENS - 2 PER ROW */
@media screen and (max-width:640px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* (PART D) ENLARGE ON MOUSE HOVER */
.gallery > img:hover:not(.full) {
  transform: scale(1.1);
}

/* (PART E) SHOW SELECTED IMAGE IN FULLSCREEN */
.gallery > img.full {
  position: fixed; top: 0; left: 0; z-index: 999;
  width: 100vw; height: 100vh;
  object-fit: scale-down;
  background: rgba(0, 0, 0, 0.5);
}

/* (PART X) NOT REALLY IMPORTANT */
* {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}