/* ===================================
   SEÇÃO DE GALERIA
   =================================== */

.gallery-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  position: relative;
}

/* Cabeçalho da Seção */
.gallery-section .section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.gallery-section .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
  padding-bottom: 16px;
}

/* LINHA DE ANIMAÇÃO */
.gallery-section .section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 4px;
  background-color: var(--color-primary);
  transition: all 0.6s ease;
}

.gallery-section .section-title.title-visible::after {
  animation: underlineGrow 0.8s ease-out 0.3s both;
}

.gallery-section .section-subtitle {
  font-size: 1.125rem;
  color: var(--color-gray);
  line-height: 1.6;
}

/* Grid de Galeria */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

/* Item da Galeria */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Imagem */
.gallery-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-image img {
  transform: scale(1.15);
}

/* Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Conteúdo do Overlay */
.gallery-content {
  padding: 24px;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-content {
  transform: translateY(0);
}

.gallery-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 8px;
}

.gallery-description {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Botão Ver Imagem */
.gallery-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-btn:hover {
  background-color: var(--color-primary-dark);
  transform: translateX(4px);
}

.gallery-btn i {
  font-size: 0.875rem;
}

/* CTA Ver Galeria Completa */
.gallery-cta {
  text-align: center;
}

.gallery-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 40px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.gallery-cta .btn:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.gallery-cta .btn i {
  font-size: 1.125rem;
}

/* ===================================
   LIGHTBOX MODAL
   =================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

/* Overlay do Lightbox */
.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

/* Conteúdo do Lightbox */
.lightbox-content {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Botão Fechar */
.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  transition: all 0.3s ease;
  z-index: 3;
}

.lightbox-close:hover {
  color: var(--color-primary);
  transform: rotate(90deg);
}

/* Container da Imagem */
.lightbox-image-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Informações da Imagem */
.lightbox-info {
  margin-top: 20px;
  text-align: center;
  color: var(--color-white);
  max-width: 600px;
}

.lightbox-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.lightbox-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
}

.lightbox-counter {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Navegação do Lightbox */
.lightbox-nav {
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  font-size: 2rem;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.lightbox-nav:active {
  transform: scale(0.95);
}

.lightbox-prev {
  margin-right: 20px;
}

.lightbox-next {
  margin-left: 20px;
}

/* Animação de entrada */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox.active .lightbox-image {
  animation: lightboxFadeIn 0.3s ease;
}

/* ===================================
   RESPONSIVIDADE
   =================================== */

/* Tablets */
@media (max-width: 992px) {
  .gallery-section {
    padding: 60px 0;
  }

  .gallery-section .section-title {
    font-size: 2rem;
  }

  .gallery-section .section-subtitle {
    font-size: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }

  .gallery-content {
    padding: 20px;
  }

  .gallery-title {
    font-size: 1.125rem;
  }

  .gallery-description {
    font-size: 0.875rem;
  }

  /* Lightbox Tablet */
  .lightbox-content {
    width: 95%;
    gap: 15px;
  }

  .lightbox-image {
    max-height: 60vh;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 15px 12px;
  }

  .lightbox-title {
    font-size: 1.25rem;
  }

  .lightbox-description {
    font-size: 0.9375rem;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .gallery-section {
    padding: 50px 0;
  }

  .gallery-section .section-header {
    margin-bottom: 40px;
  }

  .gallery-section .section-title {
    font-size: 1.75rem;
    padding-bottom: 12px;
  }

  .gallery-section .section-subtitle {
    font-size: 0.9375rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
  }

  .gallery-item {
    aspect-ratio: 16/10;
  }

  .gallery-content {
    padding: 16px;
  }

  .gallery-title {
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .gallery-description {
    font-size: 0.8125rem;
    margin-bottom: 12px;
  }

  .gallery-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }

  .gallery-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 32px;
    font-size: 0.9375rem;
  }

  /* Lightbox Mobile */
  .lightbox-content {
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0 15px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 1.75rem;
  }

  .lightbox-image {
    max-height: 50vh;
  }

  .lightbox-info {
    margin-top: 15px;
  }

  .lightbox-title {
    font-size: 1.125rem;
  }

  .lightbox-description {
    font-size: 0.875rem;
  }

  .lightbox-counter {
    font-size: 0.875rem;
  }

  .lightbox-nav {
    position: absolute;
    bottom: 50%;
    transform: translateY(50%);
    font-size: 1.25rem;
    padding: 12px 10px;
  }

  .lightbox-prev {
    left: 10px;
    margin-right: 0;
  }

  .lightbox-next {
    right: 10px;
    margin-left: 0;
  }
}

/* Mobile Pequeno */
@media (max-width: 375px) {
  .gallery-section .section-title {
    font-size: 1.5rem;
  }

  .gallery-item {
    aspect-ratio: 4/3;
  }

  .lightbox-image {
    max-height: 40vh;
  }

  .lightbox-nav {
    font-size: 1rem;
    padding: 10px 8px;
  }
}
