/**
 * SEO Optimized CSS - Critical performance styles
 * Content.ma - UGC Morocco Agency
 */

/* =============================================
   CRITICAL: Above-the-fold styles
   ============================================= */

/* Lazy loading image transitions */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Core Web Vitals: Prevent layout shifts */
img, video {
    max-width: 100%;
    height: auto;
}

/* Prevent FOUT (Flash of Unstyled Text) */
.fonts-loading body {
    visibility: hidden;
}

.fonts-loaded body {
    visibility: visible;
}

/* =============================================
   PERFORMANCE: Reduce repaints
   ============================================= */

/* Use transform instead of position for animations */
.animate-slide {
    will-change: transform;
    transform: translateZ(0);
}

/* Contain paint for heavy components */
.tt-video-card,
.tt-profile-wrapper,
.gig-card {
    contain: content;
}

/* =============================================
   SEO: Accessibility & Readability
   ============================================= */

/* Ensure readable text contrast */
.text-content {
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Focus styles for accessibility (SEO signal) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary, #6366f1);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* =============================================
   MOBILE PERFORMANCE
   ============================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch targets for mobile (min 44x44px for SEO) */
@media (max-width: 768px) {
    a, button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* =============================================
   PRINT STYLES (for SEO crawlers)
   ============================================= */

@media print {
    .no-print,
    header nav,
    footer,
    .mobile-bottom-nav {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* =============================================
   DARK MODE PERFORMANCE
   ============================================= */

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* =============================================
   CONTENT VISIBILITY (Performance)
   ============================================= */

/* Defer rendering of off-screen content */
.defer-render {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Footer optimization */
footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 300px;
}
