/* Ottimizzazioni Performance e Core Web Vitals */

/* Prevenzione layout shift */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    min-height: 200px;
    background: linear-gradient(135deg, #f4ede4 0%, #e8dcc6 100%);
}

/* Ottimizzazione font loading */
@font-face {
    font-display: swap;
}

/* Riduzione repaint/reflow */
* {
    will-change: auto;
}

.hero, .section {
    contain: layout style paint;
}

/* Smooth scrolling ottimizzato */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ottimizzazione animazioni */
@media (hover: hover) and (pointer: fine) {
    .card:hover,
    .tarocco-card:hover {
        transform: translateY(-5px);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

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

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

/* Ottimizzazione rendering testo */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    text-rendering: optimizeLegibility;
}

/* Contenimento GPU acceleration */
.header {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Ottimizzazione immagini */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Riduzione complessità CSS */
.hidden-element {
    opacity: 0;
    transform: translateY(20px);
}

.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Performance mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .parallax-disabled {
        transform: none !important;
    }
}
/* cache-bust 1763111670 */
