/* =========================
   SCROLL LOCK
   ========================= */

body.lightbox-open {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}


/* =========================
   GRID / GALLERY
   ========================= */

.grid .view-content {
  margin: 0 !important;
}

.view-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.view-content .grid__item {
  flex: 0 0 300px;
}


/* =========================
   THUMBNAILS
   ========================= */

.view-content .grid__item a {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 0;
  border-radius: 12px;
  background: #000;
  cursor: pointer;
}

.view-content .grid__item img {
  display: block;
  width: 100%;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.view-content .grid__item a:hover img {
  transform: scale(1.08);
  filter: brightness(0.45);
}


/* =========================
   LIGHTBOX BASE
   ========================= */

.lightbox {
  position: fixed;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0, 0, 0, 0);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.35s ease, background 0.35s ease, visibility 0.35s ease;

  z-index: 9999;
}


/* =========================
   LIGHTBOX ACTIVE
   ========================= */

.lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.92);
}


/* =========================
   BACKDROP
   ========================= */

.lightbox-backdrop {
  position: absolute;
  inset: 0;
}


/* =========================
   IMAGE (CROSSFADE)
   ========================= */

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;

  opacity: 0;
  transform: scale(0.96);

  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lightbox.is-loaded img {
  opacity: 1;
  transform: scale(1);
}


/* =========================
   CAPTION
   ========================= */

.lightbox-caption {
  margin-top: 12px;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 80vw;
}


/* =========================
   CLOSE BUTTON
   ========================= */

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 25px;

  font-size: 2.8rem;
  color: #fff;
  background: transparent;
  border: none;

  cursor: pointer;
  line-height: 1;

  opacity: 0.85;
  transition: opacity 0.2s ease;

  z-index: 10000;
}

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


/* =========================
   NAVIGATION ARROWS
   ========================= */

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);

  font-size: 3rem;
  color: #fff;
  background: transparent;
  border: none;

  cursor: pointer;

  opacity: 0.75;
  transition: opacity 0.2s ease;

  z-index: 10000;
}

.lightbox-arrow:hover {
  opacity: 1;
}

.lightbox-arrow.prev {
  left: 20px;
}

.lightbox-arrow.next {
  right: 20px;
}