/* =========================================================
   GALERIA DE FOTOS - VISUALIZAÇÃO AMPLIADA
   ========================================================= */

.ma-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at center, rgba(25,25,25,.82) 0%, rgba(0,0,0,.96) 72%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

.ma-gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ma-gallery-lightbox__dialog {
  position: relative;
  width: min(94vw, 1500px);
  height: min(94vh, 1000px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  outline: none;
}

.ma-gallery-lightbox__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  max-width: calc(100vw - 56px);
  max-height: calc(100vh - 150px);
  padding: 10px;
  border: 1px solid rgba(201,162,63,.55);
  background: rgba(5,5,5,.78);
  box-shadow:
    0 0 0 1px rgba(192,24,24,.12),
    0 0 35px rgba(201,162,63,.18),
    0 0 80px rgba(0,0,0,.9);
  overflow: hidden;
}

.ma-gallery-lightbox__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  background: url("../img/MAUSOLÉU_DAS_ALMAS.webp") center / min(75%, 420px) no-repeat;
  opacity: .18;
  pointer-events: none;
  z-index: 2;
}

.ma-gallery-lightbox__image {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 78px);
  max-height: calc(100vh - 172px);
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ma-gallery-lightbox__close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201,162,63,.55);
  border-radius: 50%;
  background: rgba(0,0,0,.78);
  color: var(--gold, #c9a23f);
  font-family: 'CG-Light', serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .25s ease;
}

.ma-gallery-lightbox__close:hover,
.ma-gallery-lightbox__close:focus-visible {
  color: #fff;
  border-color: var(--gold, #c9a23f);
  background: rgba(192,24,24,.22);
  transform: scale(1.05);
  outline: none;
}

.ma-gallery-lightbox__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 5px 12px;
  border: 1px solid rgba(201,162,63,.35);
  background: rgba(0,0,0,.76);
  box-shadow: 0 0 25px rgba(0,0,0,.55);
}

.ma-gallery-lightbox__nav {
  min-width: 40px;
  height: 36px;
  padding: 0 7px;
  border: 1px solid rgba(201,162,63,.45);
  background: transparent;
  color: var(--gold, #c9a23f);
  font-family: 'Cinzel', serif;
  font-size: 30px;
  line-height: -10;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s ease;
}

.ma-gallery-lightbox__nav:hover:not(:disabled),
.ma-gallery-lightbox__nav:focus-visible:not(:disabled) {
  color: #fff;
  background: rgba(192,24,24,.22);
  border-color: var(--gold, #c9a23f);
  transform: translateY(-1px);
  outline: none;
}

.ma-gallery-lightbox__nav:disabled {
  opacity: .25;
  cursor: default;
}

.ma-gallery-lightbox__counter {
  min-width: 74px;
  padding: 0 6px;
  color: #ddd;
  font-family: 'CG-Light', serif;
  font-size: 20px;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ma-gallery-lightbox {
    padding: 12px;
  }

  .ma-gallery-lightbox__dialog {
    width: 100%;
    height: 100%;
    gap: 12px;
  }

  .ma-gallery-lightbox__frame {
    width: fit-content;
    height: fit-content;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 124px);
    min-width: 0;
    min-height: 0;
    padding: 6px;
  }

  .ma-gallery-lightbox__frame::after {
    inset: 6px;
    background-size: min(62%, 280px);
    opacity: .20;
  }

  .ma-gallery-lightbox__image {
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 136px);
  }

  .ma-gallery-lightbox__close {
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 18px;
  }

  .ma-gallery-lightbox__controls {
    width: 100%;
    max-width: 390px;
    gap: 4px;
    padding: 5px 6px;
  }

  .ma-gallery-lightbox__nav {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    padding: 0 4px;
    font-size: 19px;
  }

  .ma-gallery-lightbox__counter {
    flex: 0 0 auto;
    min-width: 64px;
    font-size: 18px;
    letter-spacing: .5px;
  }
}

@media (max-width: 380px) {
  .ma-gallery-lightbox__controls {
    gap: 2px;
    padding-left: 3px;
    padding-right: 3px;
  }

  .ma-gallery-lightbox__nav {
    font-size: 17px;
  }

  .ma-gallery-lightbox__counter {
    min-width: 58px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ma-gallery-lightbox,
  .ma-gallery-lightbox__nav,
  .ma-gallery-lightbox__close {
    transition: none;
  }
}