/* AVAG Pelo Mundo Gallery — visual moderno + grid responsivo (thumbs sem corte) */

.avag-pmg {
  --avag-pmg-accent: #F0AE00;
  --avag-pmg-cols: 4;
  width: 100%;
}

.avag-pmg-grid {
  display: grid;
  grid-template-columns: repeat(var(--avag-pmg-cols, 4), minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.avag-pmg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: #0A192F;
  box-shadow: 0 10px 28px rgba(10, 25, 47, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.avag-pmg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(10, 25, 47, 0.28);
}

.avag-pmg-media {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  background: #07121f;
}

/* Imagem inteira: sem aspect-ratio fixo e sem object-fit:cover */
.avag-pmg-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  vertical-align: top;
  transition: opacity 0.25s ease;
}

.avag-pmg-card:hover .avag-pmg-media img {
  opacity: 0.94;
}

.avag-pmg-caption {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.95rem 1rem;
  background: #0A192F;
}

.avag-pmg-date {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--avag-pmg-accent, #F0AE00);
}

.avag-pmg-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.avag-pmg-presentes {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.avag-pmg-presentes:empty {
  display: none;
}

.avag-pmg-more {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.avag-pmg-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  background: var(--avag-pmg-accent);
  color: #0A192F;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(240, 174, 0, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.avag-pmg-more-btn:hover {
  filter: brightness(1.05);
  color: #0A192F;
  transform: translateY(-1px);
}

/* Lazy load */
.avag-pmg-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  color: #0A192F;
  font-weight: 600;
  font-size: 0.9rem;
}

.avag-pmg-loader[hidden] {
  display: none !important;
}

.avag-pmg-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 3px solid rgba(10, 25, 47, 0.15);
  border-top-color: var(--avag-pmg-accent, #F0AE00);
  border-radius: 50%;
  animation: avag-pmg-spin 0.7s linear infinite;
}

@keyframes avag-pmg-spin {
  to {
    transform: rotate(360deg);
  }
}

.avag-pmg-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.avag-pmg-loadmore[hidden] {
  display: none !important;
}

.avag-pmg-loadmore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--avag-pmg-accent, #F0AE00);
  background: transparent;
  color: #0A192F;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.avag-pmg-loadmore-btn:hover:not(:disabled) {
  background: var(--avag-pmg-accent, #F0AE00);
}

.avag-pmg-loadmore-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.avag-pmg-sentinel {
  height: 1px;
  width: 100%;
  margin-top: 0.5rem;
  pointer-events: none;
}

.avag-pmg-sentinel[hidden] {
  display: none !important;
}

/* Limites por breakpoint (quantidade) */
@media (min-width: 1025px) {
  .avag-pmg-card.is-hide-desktop {
    display: none !important;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .avag-pmg-card.is-hide-tablet {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .avag-pmg-card.is-hide-mobile {
    display: none !important;
  }
}

/* Lightbox */
.avag-pmg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7, 15, 30, 0.92);
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}

.avag-pmg-lightbox.is-open {
  display: flex;
}

.avag-pmg-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(96vw, 1100px);
  max-height: 90vh;
}

.avag-pmg-lightbox img {
  max-width: 100%;
  max-height: calc(90vh - 4.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.avag-pmg-lightbox-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.9rem;
  text-align: center;
  max-width: 100%;
}

.avag-pmg-lightbox-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--avag-pmg-accent, #F0AE00);
}

.avag-pmg-lightbox-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.avag-pmg-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--avag-pmg-accent, #F0AE00);
  color: #0A192F;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  transition: filter 0.2s ease;
}

/*
 * Hello Elementor force button:hover { background:#c36 } (rosa).
 * Sobrescreve só no hover/focus — estado normal permanece o accent.
 */
.avag-pmg-lightbox-close:hover,
.avag-pmg-lightbox-close:focus {
  background: var(--avag-pmg-accent, #F0AE00);
  background-color: var(--avag-pmg-accent, #F0AE00);
  color: #0A192F;
  filter: brightness(1.05);
  text-decoration: none;
}

.avag-pmg-lightbox-close:focus {
  outline: none;
}

/* Ícones SVG — só o conteúdo; círculo intacto. Flex + inset garante centro geométrico. */
.avag-pmg-lightbox-close-icon,
.avag-pmg-lightbox-nav-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 0;
  pointer-events: none;
}

.avag-pmg-lb-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.avag-pmg-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0A192F;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.avag-pmg-lightbox-nav:hover:not(:disabled) {
  background: var(--avag-pmg-accent, #F0AE00);
}

.avag-pmg-lightbox-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.avag-pmg-lightbox-nav[hidden] {
  display: none !important;
}

.avag-pmg-lightbox-prev {
  left: 1rem;
}

.avag-pmg-lightbox-next {
  right: 1rem;
}

@media (max-width: 767px) {
  .avag-pmg-lightbox-nav {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.15rem;
  }

  .avag-pmg-lightbox-prev {
    left: 0.55rem;
  }

  .avag-pmg-lightbox-next {
    right: 0.55rem;
  }
}
