#adem-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(14, 25, 71, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#adem-gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

#adem-gallery-lightbox .lb-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

#adem-gallery-lightbox .lb-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

#adem-gallery-lightbox .lb-image-wrap {
  position: relative;
  width: 100%;
  max-height: calc(92vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

#adem-gallery-lightbox .lb-image {
  max-width: 100%;
  max-height: calc(92vh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  user-select: none;
}

#adem-gallery-lightbox .lb-caption {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.125rem;
  line-height: 1.55;
  text-align: center;
  max-width: 48rem;
  padding: 0 0.5rem;
}

#adem-gallery-lightbox .lb-counter {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

#adem-gallery-lightbox .lb-close,
#adem-gallery-lightbox .lb-nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}

#adem-gallery-lightbox .lb-close:hover,
#adem-gallery-lightbox .lb-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

#adem-gallery-lightbox .lb-close {
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  z-index: 2;
}

#adem-gallery-lightbox .lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  z-index: 2;
}

#adem-gallery-lightbox .lb-nav:hover {
  transform: translateY(-50%) scale(1.05);
}

#adem-gallery-lightbox .lb-nav--prev {
  left: 1rem;
}

#adem-gallery-lightbox .lb-nav--next {
  right: 1rem;
}

#adem-gallery-lightbox .lb-nav[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

img.gallery-lightbox-thumb,
.gallery-lightbox-wrap {
  cursor: zoom-in;
}

.adem-gallery img {
  cursor: zoom-in;
}

/* Legendas sempre visíveis nas galerias */
.adem-gallery-item {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: visible;
  background: #fff;
}

.adem-gallery-photo {
  flex: 0 0 auto;
  overflow: hidden;
  background: #f9fafb;
}

.adem-gallery-photo > img {
  display: block;
  width: 100%;
  height: auto;
}

.adem-gallery:not(.adem-parceiros-gallery) .adem-gallery-photo > img {
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.adem-parceiros-gallery .adem-gallery-photo,
#galeria-parceiros .adem-gallery-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
}

.adem-parceiros-gallery .adem-gallery-photo > img,
#galeria-parceiros .adem-gallery-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform-origin: center center;
}

.adem-gallery-caption {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto;
  font-size: 1.0625rem !important;
  line-height: 1.55;
  color: #333333;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 0.875rem 1rem;
  border-radius: 0 0 1rem 1rem;
}

.adem-gallery .grid,
.adem-parceiros-gallery .grid,
#galeria-parceiros .grid {
  align-items: start;
}

.adem-parceiros-gallery .adem-gallery-item,
#galeria-parceiros .adem-gallery-item {
  height: auto;
  overflow: visible;
}

@media (max-width: 640px) {
  .adem-gallery-caption {
    font-size: 1rem !important;
    padding: 0.75rem 0.875rem;
  }
}

@media (max-width: 640px) {
  #adem-gallery-lightbox .lb-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  #adem-gallery-lightbox .lb-nav--prev {
    left: 0.5rem;
  }

  #adem-gallery-lightbox .lb-nav--next {
    right: 0.5rem;
  }

  #adem-gallery-lightbox .lb-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}
