/* Componente: Galeria Mosaico e Lightbox com Álbum */
.gal {
  padding: clamp(64px, 10vw, 120px) var(--pad);
}

.gal-in {
  max-width: var(--max);
  margin: 0 auto;
}

.gal-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.gal h2 {
  font: italic 800 clamp(2.4rem, 5.4vw, 4.6rem) / 0.94 var(--display);
  text-transform: uppercase;
}

.gal-head p {
  color: var(--muted);
  max-width: 26em;
}

.gal-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

.gal-note {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 58ch;
}

.gal-note a {
  color: var(--fg);
  font-weight: 600;
  text-underline-offset: 3px;
}

.gal-note a:hover {
  color: var(--red-text);
}

.mos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(110px, 15vw, 210px);
  gap: 10px;
}

.mos figure {
  position: relative;
  overflow: hidden;
  background: #222222;
}

.mos-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
}

.mos-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 11, 11, 0.55) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mos-trigger:hover::after,
.mos-trigger:focus-visible::after {
  opacity: 1;
}

.mos-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(11, 11, 11, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.mos-zoom svg {
  width: 18px;
  height: 18px;
}

.mos-trigger:hover .mos-zoom,
.mos-trigger:focus-visible .mos-zoom {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .mos-zoom {
    opacity: 0.92;
    transform: none;
  }
}

.mos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

.mos-trigger:hover img {
  transform: scale(1.04);
}

.pos-podium {
  object-position: 50% 30%;
}

.pos-salto {
  object-position: 55% 50%;
}

.pos-peteca {
  object-position: 30% 50%;
}

.pos-coletivo {
  object-position: 60% 55%;
}

.mos .a {
  grid-column: span 4;
  grid-row: span 2;
}

.mos .b,
.mos .c,
.mos .d,
.mos .e {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 700px) {
  .mos {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }

  .mos .a {
    grid-column: span 2;
    grid-row: span 2;
  }

  .mos .b,
  .mos .c,
  .mos .d,
  .mos .e {
    grid-column: span 1;
    grid-row: span 2;
  }

  .mos-zoom {
    opacity: 0.92;
    transform: none;
  }
}

/* Lightbox nativo <dialog> */
.lightbox {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: min(1100px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  width: 100%;
  background: #0b0b0b;
  color: #ffffff;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(4px);
}

.lightbox-in {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-count {
  font: italic 800 1.15rem / 1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  overflow: hidden;
  touch-action: pan-y;
}

.lightbox-media img {
  max-height: calc(100svh - 285px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.lightbox-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
}

.lightbox-cap {
  font-size: 0.98rem;
  color: #efedea;
}

.lightbox-credit {
  font-size: 0.88rem;
  color: var(--on-dark-muted);
}

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 4px;
  scrollbar-color: var(--red) #141414;
}

.lightbox-thumb {
  flex: none;
  width: 72px;
  height: 48px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: #141414;
  color: var(--on-dark-muted);
  font: italic 700 0.85rem / 1 var(--display);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.62;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.lightbox-thumb:hover {
  opacity: 0.9;
}

.lightbox-thumb.is-active {
  opacity: 1;
  border-color: var(--red);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .mos img,
  .mos-trigger::after,
  .mos-zoom {
    transition: none;
  }
}
