/* =================================================================
   OTTIMIZZAZIONI AVANZATE CARICAMENTO IMMAGINI
   CSS per placeholder, lazy loading e transizioni smooth
   ================================================================= */

/* Placeholder per immagini in caricamento */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

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

/* Transizioni smooth per immagini lazy-loaded */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Aspect ratio per evitare layout shift */
.founder-photo {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px; /* Card style invece di cerchio */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.founder-photo:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Logo responsive */
.logo-container img {
    max-width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

/* Ottimizzazioni per performance */
picture {
    display: block;
}

/* Blur iniziale per smooth loading */
.blur-load {
    filter: blur(5px);
    transition: filter 0.3s;
}

.blur-load.loaded {
    filter: blur(0);
}

/* Preload placeholder specifici */
.logo-placeholder {
    width: 400px;
    height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
}

.staff-placeholder {
    width: 300px;
    height: 300px;
    background: #f8f9fa;
    border-radius: 50%;
}

/* Media queries per responsive images */
@media (max-width: 768px) {
    .logo-container img {
        max-width: 200px;
    }
    
    .founder-photo {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .logo-container img {
        max-width: 150px;
    }
    
    .founder-photo {
        max-width: 200px;
    }
}

/* Ottimizzazione per browser che supportano avif/webp */
.webp .fallback-jpg,
.webp .fallback-png { 
    display: none; 
}

.no-webp .webp-image { 
    display: none; 
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.2) 20%, 
        rgba(255,255,255,0.5) 60%, 
        rgba(255,255,255,0));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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