/* ─── GALERIA DE FOTOS: grade quadrada + lightbox ─── */

/* ── INTRODUÇÃO ─────────────────────────────────────────────────────── */
.mc-gallery-intro {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 7vw 0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--ink);
  text-align: center;
}

.mc-gallery-intro p:last-child {
  margin-bottom: 0;
}

/* ── GRADE ──────────────────────────────────────────────────────────── */
.mc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 4vw 6rem;
  list-style: none;
}

.mc-gallery-item {
  margin: 0;
}

.mc-gallery-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.mc-gallery-link:focus-visible {
  outline: 2px solid var(--sepia);
  outline-offset: 3px;
}

.mc-gallery-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--parchment-warm);
}

.mc-gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.mc-gallery-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(26, 20, 16, 0.85) 0%, rgba(26, 20, 16, 0.25) 55%, transparent 100%);
  color: var(--cream-white);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.35;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.mc-gallery-link:hover .mc-gallery-image,
.mc-gallery-link:focus-visible .mc-gallery-image {
  transform: scale(1.08);
}

.mc-gallery-link:hover .mc-gallery-caption,
.mc-gallery-link:focus-visible .mc-gallery-caption {
  opacity: 1;
}

@media (max-width: 1024px) {
  .mc-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .mc-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 2.5rem 16px 4rem;
  }

  .mc-gallery-caption {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mc-gallery-image,
  .mc-gallery-caption {
    transition: none;
  }
}

/* ── LIGHTBOX ───────────────────────────────────────────────────────── */
.mc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4.5rem 1.5rem;
  background: rgba(15, 11, 8, 0.96);
  color: var(--cream-white);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mc-lightbox[hidden] {
  display: none;
}

.mc-lightbox.is-open {
  opacity: 1;
}

.mc-lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.mc-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease;
}

.mc-lightbox-image.is-loading {
  opacity: 0;
}

.mc-lightbox-footer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1.25rem;
  max-width: 900px;
  padding-top: 1rem;
  text-align: center;
}

.mc-lightbox-caption {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.4;
}

.mc-lightbox-counter {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--sepia-light);
}

.mc-lightbox-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(250, 248, 242, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--cream-white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mc-lightbox-btn:hover,
.mc-lightbox-btn:focus-visible {
  background: rgba(250, 248, 242, 0.1);
  border-color: var(--sepia-light);
  outline: none;
}

.mc-lightbox-close {
  top: 1rem;
  right: 1rem;
}

.mc-lightbox-prev,
.mc-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.mc-lightbox-prev {
  left: 1rem;
}

.mc-lightbox-next {
  right: 1rem;
}

@media (max-width: 600px) {
  .mc-lightbox {
    padding: 4rem 0 1.25rem;
  }

  .mc-lightbox-footer {
    padding: 1rem 16px 0;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  /* No celular a navegação é por swipe. */
  .mc-lightbox-prev,
  .mc-lightbox-next {
    display: none;
  }
}

body.mc-lightbox-open {
  overflow: hidden;
}
