/* ==========================================================================
   ESTILOS PARA IMÁGENES PÚBLICAS - EXPOSICIÓN FOTOGRÁFICA
   ========================================================================== */

/* Hero Images */
.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px var(--shadow-strong);
}

.hero-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Gallery Images */
.gallery-thumb {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--brown-light);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-thumb:hover {
  border-color: var(--brown-primary);
  transform: translateY(-4px);
  box-shadow: 0 6px 12px var(--shadow-medium);
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 2px 4px var(--shadow-light);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  color: var(--white);
  text-align: left;
}

.gallery-info h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.gallery-info p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Background Images */
.bg-texture {
  background-repeat: repeat;
  background-size: auto;
}

.bg-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-contain {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Image Loading States */
.image-loading {
  background: linear-gradient(
    90deg,
    var(--beige-light) 25%,
    var(--beige-medium) 50%,
    var(--beige-light) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.image-error {
  background-color: var(--beige-light);
  border: 2px dashed var(--brown-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-dark);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}

.image-error::before {
  content: "📷";
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Responsive Images */
.img-responsive {
  max-width: 100%;
  height: auto;
}

/* Lazy Loading */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Image Carousel/Slider */
.image-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-slide {
  display: none;
  position: relative;
}

.carousel-slide.active {
  display: block;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: none;
  padding: 1rem;
  cursor: pointer;
  border-radius: 50%;
  font-size: 1.2rem;
  transition: background 0.3s ease;
}

.carousel-controls:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
  left: 1rem;
}

.carousel-next {
  right: 1rem;
}

.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-dot.active,
.carousel-dot:hover {
  background: var(--white);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
  }

  .gallery-thumb {
    height: 200px;
  }

  .hero-image {
    border-radius: 4px;
  }

  .carousel-controls {
    padding: 0.75rem;
    font-size: 1rem;
  }

  .carousel-prev {
    left: 0.5rem;
  }

  .carousel-next {
    right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-container {
    grid-template-columns: 1fr;
  }

  .gallery-thumb {
    height: 180px;
  }

  .bg-cover {
    background-attachment: scroll; /* Fixed backgrounds can be problematic on mobile */
  }
}
