/* ========================================
   MOBILE OPTIMIZATIONS CSS
   Enhanced Investment Management Limited
   ======================================== */

/* Mobile-first optimized header */
.header-top {
    padding: 8px 0 !important;
}

.header-bottom {
    padding: 10px 0 !important;
    min-height: 60px !important;
}

/* Mobile header contact info - hide on mobile to reduce overflow */
@media screen and (max-width: 991px) {
    .header-top {
        display: none !important;
    }
    
    .header-bottom {
        padding: 8px 0 !important;
        min-height: 50px !important;
    }
    
    .logo img {
        max-height: 40px !important;
        width: auto !important;
        height: auto !important;
        max-width: 150px !important;
        object-fit: contain !important;
    }
    
    .button-menu {
        font-size: 18px !important;
        padding: 8px !important;
    }
}

/* Ultra-small mobile optimization */
@media screen and (max-width: 480px) {
    .header-bottom {
        padding: 5px 0 !important;
        min-height: 45px !important;
    }
    
    .logo img {
        max-height: 35px !important;
        width: auto !important;
        height: auto !important;
        max-width: 120px !important;
        object-fit: contain !important;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* CRITICAL: Ultra-mobile title positioning fixes */
    .inner-pages .headings {
        height: 25vh !important;
        margin-bottom: 2.5rem !important;
    }
    
    .inner-pages .headings h1 {
        margin-top: 6rem !important;
        font-size: 1.5rem !important;
    }
    
    .who-we-are,
    .service-layout,
    section.who-we-are {
        margin-top: 4rem !important;
        padding-top: 3rem !important;
    }
}

/* Tablet optimization for title positioning */
@media screen and (max-width: 768px) and (min-width: 481px) {
    .inner-pages .headings {
        height: 32vh !important;
        margin-bottom: 2.2rem !important;
    }
    
    .inner-pages .headings h1 {
        margin-top: 7rem !important;
        font-size: 1.7rem !important;
    }
    
    .who-we-are,
    .service-layout,
    section.who-we-are {
        margin-top: 3.5rem !important;
        padding-top: 2.5rem !important;
    }
}

/* Mobile header container flex layout */
.mobile-header-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.mobile-logo {
    flex-shrink: 0 !important;
}

.mobile-menu-btn {
    flex-shrink: 0 !important;
}

/* Mobile responsive page headings - CRITICAL FIX FOR TITLE OVERLAP */
@media screen and (max-width: 991px) {
    /* Service page headings optimization - reduced height and proper spacing */
    .service-heading,
    .portfolio-management-heading,
    .global-equities-heading,
    .private-equity-heading,
    .secondary-markets-heading,
    .asset-diversification-heading,
    .ipo-heading,
    .executive-heading,
    .about-heading,
    .values-heading,
    .approach-heading,
    .mission-heading,
    .why-enhanced-heading,
    .contact-heading,
    .careers-heading,
    .corporate-heading,
    .environmental-heading,
    .conduct-heading,
    .privacy-heading,
    .terms-heading {
        height: 30vh !important;
        margin-top: 50px !important;
        margin-bottom: 2rem !important;
    }
    
    /* CRITICAL: Fix for page title positioning to prevent content overlap */
    .inner-pages .headings {
        height: 30vh !important;
        margin-bottom: 2rem !important;
    }
    
    /* Page heading text optimization - CRITICAL FIX FOR TITLE OVERLAP */
    body.inner-pages .service-heading h1,
    body.inner-pages .portfolio-management-heading h1,
    body.inner-pages .global-equities-heading h1,
    body.inner-pages .private-equity-heading h1,
    body.inner-pages .secondary-markets-heading h1,
    body.inner-pages .asset-diversification-heading h1,
    body.inner-pages .ipo-heading h1,
    body.inner-pages .executive-heading h1,
    body.inner-pages .about-heading h1,
    body.inner-pages .values-heading h1,
    body.inner-pages .approach-heading h1,
    body.inner-pages .mission-heading h1,
    body.inner-pages .why-enhanced-heading h1,
    body.inner-pages .contact-heading h1,
    body.inner-pages .careers-heading h1,
    body.inner-pages .corporate-heading h1,
    body.inner-pages .environmental-heading h1,
    body.inner-pages .conduct-heading h1,
    body.inner-pages .privacy-heading h1,
    body.inner-pages .terms-heading h1,
    .inner-pages .service-heading h1,
    .inner-pages .portfolio-management-heading h1,
    .inner-pages .global-equities-heading h1,
    .inner-pages .private-equity-heading h1,
    .inner-pages .secondary-markets-heading h1,
    .inner-pages .asset-diversification-heading h1,
    .inner-pages .ipo-heading h1,
    .inner-pages .executive-heading h1,
    .inner-pages .about-heading h1,
    .inner-pages .values-heading h1,
    .inner-pages .approach-heading h1,
    .inner-pages .mission-heading h1,
    .inner-pages .why-enhanced-heading h1,
    .inner-pages .contact-heading h1,
    .inner-pages .careers-heading h1,
    .inner-pages .corporate-heading h1,
    .inner-pages .environmental-heading h1,
    .inner-pages .conduct-heading h1,
    .inner-pages .privacy-heading h1,
    .inner-pages .terms-heading h1 {
        margin-top: 8rem !important;
        margin-bottom: 1rem !important;
        font-size: 1.8rem !important;
    }
    
    /* CRITICAL: Fix for h1 positioning within heading sections */
    .inner-pages .headings h1 {
        margin-top: 8rem !important;
        margin-bottom: 1rem !important;
        font-size: 1.8rem !important;
        color: #fff !important;
    }
    
    /* CRITICAL: Content section spacing to prevent overlap with titles */
    .who-we-are,
    .service-layout,
    section.who-we-are,
    .content-section,
    .main-content {
        margin-top: 3rem !important;
        padding-top: 2rem !important;
    }
    
    /* Card and content optimization */
    .executive-card,
    .service-card,
    .values-card,
    .approach-card {
        padding: 1.5rem !important;
    }
    
    .intro-content h2,
    .section-heading h2 {
        font-size: 1.8rem !important;
    }
    
    .cta-content h3 {
        font-size: 1.6rem !important;
    }
}

@media screen and (max-width: 768px) {
    /* Service page headings optimization */
    .service-heading,
    .portfolio-management-heading,
    .global-equities-heading,
    .private-equity-heading,
    .secondary-markets-heading,
    .asset-diversification-heading,
    .ipo-heading,
    .executive-heading,
    .about-heading,
    .values-heading,
    .approach-heading,
    .mission-heading,
    .why-enhanced-heading,
    .contact-heading,
    .careers-heading,
    .corporate-heading,
    .environmental-heading,
    .conduct-heading,
    .privacy-heading,
    .terms-heading {
        height: 30vh !important;
        margin-top: 45px !important;
    }
    
    /* Page heading text optimization */
    body.inner-pages .service-heading h1,
    body.inner-pages .portfolio-management-heading h1,
    body.inner-pages .global-equities-heading h1,
    body.inner-pages .private-equity-heading h1,
    body.inner-pages .secondary-markets-heading h1,
    body.inner-pages .asset-diversification-heading h1,
    body.inner-pages .ipo-heading h1,
    body.inner-pages .executive-heading h1,
    body.inner-pages .about-heading h1,
    body.inner-pages .values-heading h1,
    body.inner-pages .approach-heading h1,
    body.inner-pages .mission-heading h1,
    body.inner-pages .why-enhanced-heading h1,
    body.inner-pages .contact-heading h1,
    body.inner-pages .careers-heading h1,
    body.inner-pages .corporate-heading h1,
    body.inner-pages .environmental-heading h1,
    body.inner-pages .conduct-heading h1,
    body.inner-pages .privacy-heading h1,
    body.inner-pages .terms-heading h1,
    .inner-pages .service-heading h1,
    .inner-pages .portfolio-management-heading h1,
    .inner-pages .global-equities-heading h1,
    .inner-pages .private-equity-heading h1,
    .inner-pages .secondary-markets-heading h1,
    .inner-pages .asset-diversification-heading h1,
    .inner-pages .ipo-heading h1,
    .inner-pages .executive-heading h1,
    .inner-pages .about-heading h1,
    .inner-pages .values-heading h1,
    .inner-pages .approach-heading h1,
    .inner-pages .mission-heading h1,
    .inner-pages .why-enhanced-heading h1,
    .inner-pages .contact-heading h1,
    .inner-pages .careers-heading h1,
    .inner-pages .corporate-heading h1,
    .inner-pages .environmental-heading h1,
    .inner-pages .conduct-heading h1,
    .inner-pages .privacy-heading h1,
    .inner-pages .terms-heading h1 {
        margin-top: 3rem !important;
        font-size: 1.6rem !important;
    }
}

@media screen and (max-width: 480px) {
    /* Service page headings optimization */
    .service-heading,
    .portfolio-management-heading,
    .global-equities-heading,
    .private-equity-heading,
    .secondary-markets-heading,
    .asset-diversification-heading,
    .ipo-heading,
    .executive-heading,
    .about-heading,
    .values-heading,
    .approach-heading,
    .mission-heading,
    .why-enhanced-heading,
    .contact-heading,
    .careers-heading,
    .corporate-heading,
    .environmental-heading,
    .conduct-heading,
    .privacy-heading,
    .terms-heading {
        height: 25vh !important;
        margin-top: 40px !important;
    }
    
    /* Page heading text optimization */
    body.inner-pages .service-heading h1,
    body.inner-pages .portfolio-management-heading h1,
    body.inner-pages .global-equities-heading h1,
    body.inner-pages .private-equity-heading h1,
    body.inner-pages .secondary-markets-heading h1,
    body.inner-pages .asset-diversification-heading h1,
    body.inner-pages .ipo-heading h1,
    body.inner-pages .executive-heading h1,
    body.inner-pages .about-heading h1,
    body.inner-pages .values-heading h1,
    body.inner-pages .approach-heading h1,
    body.inner-pages .mission-heading h1,
    body.inner-pages .why-enhanced-heading h1,
    body.inner-pages .contact-heading h1,
    body.inner-pages .careers-heading h1,
    body.inner-pages .corporate-heading h1,
    body.inner-pages .environmental-heading h1,
    body.inner-pages .conduct-heading h1,
    body.inner-pages .privacy-heading h1,
    body.inner-pages .terms-heading h1,
    .inner-pages .service-heading h1,
    .inner-pages .portfolio-management-heading h1,
    .inner-pages .global-equities-heading h1,
    .inner-pages .private-equity-heading h1,
    .inner-pages .secondary-markets-heading h1,
    .inner-pages .asset-diversification-heading h1,
    .inner-pages .ipo-heading h1,
    .inner-pages .executive-heading h1,
    .inner-pages .about-heading h1,
    .inner-pages .values-heading h1,
    .inner-pages .approach-heading h1,
    .inner-pages .mission-heading h1,
    .inner-pages .why-enhanced-heading h1,
    .inner-pages .contact-heading h1,
    .inner-pages .careers-heading h1,
    .inner-pages .corporate-heading h1,
    .inner-pages .environmental-heading h1,
    .inner-pages .conduct-heading h1,
    .inner-pages .privacy-heading h1,
    .inner-pages .terms-heading h1 {
        margin-top: 2rem !important;
        font-size: 1.4rem !important;
    }
}

/* Image lazy loading optimization */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-loaded="true"] {
    opacity: 1;
}

/* Performance optimizations */
.preload-fonts {
    font-display: swap;
}

/* Mobile menu styling */
#main-menu ul li.hidden-lg-up a {
    color: #000 !important;
}

#main-menu ul li.hidden-lg-up a:hover {
    color: #000 !important;
    background: transparent !important;
}

#main-menu .collapse .card.card-block a.dropdown-item {
    color: #000 !important;
}

#main-menu .collapse .card.card-block a.dropdown-item:hover {
    color: #000 !important;
    background: transparent !important;
}

/* Sticky mode overrides for mobile */
.sticky #main-menu ul li.hidden-lg-up a {
    color: #000 !important;
}

.sticky #main-menu .collapse .card.card-block a.dropdown-item {
    color: #000 !important;
}

.sticky #main-menu .collapse .card.card-block a.dropdown-item:hover {
    color: #000 !important;
    background: transparent !important;
}