/* Image Optimization & Lazy Loading */

/* Hero Section Background - Lazy Loading Support */
.hero-bg {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

/* Images with aspect ratio */
img[loading="lazy"] {
  animation: fade-in 0.4s ease-in-out;
}

img[loading="lazy"][src] {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%, transparent);
  background-size: 20px 20px;
  background-position: 0 0;
  background-color: #f5f5f5;
}

@keyframes fade-in {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Images */
.img-fluid {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Team Member Images */
.member-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  aspect-ratio: 1/1;
}

/* Testimonial Images */
.testimonial-img-premium {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  aspect-ratio: 1/1;
}

/* FAQ Image */
.faq-img-wrapper img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Gallery Images */
.gallery-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  aspect-ratio: 1/1;
}

/* Prevent Layout Shift */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Media Queries for Responsive Images */
@media (max-width: 768px) {
  .hero-bg {
    object-position: center center;
  }
  
  img[loading="lazy"] {
    width: 100%;
    height: auto;
  }
}

/* Prefers Reduced Data */
@media (prefers-reduced-data: reduce) {
  img[loading="lazy"],
  .hero-bg {
    background-image: none !important;
  }
}

/* Print Optimization */
@media print {
  img {
    display: block;
  }
}
