/* Vista Arenal Adventure Park - Optimized Image Styles */

/* Base image optimization */
.img-optimized {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: opacity 0.3s ease-in-out;
}

/* Responsive picture elements */
.img-responsive {
  display: block;
  width: 100%;
  line-height: 0; /* Prevents spacing issues */
}

.img-responsive img {
  width: 100%;
  height: auto;
  display: block;
}

/* Category-specific styles */
.img-hero {
  min-height: 60vh;
  object-position: center center;
}

.img-adventure {
  aspect-ratio: 3/2;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-adventure:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.img-people {
  aspect-ratio: 4/5;
  border-radius: 50%;
  object-fit: cover;
}

.img-social {
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
}

.img-branding {
  width: auto;
  height: 60px;
  object-fit: contain;
}

.img-branding-footer {
  width: auto;
  object-fit: contain;
}

/* Loading states */
.img-loading {
  background: linear-gradient(90deg, var(--warm-sand) 25%, transparent 50%, var(--warm-sand) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  min-height: 200px;
}

.img-error {
  background: rgba(244, 67, 54, 0.1);
  border: 2px dashed rgba(244, 67, 54, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--volcano-gray);
}

.img-error::before {
  content: "📷 Adventure image unavailable";
  font-size: 1rem;
  opacity: 0.7;
}

/* Lazy loading animations */
.img-lazy {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.img-lazy.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Aspect ratio containers for CLS prevention */
.aspect-ratio-hero {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}

.aspect-ratio-adventure {
  aspect-ratio: 3/2;
  position: relative;
  overflow: hidden;
}

.aspect-ratio-portrait {
  aspect-ratio: 4/5;
  position: relative;
  overflow: hidden;
}

.aspect-ratio-square {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
}

.aspect-ratio-container img,
.aspect-ratio-container picture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .img-branding {
    height: 45px;
  }
  
  .img-hero {
    min-height: 50vh;
  }
  
  .img-adventure {
    aspect-ratio: 4/3;
  }
}

/* Loading animation keyframes */
@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Focus and accessibility */
.img-optimized:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .img-optimized {
    break-inside: avoid;
    max-width: 100%;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .img-lazy {
    transition: none;
  }
  
  .img-adventure {
    transition: none;
  }
  
  .img-adventure:hover {
    transform: none;
  }
}
