/* techbunnies.nl — gallery wall
   Loaded after site.css, which supplies the tokens and page chrome. */

/* A <ul> so assistive tech announces how many pieces are on the wall.
   Uniform square cells; every piece is scaled to fit whole inside its cell,
   so nothing is ever cropped (decision 7). */
.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.wall figure {
  margin: 0;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.wall img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Pixel art must not be smoothed when it scales up. Driven by the type
   metadata each piece already carries, so there is no extra class to remember. */
.wall [data-type="pixel-art"] img {
  image-rendering: pixelated;
}

/* Two columns cannot divide nine evenly, so the oldest piece is dropped
   rather than left stranded alone on a half-empty final row. display:none
   also removes it from the accessibility tree, so the list honestly
   announces eight items at this width. */

@media (max-width: 720px) {
  .wall { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) and (min-width: 481px) {
  .wall > li:nth-child(9) { display: none; }
}

@media (max-width: 480px) {
  .wall { grid-template-columns: 1fr; }
}
