/* Accessible Lightbox & Gallery Styles */
.jg-gallery-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.jg-filter-btn {
  background: var(--jg-bg-light);
  border: 1px solid var(--jg-border-light);
  padding: 8px 20px;
  border-radius: 30px;
  font-family: var(--jg-font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--jg-navy-deep);
  cursor: pointer;
  transition: var(--jg-transition);
}

.jg-filter-btn:hover,
.jg-filter-btn.is-active {
  background: var(--jg-orange);
  color: var(--jg-white);
  border-color: var(--jg-orange);
}

.jg-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.jg-gallery-item {
  position: relative;
  border-radius: var(--jg-radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.jg-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.jg-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 15, 39, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: var(--jg-white);
  opacity: 0;
  transition: var(--jg-transition);
}

.jg-gallery-item:hover .jg-gallery-overlay {
  opacity: 1;
}

/* Lightbox Modal */
.jg-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 15, 39, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--jg-transition);
}

.jg-lightbox-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.jg-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jg-lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--jg-radius-sm);
}

.jg-lightbox-caption {
  color: var(--jg-white);
  margin-top: 15px;
  font-family: var(--jg-font-heading);
  font-size: 1rem;
  text-align: center;
}

.jg-lightbox-close,
.jg-lightbox-prev,
.jg-lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: var(--jg-white);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--jg-transition);
}

.jg-lightbox-close:hover,
.jg-lightbox-prev:hover,
.jg-lightbox-next:hover {
  background: var(--jg-orange);
}

.jg-lightbox-close {
  top: 20px;
  right: 20px;
}

.jg-lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.jg-lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}


/* Responsive interaction safeguards */
.jg-gallery-item {
  min-width: 0;
}

.jg-gallery-item:focus-visible {
  outline: 3px solid var(--jg-orange);
  outline-offset: 3px;
}

@media (hover: none) {
  .jg-gallery-item:hover img {
    transform: none;
  }
}

@media (max-width: 767px) {
  .jg-lightbox-caption {
    max-width: calc(100vw - 64px);
    font-size: 0.9rem;
    line-height: 1.35;
  }
}
