/* Optimized Site-Wide Styles */

/* Preload fonts faster with font-display swap */
@font-face {
    font-display: swap;
}

body {
    font-display: swap;
}

/* Force font-display swap for all fonts */
* {
    font-display: swap !important;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Reduce repaints */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for transforms */
.transform,
.transition {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Intersection Observer placeholder */
.lazy-load {
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

.lazy-load.loaded {
    animation: none;
    background: none;
}

/* Critical CSS for above-the-fold content */
.hero-section {
    contain: layout style paint;
}

/* Desktop banner için aspect-ratio (Mobil hariç) */
@media (min-width: 768px) {
    .banner-image.desktop-banner {
        aspect-ratio: 16 / 9;
        width: 100%;
        height: auto;
    }
}

/* Mobil banner için özel ayar - aspect ratio YOK */
.mobile-banner {
    width: 100%;
    height: auto;
    display: block;
    /* aspect-ratio YOK - görselin doğal boyutunu korur */
}

/* LCP Optimization: Banner container için contain */
.banner-container {
    content-visibility: auto;
    contain: layout style paint;
}

/* Prevent layout shift for banner images */
.banner-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Critical images should decode async for faster rendering */
img[fetchpriority="high"] {
    content-visibility: auto;
    decoding: async;
}

/* Optimize banner rendering */
.banner-container {
    will-change: auto;
    transform: translateZ(0);
}

/* Prevent cumulative layout shift (CLS) */
.banner-image[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* Font Awesome icon optimization - prevent FOIT */
.fas, .far, .fab, .fa {
    font-display: swap;
}

/* Fallback font while custom fonts load */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Web font loaded state */
.fonts-loaded body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reduce font loading impact */
@supports (font-display: optional) {
    @font-face {
        font-display: optional;
    }
}