/* Layout shift optimizations */

/* Prevent layout shifts for hero sections */
.hero-section {
  min-height: 500px;
  aspect-ratio: 16/9;
  max-height: 80vh;
  contain: layout paint;
  content-visibility: auto;
}

/* Add aspect ratios to image containers */
.image-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
}

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

/* Before/after comparison container */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

/* Make sure all images have explicit dimensions */
img {
  max-width: 100%;
  height: auto;
}

/* Add preload for web fonts */
@media (max-width: 768px) {
  .hero-section {
    min-height: 400px;
  }
}

/* Optimize animations for performance */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
