/* ============================================
   GALERIA DE FOTOS CARROSSEL
   Igreja Evangélica Jeová Jireh
   ============================================ */

/* === SEÇÃO DA GALERIA === */
.gallery-section {
  position: relative;
  padding: 80px 0;
  background: linear-gradient(180deg, #0f1a32 0%, #0A1628 100%);
  overflow: hidden;
}

.gallery-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.3), transparent);
}

/* === CONTAINER PRINCIPAL === */
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === CARROSSEL === */
.gallery-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === TRACK (TRILHA) === */
.gallery-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Respeita prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-track {
    transition: transform 0.1s ease-out;
  }
}

/* === SLIDE === */
.gallery-slide {
  flex-shrink: 0;
  padding: 12px;
  /* Desktop: 3 fotos visíveis */
  width: 33.333%;
}

/* Tablet: 2 fotos visíveis */
@media (max-width: 1023px) {
  .gallery-slide {
    width: 50%;
  }
}

/* Celular: 1 foto visível */
@media (max-width: 767px) {
  .gallery-slide {
    width: 100%;
  }
}

/* === IMAGEM === */
.gallery-slide img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-slide img {
    transition: none;
  }
}

.gallery-slide:hover img {
  transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-slide:hover img {
    transform: none;
  }
}

/* === PLACEHOLDER (quando não há foto real) === */
.gallery-image-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  text-align: center;
  padding: 20px;
}

.placeholder-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.placeholder-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  max-width: 250px;
}

/* === BOTÕES DE NAVEGAÇÃO (SETAS) === */
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9) 0%, rgba(185, 28, 28, 0.9) 100%);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-btn {
    transition: none;
  }
}

.gallery-btn:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-btn:hover {
    transform: translateY(-50%);
  }
}

.gallery-btn:focus {
  outline: 3px solid rgba(220, 38, 38, 0.5);
  outline-offset: 2px;
}

.gallery-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-btn:disabled:hover {
  transform: translateY(-50%);
}

.gallery-btn-prev {
  left: 12px;
}

.gallery-btn-next {
  right: 12px;
}

/* Em telas muito pequenas, ajustar posição */
@media (max-width: 480px) {
  .gallery-btn-prev {
    left: 8px;
  }

  .gallery-btn-next {
    right: 8px;
  }
}

/* === CONTROLES DE PLAYBACK === */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* === INDICADORES DE POSIÇÃO === */
.gallery-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-indicator {
    transition: none;
  }
}

.gallery-indicator:hover {
  background: rgba(255, 255, 255, 0.4);
}

.gallery-indicator.active {
  background: #DC2626;
  width: 32px;
  border-radius: 6px;
}

.gallery-indicator:focus {
  outline: 2px solid rgba(220, 38, 38, 0.5);
  outline-offset: 2px;
}

/* === SCROLL SNAP PARA MOBILE === */
@media (max-width: 767px) {
  .gallery-track {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    scroll-behavior: smooth;
  }

  .gallery-slide {
    scroll-snap-align: center;
  }

  /* Esconder scrollbar mas manter funcionalidade */
  .gallery-track::-webkit-scrollbar {
    display: none;
  }

  .gallery-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* === ANIMAÇÕES === */
@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-slide img {
  animation: galleryFadeIn 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-slide img {
    animation: none;
  }
}

/* === RESPONSIVO ADICIONAL === */
@media (max-width: 767px) {
  .gallery-section {
    padding: 48px 0;
  }

  .gallery-controls {
    flex-direction: column;
    gap: 16px;
  }

  .gallery-indicators {
    gap: 6px;
  }
}
