/* Arena B3 v2 — Galeria de Fotos agrupada por evento (/a-arena#galeria)
 *
 * app-gallery renderiza nativamente uma grade fixa de 12 fotos (desktop:
 * .row.g-0.my-0 > .col-3; mobile: <ngb-carousel>). Escondemos esses nodes
 * nativos e injetamos, dentro do mesmo container, uma grade de cards por
 * evento (thumb + titulo) que abre num modal/slider com todas as fotos
 * daquele evento. Paleta: royal #1818B7, navy #0A0349, salmao #F5BB94,
 * creme #F5EFE0. Fonte: Mulish (ja carregada globalmente).
 */

/* Esconde a grade/carousel nativos do app-gallery, mantendo o titulo da
   secao ("Galeria de Fotos") e o fundo navy ja aplicado em v2-theme.css. */
app-gallery .gallery-content .row.g-0.my-0,
app-gallery .gallery-content ngb-carousel {
  display: none !important;
}

.ab3-v2-gallery {
  width: 100%;
  font-family: Mulish, sans-serif;
}

.ab3-v2-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Fixo em 3 colunas a partir daqui (evita grade poluida em telas largas). */
@media (min-width: 576px) {
  .ab3-v2-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem 1.5rem;
  }
}

.ab3-v2-gallery__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #F5EFE0;
  font-family: inherit;
  text-align: left;
}

.ab3-v2-gallery__thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #0A0349;
  border: 1px solid rgba(245, 239, 224, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ab3-v2-gallery__card:hover .ab3-v2-gallery__thumb-wrap,
.ab3-v2-gallery__card:focus-visible .ab3-v2-gallery__thumb-wrap {
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35);
}

.ab3-v2-gallery__card:focus-visible {
  outline: none;
}

.ab3-v2-gallery__card:focus-visible .ab3-v2-gallery__thumb-wrap {
  outline: 3px solid #F5BB94;
  outline-offset: 2px;
}

.ab3-v2-gallery__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab3-v2-gallery__thumb-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(10, 3, 73, 0.65), rgba(10, 3, 73, 0));
  pointer-events: none;
}

.ab3-v2-gallery__count {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 1;
  background: rgba(10, 3, 73, 0.75);
  color: #F5EFE0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.ab3-v2-gallery__title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1818B7;
  text-align: center;
}

@media (min-width: 900px) {
  .ab3-v2-gallery__title {
    font-size: 0.9375rem;
  }
}

/* ---------- Modal / lightbox slider ---------- */

.ab3-v2-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 2, 44, 0.94);
  font-family: Mulish, sans-serif;
  padding: 1rem;
}

.ab3-v2-lightbox.is-open {
  display: flex;
}

.ab3-v2-lightbox__dialog {
  position: relative;
  width: 100%;
  max-width: 1080px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ab3-v2-lightbox__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #F5EFE0;
  margin-bottom: 0.75rem;
  padding-right: 3rem;
}

.ab3-v2-lightbox__title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
}

.ab3-v2-lightbox__counter {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(245, 239, 224, 0.75);
  white-space: nowrap;
}

.ab3-v2-lightbox__close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  transform: translate(50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 0;
  background: #1818B7;
  color: #fff;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab3-v2-lightbox__close:hover,
.ab3-v2-lightbox__close:focus-visible {
  background: #F5BB94;
  color: #0A0349;
}

.ab3-v2-lightbox__stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y;
}

.ab3-v2-lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 0.375rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
  background: #0A0349;
}

.ab3-v2-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 0;
  background: rgba(24, 24, 183, 0.75);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab3-v2-lightbox__arrow:hover,
.ab3-v2-lightbox__arrow:focus-visible {
  background: #F5BB94;
  color: #0A0349;
}

.ab3-v2-lightbox__arrow--prev {
  left: 0.25rem;
}

.ab3-v2-lightbox__arrow--next {
  right: 0.25rem;
}

.ab3-v2-lightbox__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (min-width: 768px) {
  .ab3-v2-lightbox__arrow--prev {
    left: -3.5rem;
  }

  .ab3-v2-lightbox__arrow--next {
    right: -3.5rem;
  }
}

.ab3-v2-lightbox__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 100%;
  padding: 0 0.5rem;
}

.ab3-v2-lightbox__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(245, 239, 224, 0.35);
  cursor: pointer;
}

.ab3-v2-lightbox__dot.is-active {
  background: #F5BB94;
  width: 0.625rem;
  height: 0.625rem;
}

.ab3-v2-lightbox__dot:focus-visible {
  outline: 2px solid #F5BB94;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ab3-v2-gallery__card,
  .ab3-v2-gallery__thumb-wrap {
    transition: none;
  }
}
