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

body {
  background-color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* Gallery - Justified Layout */
.gallery {
  display: flex;
  flex-wrap: wrap;
  line-height: 0;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid #000;
  box-sizing: border-box;
}

.gallery-item img,
.gallery-item canvas {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.gallery-item:hover img,
.gallery-item:hover canvas {
  transform: scale(1.05);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover figcaption {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.lightbox-content figcaption {
  color: #fff;
  font-size: 16px;
  padding: 16px;
  line-height: 1.5;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  padding: 10px;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 50px;
  cursor: pointer;
  padding: 20px;
  z-index: 1001;
  transition: opacity 0.2s ease;
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.7;
}

/* Responsive - Lightbox buttons only */
@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    font-size: 30px;
    padding: 15px;
  }

  .lightbox-close {
    font-size: 30px;
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .gallery-item figcaption {
    opacity: 1;
  }
}
