* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #111;
  color: #eee;
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main.grid {
  display: grid;
  gap: 4px;
  padding: 4px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px)  { main.grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { main.grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { main.grid { grid-template-columns: repeat(4, 1fr); } }

.cell {
  position: relative;
  margin: 0;
  background: #000;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.cell:hover img { transform: scale(1.04); }

.cell .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
  pointer-events: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  user-select: none;
}
.lightbox.open { display: flex; }
.lightbox img,
.lightbox video {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  display: block;
}
.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #fff;
  font-size: 48px;
  padding: 16px;
  cursor: pointer;
  opacity: .7;
}
.lightbox .nav:hover { opacity: 1; }
.lightbox .prev { left: 8px; }
.lightbox .next { right: 8px; }
.lightbox .close {
  position: absolute;
  top: 8px;
  right: 16px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: .7;
}
.lightbox .close:hover { opacity: 1; }
