/** Galeria de fotos */

header.gallery-hero {
  position: relative;
  padding: 140px 20px 80px;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(161, 64, 214, 0.12), transparent 45%), radial-gradient(circle at bottom left, rgba(51, 153, 255, 0.12), transparent 40%);
  margin-top: 0;
  text-align: center;
}

.gallery-hero-content {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  z-index: 1;
}

.gallery-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  margin: 0;
  color: var(--text-primary);
}

.gallery-hero p {
  margin: 20px auto 0;
  max-width: 700px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.gallery-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

main {
  padding: 60px 20px 80px;
  position: relative;
}

.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.gallery-grid.loading {
  opacity: 0.3;
  pointer-events: none;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(161, 64, 214, 0.1), rgba(51, 153, 255, 0.1));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  min-height: 200px;
}

.gallery-item.loading {
  background: linear-gradient(90deg, rgba(161, 64, 214, 0.1) 0%, rgba(161, 64, 214, 0.2) 50%, rgba(161, 64, 214, 0.1) 100%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.gallery-item img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item img.loaded {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(161, 64, 214, 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-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item-number {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.gallery-item:hover .gallery-item-number {
  opacity: 1;
}

.loading-spinner {
  display: none;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading-spinner.active {
  display: block;
}

.loading-spinner i {
  font-size: 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.gallery-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 25px;
  padding: 0 10px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #a140d6 0%, #8b2fc4 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(161, 64, 214, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-download:hover::before {
  left: 100%;
}

.btn-download:hover {
  background: linear-gradient(135deg, #b855e8 0%, #a140d6 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(161, 64, 214, 0.35);
}

.btn-download:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(161, 64, 214, 0.25);
}

.btn-download svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.btn-download:hover svg {
  transform: translateY(2px) scale(1.05);
}

.btn-download span {
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.gallery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 10px 20px;
  border: 2px solid rgba(161, 64, 214, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(161, 64, 214, 0.1);
  border-color: rgba(161, 64, 214, 0.5);
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0 10px;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.lightbox-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(161, 64, 214, 0.8);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100000;
}

.lightbox-nav:hover {
  background: rgba(161, 64, 214, 0.8);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  z-index: 100000;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .gallery-hero {
    padding: 120px 16px 60px;
  }

  .gallery-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .gallery-header-actions {
    justify-content: center;
    margin-bottom: 20px;
    padding: 0;
  }

  .btn-download {
    padding: 10px 16px;
    font-size: 0.8rem;
    gap: 8px;
  }

  .btn-download svg {
    width: 16px;
    height: 16px;
  }

  .btn-download span {
    font-size: 0.8rem;
  }

  .pagination-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .lightbox-close,
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }
}
