#fullscreenBrowser {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  touch-action: none;
}

.slideshowWrapper {
  width: 100%;
  height: 100%;
}

.slideshow {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 1;
  padding-bottom: 80px;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.imageWrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imageWrapper img {
  max-width: 90%;
  max-height: 85vh;
  display: block;
  object-fit: contain;
}

.image-detail-wrapper {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
  padding: 12px 30px;
  background: rgba(80,83,94,0.5);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.image-detail-wrapper.visible {
  opacity: 0.5;
  pointer-events: auto;
}

.image-detail-wrapper.visible:hover {
  opacity: 1;
}

.image-detail-wrapper h2 {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 3px;
}

.image-detail-wrapper .image-description p {
  font-size: 12px;
  font-weight: 300;
  color: #ccc;
  letter-spacing: 1px;
}

.gallery-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  color: #fff;
  font-size: 28px;
  padding: 15px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  text-decoration: none;
  user-select: none;
  pointer-events: none;
}

.gallery-nav.visible {
  opacity: 0.5;
  pointer-events: auto;
}

.gallery-nav.visible:hover {
  opacity: 1;
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.grid-index {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100% - 80px);
  z-index: 50;
  background: rgba(80,83,94,0.97);
  overflow-y: auto;
  padding: 20px 20px 40px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  align-content: start;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 1s ease, opacity 1s ease;
}

.grid-index.open {
  display: grid;
}

.grid-index.slide-in {
  transform: translateY(0);
  opacity: 1;
}

.grid-thumb {
  cursor: pointer;
}

.grid-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.grid-thumb img:hover {
  opacity: 1;
}

.slide-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

body.grid-open .gallery-nav {
  display: none;
}

body.grid-open .image-detail-wrapper {
  display: none;
}

@media (max-width: 768px) {
  .imageWrapper img {
    max-width: 95%;
    max-height: 70vh;
  }

  .image-detail-wrapper {
    bottom: 70px;
    padding: 10px 20px;
  }

  .gallery-nav {
    font-size: 22px;
    padding: 12px;
  }

  .grid-index {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    top: 80px;
    height: calc(100% - 80px);
  }

  .grid-thumb img {
    height: 120px;
  }
}