* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f0f0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));  /* Column widths with auto-fill */
  grid-auto-rows: minmax(150px, auto);  /* Ensures that rows expand based on content */
  gap: 10px;  /* Small gap for spacing between items */
  max-width: 1200px;
  width: 100%;
}

.item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Randomize vertical offset */
  margin-top: calc(10px * (Math.random() - 0.5));  /* This ensures random positioning */
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* Ensures the images fill the boxes without distortion */
  border-radius: 8px;  /* Optional: Adds rounded corners to images for a cleaner look */
}
