/*
 * Grid gallery - fill the viewport
 * No cropping, images contained within cells
 */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #0a0a0a;
}

.grid {
  width: 100vw;
  height: 100dvh;
  display: grid;
  gap: 2px;
  background: #0a0a0a;
}

.grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a0a;
  min-height: 0; /* prevent grid blowout */
}

/* 4 images: 2x2 */
.grid.quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: calc(50dvh - 1px) calc(50dvh - 1px);
}

/* 7 images: 4 + 3 */
.grid.seven {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: calc(50dvh - 1px) calc(50dvh - 1px);
}

.grid.seven img:nth-child(5) { grid-column: 1 / 2; }
.grid.seven img:nth-child(6) { grid-column: 2 / 3; }
.grid.seven img:nth-child(7) { grid-column: 3 / 4; }

/* 11 images: 4 + 4 + 3 */
.grid.eleven {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, calc(33.333dvh - 1.33px));
}

.grid.eleven img:nth-child(9) { grid-column: 1 / 2; }
.grid.eleven img:nth-child(10) { grid-column: 2 / 3; }
.grid.eleven img:nth-child(11) { grid-column: 3 / 4; }
