/* Header image optimization and caching improvements */

/* Preload critical header images via CSS */
.header-preload::before {
  content: '';
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  background-image: 
    url('/optimized/cover_index_1920.webp'),
    url('/optimized/cover_about_1920.webp'),
    url('/optimized/cover_soitossa_1920.webp'),
    url('/optimized/cover_posts_1920.webp'),
    url('/optimized/cover_yhteystiedot_1920.webp');
}

/* Optimize hero background transitions */
.icetribe-hero.cover {
  transition: background-image 0.3s ease-in-out;
  background-size: cover;
  background-position: center;
  will-change: background-image;
}

/* Preload hover states for navigation */
.menu a:hover {
  transform: translateZ(0); /* Force GPU acceleration */
}

/* Image loading optimization */
img[loading="eager"] {
  content-visibility: visible;
}

/* Responsive header image sizes for different viewports */
@media (max-width: 768px) {
  .icetribe-hero.cover {
    background-size: cover;
    background-position: center 20%; /* Better mobile positioning */
  }
}

@media (min-width: 1200px) {
  .icetribe-hero.cover {
    background-attachment: scroll;
  }
}

/* Prefetch next likely navigation targets */
.nav-prefetch {
  display: none;
}

.nav-prefetch::after {
  content: url('/optimized/cover_about_1920.webp') url('/optimized/cover_soitossa_1920.webp');
  position: absolute;
  left: -9999px;
  top: -9999px;
}
