/* ============================================
   GALLERY STYLES v2.0
   Estilos para a página de galeria de fotos
   ============================================ */

:root {
  --primary-color: #c59da8;
  --secondary-color: #a57d88;
  --light-bg: #f8f5f2;
  --text-dark: #333;
  --text-light: #666;
  --white: #fff;
  --modal-bg: rgba(0, 0, 0, 0.95);
}

/* ============================================
   HERO SECTION
   ============================================ */
.gallery-hero {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--light-bg) 0%, var(--white) 100%);
  text-align: center;
}

.gallery-hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.gallery-hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ============================================
   GALLERY GRID
   ============================================ */
.gallery-section {
  padding: 3rem 0 5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  aspect-ratio: 1;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h4 {
  color: var(--white);
  font-size: 1.2rem;
  margin: 0;
  font-family: "Playfair Display", serif;
}

/* ============================================
   MODAL - Visualização de Imagens
   ============================================ */

/* Backdrop escuro do modal */
.modal#imageModal {
  background: var(--modal-bg) !important;
}

.modal#imageModal .modal-backdrop {
  background-color: transparent;
}

/* Container do modal */
.modal-dialog {
  max-width: 95vw;
  margin: 1.75rem auto;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 3.5rem);
}

.modal-content {
  background: transparent !important;
  border: none;
  box-shadow: none;
}

/* Corpo do modal - onde a imagem aparece */
.modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-body img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  transition: opacity 0.3s ease;
}

/* Header do modal - botão de fechar */
.modal-header {
  border: none;
  background: transparent;
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1050;
  padding: 0;
}

.modal-header .btn-close {
  background: var(--white);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  opacity: 1;
  position: relative;
}

.modal-header .btn-close span {
  font-size: 32px;
  font-weight: 300;
  color: var(--text-dark);
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal-header .btn-close:hover {
  background: var(--primary-color);
  transform: rotate(90deg);
}

.modal-header .btn-close:hover span {
  color: var(--white);
}

/* Footer do modal - botões de navegação */
.modal-footer {
  border: none;
  background: transparent;
  justify-content: center;
  padding: 1.5rem;
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  gap: 1rem;
}

.modal-footer .modal-nav-btn {
  background: var(--white);
  color: var(--text-dark);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
}

.modal-footer .modal-nav-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

/* Prevenir scroll duplo quando modal está aberto */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

.modal.show {
  overflow-x: hidden;
  overflow-y: hidden;
}

/* ============================================
   FILTER BUTTONS (para futuro uso)
   ============================================ */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--white);
  color: var(--text-dark);
  border: 2px solid var(--primary-color);
  padding: 0.75rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 768px) {
  .gallery-hero h1 {
    font-size: 2.2rem;
  }

  .gallery-hero p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .modal-body img {
    max-height: 70vh;
  }

  .modal-header {
    top: 10px;
    right: 10px;
  }

  .modal-header .btn-close {
    width: 40px;
    height: 40px;
  }

  .modal-header .btn-close span {
    font-size: 28px;
  }

  .modal-footer {
    bottom: 10px;
    padding: 1rem;
  }

  .modal-footer .modal-nav-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .filter-buttons {
    padding: 0 1rem;
  }

  .filter-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 576px) {
  .gallery-hero {
    padding: 3rem 0;
  }

  .gallery-hero h1 {
    font-size: 1.8rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    min-height: calc(100vh - 1rem);
  }

  .modal-body img {
    max-height: 65vh;
    border-radius: 5px;
  }

  .modal-header {
    top: 5px;
    right: 5px;
  }

  .modal-header .btn-close {
    width: 35px;
    height: 35px;
  }

  .modal-header .btn-close span {
    font-size: 24px;
  }

  .modal-footer {
    bottom: 5px;
    padding: 0.75rem;
    gap: 0.5rem;
    flex-direction: row;
    width: calc(100% - 1rem);
  }

  .modal-footer .modal-nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    flex: 1;
  }
}

/* ============================================
   LOADING STATE
   ============================================ */
.gallery-item.loading {
  background: var(--light-bg);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
