/* ═══════════════════════════════════════════════════════════════════════════
   Performance Optimizations
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font smoothing */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent layout shifts from unloaded images */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* GPU acceleration for animated elements */
.owl-carousel, .hero-slider {
    will-change: transform;
}

.preloader {
    will-change: opacity;
}

/* Remove tap highlight on interactive elements (mobile perf) */
button, a, .nav-link {
    -webkit-tap-highlight-color: transparent;
}

/* Lazy Loading placeholder fade-in */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-src].loaded {
    opacity: 1;
}

/* Critical layout containment for header */
.header-area, .navbar-area {
    contain: layout style;
}

/* GPU-composited layers for card animations (prevents repaints) */
.service-card, .attorney-card, .testimonials-slider-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ── content-visibility: skip rendering off-screen sections ─────────────── */
/* This is one of the highest-impact CSS performance properties available.
   Browsers skip layout/paint of off-screen sections until they scroll near. */
.service-area,
.choose-area,
.fun-facts-area,
.testimonials-area,
.right-way-area,
.partner-area,
.gallery-area,
.about-video-area {
    content-visibility: auto;
    /* contain-intrinsic-size gives the browser an estimated height so scroll
       position doesn't jump when content is rendered */
    contain-intrinsic-size: 0 600px;
}

/* ── Reduce motion for accessibility / battery saving ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Font Display Optimization (fonts load without blocking render) */
@font-face {
    font-display: swap;
}
