/* Below-the-fold rendering optimizations */

/* Stable layout: reserve space before async CSS / fonts load */
.navbar {
    min-height: 72px;
}

.navbar-brand .brand-logo {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 70px;
    aspect-ratio: 200 / 70;
    object-fit: contain;
}

.hero-image {
    aspect-ratio: 5 / 4;
    min-height: 240px;
}

.hero-image img,
.hero-image video,
.hero-video-mobile-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-primary,
.btn-outline-primary {
    min-height: 44px;
}

.section-header {
    min-height: 120px;
}

.partner-logo {
    width: 150px;
    height: 80px;
    object-fit: contain;
}

/* Use system fonts first; web fonts are optional (display=optional) */
body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[lang="ar"] body,
body.arabic-content {
    font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

/* Critical above-the-fold hero styles (home.css loads async) */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #2C3E50 0%, #1A252F 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    color: #fff;
    line-height: 1.25;
}

.hero p,
.hero .lead {
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
}

.hero-video-mobile-placeholder {
    width: 100%;
    aspect-ratio: 5 / 4;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.achievement-item h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #fff;
}

.achievement-item p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .hero {
        padding: 100px 15px 40px;
    }

    .hero-badge,
    .hero h1,
    .hero p {
        text-align: center;
    }

    .hero-badge {
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .achievement-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .floating-shape,
    .hero-bg-pattern {
        display: none !important;
    }

    .hero::before {
        animation: none !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%) !important;
    }

    .global-bg {
        background-image: none !important;
    }

    .our-partners-hero__overlay {
        animation: none !important;
        opacity: 0.12 !important;
    }
}

/* content-visibility removed — caused CLS when sections painted */

.hero-copy {
    content-visibility: visible;
}

.hero-image img,
.hero-image video {
    border-radius: 20px;
}

.our-partners-hero__banner-card img {
    height: auto;
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .hero::before,
    .our-partners-hero__overlay,
    .global-bg {
        animation: none !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
