/* ================================================
   OTIMIZAÇÕES DE PERFORMANCE FAEP
   ================================================ */

/* === CRITICAL CSS INLINING === */
/* Estilos críticos que devem ser carregados primeiro */
.critical-above-fold {
    contain: layout style paint;
    will-change: auto;
}

/* === LAZY LOADING OTIMIZADO === */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

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

/* === OTIMIZAÇÕES DE IMAGENS === */
.optimized-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* === PRELOAD HINTS === */
.preload-hint {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* === OTIMIZAÇÕES DE FONTES === */
@font-display: swap;

/* === LAZY SECTIONS === */
.lazy-section {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* === OTIMIZAÇÕES DE ANIMAÇÕES === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === GPU ACCELERATION === */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* === OTIMIZAÇÕES DO BANNER === */
.banner-swiper {
    contain: layout style paint;
    transform: translateZ(0);
}

.banner-swiper .swiper-slide {
    will-change: transform;
    backface-visibility: hidden;
}

.banner-swiper picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* === OTIMIZAÇÕES DE TEXTO === */
.optimized-text {
    text-rendering: optimizeSpeed;
    font-display: swap;
}

/* === CONTAINER QUERIES (FUTURO) === */
@container (min-width: 768px) {
    .responsive-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === INTERSECTION OBSERVER HELPER === */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === SCROLL SNAP === */
.scroll-snap-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.scroll-snap-item {
    scroll-snap-align: start;
}

/* === CRITICAL RESOURCE HINTS === */
.resource-hint {
    display: none;
}

/* === LAYOUT SHIFT PREVENTION === */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* === MICRO-OPTIMIZATIONS === */
.micro-opt {
    pointer-events: auto;
    touch-action: manipulation;
}

/* === REDUCE PAINT COMPLEXITY === */
.simple-paint {
    border-radius: 0;
    box-shadow: none;
    background-attachment: scroll;
}

/* === PERFORMANCE MONITORING === */
.perf-mark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
    .mobile-optimized {
        transform: none;
        animation: none;
        transition: none;
    }
    
    .banner-swiper {
        height: 70vh;
    }
    
    .heavy-animation {
        animation-play-state: paused;
    }
}

/* === PRINT OPTIMIZATIONS === */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-optimized {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
} 