.fffx-gallery {
  margin: 32px 0 8px;
}

.fffx-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.fffx-gallery__item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

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

.fffx-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.55));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.fffx-gallery__item:hover img { transform: scale(1.06); }
.fffx-gallery__item:hover::after { opacity: 1; }

.fffx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 13, 24, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fffx-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fffx-lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.fffx-lightbox__figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.fffx-lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fffx-lightbox__caption {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px 18px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.fffx-lightbox__btn,
button.fffx-lightbox__btn {
  position: absolute !important;
  z-index: 2000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 9999px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  cursor: pointer !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  padding: 0 !important;
}

.fffx-lightbox__btn:hover,
button.fffx-lightbox__btn:hover {
  background: #e8a33d !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(232, 163, 61, 0.8) !important;
}

.fffx-lightbox__btn:focus-visible {
  outline: 2px solid #f59e0b !important;
  outline-offset: 2px !important;
}

.fffx-lightbox__btn i,
button.fffx-lightbox__btn i {
  color: #ffffff !important;
  font-size: 26px !important;
  line-height: 1 !important;
  display: block !important;
  font-style: normal !important;
  font-weight: 900 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.fffx-lightbox__btn--close {
  top: 24px;
  right: 24px;
}

.fffx-lightbox__btn--close:hover {
  transform: scale(1.12);
}

.fffx-lightbox__btn--prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.fffx-lightbox__btn--prev:hover {
  transform: translateY(-50%) scale(1.12);
}

.fffx-lightbox__btn--next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.fffx-lightbox__btn--next:hover {
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 640px) {
  .fffx-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fffx-lightbox__btn--prev { left: 10px; }
  .fffx-lightbox__btn--next { right: 10px; }
  .fffx-lightbox__btn--close { top: 10px; right: 10px; }
}
