/**
 * Unsplash Images Enhancement Styles
 * Additional styles for Unsplash image integration on Dirty Paws website
 */

/* Image animations and transitions */
.product-item img, 
.blog-post img, 
.testimonial img,
.gallery-item img {
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.blog-post:hover img {
  filter: brightness(1.1);
}

.testimonial:hover img {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Enhanced blur-up lazy loading animation */
img.lazy-loading {
  filter: blur(8px);
  transition: filter 0.4s ease;
  opacity: 0.8;
}

img.lazy-loaded {
  filter: blur(0);
  opacity: 1;
  animation: fadeInImage 0.5s ease forwards;
}

@keyframes fadeInImage {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

/* Image captions with improved styling */
.image-caption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  line-height: 1.3;
  font-style: italic;
}

/* Enhanced image gallery */
.image-gallery {
  margin: 40px 0;
  padding: 40px 0;
  background: linear-gradient(to bottom, #fff, #f8f9fa);
}

.image-gallery .gallery-item {
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 10px;
}

.image-gallery .gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.image-gallery .gallery-item img {
  transition: transform 0.5s ease;
}

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

/* Hero section enhanced overlay */
.hero-section,
.main-banner,
.hero {
  position: relative;
  overflow: hidden;
}

.hero-section::after,
.main-banner::after,
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  z-index: 2;
  position: relative;
}

/* Product images with enhanced hover effects */
.product-item .product-image-container {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  position: relative;
}

.product-item .product-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 20%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-item:hover .product-image-container::after {
  opacity: 1;
}

/* Blog post featured images with enhanced styling */
.blog-post .featured-image {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}

.blog-post:hover .featured-image {
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.blog-post .featured-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.blog-post:hover .featured-image img {
  transform: scale(1.03);
}

/* Testimonial images with better styling */
.testimonial-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial:hover .testimonial-img {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Image attribution with better positioning */
.image-attribution {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  text-align: right;
  margin-top: 5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 2;
}

/* Loading placeholder animation */
.image-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: placeholderShimmer 1.5s infinite;
}

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

/* Gallery improvements */
.gallery-caption {
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
  padding: 12px 15px;
  font-weight: 500;
}

/* Enhanced dark mode support */
@media (prefers-color-scheme: dark) {
  .image-gallery {
    background: linear-gradient(to bottom, #292929, #333);
  }
  
  .image-gallery h2 {
    color: #b8e2d5;
  }
  
  .image-gallery p {
    color: #ccc;
  }
  
  .gallery-caption {
    background: linear-gradient(to top, rgba(40,40,40,0.95) 0%, rgba(40,40,40,0.85) 100%);
    color: #eee;
  }
  
  .testimonial-img {
    border-color: #444;
  }
  
  .product-item .product-image-container {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  }
  
  .image-placeholder {
    background: linear-gradient(90deg, #333 25%, #3a3a3a 50%, #333 75%);
  }
}

/* Responsive image adjustments with enhanced mobile view */
@media (max-width: 768px) {
  .image-gallery .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 0 15px;
  }
  
  .testimonial-img {
    width: 60px;
    height: 60px;
  }
  
  .product-item .product-image-container {
    border-radius: 6px;
  }
  
  .blog-post .featured-image {
    margin-bottom: 15px;
  }
  
  .hero-section::after,
  .main-banner::after,
  .hero::after {
    background: linear-gradient(135deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);
  }
}

@media (max-width: 480px) {
  .image-gallery .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 10px;
  }
  
  .image-gallery .gallery-item img {
    height: 180px;
  }
  
  .gallery-caption {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  
  .testimonial-img {
    width: 50px;
    height: 50px;
    border-width: 2px;
  }
  
  .hero-section::after,
  .main-banner::after,
  .hero::after {
    background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  }
  
  .image-attribution {
    font-size: 8px;
    bottom: 5px;
    right: 7px;
  }
}

/* Print media optimization */
@media print {
  .image-gallery {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .gallery-grid {
    display: block;
  }
  
  .gallery-item {
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 33%;
    margin-bottom: 20px;
  }
  
  .hero-section::after,
  .main-banner::after,
  .hero::after {
    display: none;
  }
}
