.jsfsg-gallery {
  --jsfsg-gold: rgba(214, 173, 96, 0.35);
  --jsfsg-gold-strong: rgba(214, 173, 96, 0.75);
  --jsfsg-blue-glow: rgba(60, 130, 220, 0.22);
  width: 100%;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(8, 18, 35, 0.92), rgba(3, 8, 18, 0.96));
  border: 1px solid var(--jsfsg-gold);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
}

.jsfsg-gallery--preview .jsfsg-card:not(:first-child) {
  display: none;
}

.jsfsg-card {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(214, 173, 96, 0.28);
  background: rgba(6, 14, 28, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.jsfsg-card:hover,
.jsfsg-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--jsfsg-gold-strong);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48), 0 0 28px var(--jsfsg-blue-glow);
  outline: none;
}

.jsfsg-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

.jsfsg-card__shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(3, 8, 18, 0), rgba(3, 8, 18, 0.86));
  pointer-events: none;
}

.jsfsg-card__label,
.jsfsg-card__count {
  position: absolute;
  z-index: 2;
  color: #f4efe5;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.jsfsg-card__label {
  left: 22px;
  bottom: 22px;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jsfsg-card__count {
  right: 22px;
  bottom: 22px;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.jsfsg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.jsfsg-lightbox.is-open {
  display: flex;
}

.jsfsg-lightbox__image {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  border: 0;
  box-shadow: none;
}

.jsfsg-lightbox__btn {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: rgba(3, 8, 18, 0.48);
  color: #fff;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.jsfsg-lightbox__btn:hover {
  opacity: 1;
}

.jsfsg-lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.jsfsg-lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }
.jsfsg-lightbox__close { right: 24px; top: 20px; font-size: 34px; }

.jsfsg-lightbox__watermark {
  position: fixed;
  right: 32px;
  bottom: 28px;
  width: 170px;
  height: auto;
  opacity: 0.78;
  pointer-events: none;
  z-index: 3;
}

body.jsfsg-no-scroll {
  overflow: hidden;
}

@media (max-width: 768px) {
  .jsfsg-gallery { padding: 12px; }
  .jsfsg-card__label { left: 16px; bottom: 16px; }
  .jsfsg-card__count { right: 16px; bottom: 16px; font-size: 0.72rem; }
  .jsfsg-lightbox__btn { width: 44px; height: 44px; font-size: 30px; }
  .jsfsg-lightbox__prev { left: 12px; }
  .jsfsg-lightbox__next { right: 12px; }
  .jsfsg-lightbox__close { right: 12px; top: 12px; }
  .jsfsg-lightbox__watermark { width: 110px; right: 16px; bottom: 14px; opacity: 0.65; }
}


/* Preview thumbnail hover arrows */
.jsfsg-card__label,
.jsfsg-card__count {
  display: none !important;
}

.jsfsg-card__shade {
  height: 100%;
  background:
    linear-gradient(90deg, rgba(3, 8, 18, 0.52), rgba(3, 8, 18, 0) 34%, rgba(3, 8, 18, 0) 66%, rgba(3, 8, 18, 0.52)),
    linear-gradient(180deg, rgba(3, 8, 18, 0), rgba(3, 8, 18, 0.24));
  opacity: 0;
  transition: opacity 180ms ease;
}

.jsfsg-card:hover .jsfsg-card__shade,
.jsfsg-card:focus-visible .jsfsg-card__shade {
  opacity: 1;
}

.jsfsg-preview-nav {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.jsfsg-card:hover .jsfsg-preview-nav,
.jsfsg-card:focus-visible .jsfsg-preview-nav {
  opacity: 1;
}

.jsfsg-preview-nav__btn {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 58px;
  border-radius: 999px;
  background: rgba(3, 8, 18, 0.52);
  color: #fff;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: auto;
  user-select: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.jsfsg-preview-nav__btn:hover {
  background: rgba(3, 8, 18, 0.72);
}

.jsfsg-preview-nav__btn--prev { left: 18px; }
.jsfsg-preview-nav__btn--next { right: 18px; }

@media (max-width: 768px) {
  .jsfsg-preview-nav {
    opacity: 1;
  }
  .jsfsg-preview-nav__btn {
    width: 38px;
    height: 48px;
    font-size: 34px;
  }
  .jsfsg-preview-nav__btn--prev { left: 10px; }
  .jsfsg-preview-nav__btn--next { right: 10px; }
}


/* v0.1.3 lightbox overlay layering fix */
.jsfsg-lightbox {
  isolation: isolate;
}

.jsfsg-lightbox__image {
  position: relative;
  z-index: 1;
}

.jsfsg-lightbox__btn {
  z-index: 20;
}

.jsfsg-lightbox__watermark {
  position: fixed !important;
  right: 32px !important;
  bottom: 28px !important;
  display: block !important;
  max-width: min(28vw, 260px);
  height: auto !important;
  z-index: 30 !important;
  pointer-events: none !important;
}

.jsfsg-lightbox__caption {
  position: fixed;
  left: 32px;
  bottom: 28px;
  z-index: 30;
  max-width: min(620px, 52vw);
  padding: 10px 14px;
  border: 1px solid rgba(214, 173, 96, 0.24);
  border-radius: 12px;
  background: rgba(3, 8, 18, 0.54);
  color: rgba(244, 239, 229, 0.94);
  font-size: 0.92rem;
  line-height: 1.35;
  letter-spacing: 0.015em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.jsfsg-lightbox__caption.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .jsfsg-lightbox__watermark {
    right: 16px !important;
    bottom: 14px !important;
    max-width: 34vw;
  }

  .jsfsg-lightbox__caption {
    left: 16px;
    right: 16px;
    bottom: 58px;
    max-width: none;
    font-size: 0.82rem;
  }
}


/* v0.1.4: keep watermark/caption attached to the displayed image frame */
.jsfsg-lightbox {
  padding: 36px 88px;
  box-sizing: border-box;
}

.jsfsg-lightbox__frame {
  position: relative;
  display: inline-block;
  max-width: 94vw;
  max-height: 92vh;
  margin: 0;
  padding: 0;
  line-height: 0;
  z-index: 1;
}

.jsfsg-lightbox__frame .jsfsg-lightbox__image {
  position: relative !important;
  display: block !important;
  max-width: 100% !important;
  max-height: 92vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  z-index: 1 !important;
}

.jsfsg-lightbox__frame .jsfsg-lightbox__watermark {
  position: absolute !important;
  right: 22px !important;
  bottom: 22px !important;
  display: block !important;
  max-width: min(28%, 260px) !important;
  height: auto !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

.jsfsg-lightbox__frame .jsfsg-lightbox__caption {
  position: absolute !important;
  left: 22px !important;
  bottom: 22px !important;
  z-index: 6 !important;
  max-width: min(56%, 620px) !important;
  line-height: 1.35 !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .jsfsg-lightbox {
    padding: 58px 12px 68px;
  }

  .jsfsg-lightbox__frame {
    max-width: 100%;
    max-height: 86vh;
  }

  .jsfsg-lightbox__frame .jsfsg-lightbox__image {
    max-height: 86vh !important;
  }

  .jsfsg-lightbox__frame .jsfsg-lightbox__watermark {
    right: 12px !important;
    bottom: 12px !important;
    max-width: 34% !important;
  }

  .jsfsg-lightbox__frame .jsfsg-lightbox__caption {
    left: 12px !important;
    bottom: 12px !important;
    max-width: 58% !important;
    font-size: 0.78rem !important;
  }
}
