/**
 * About Page Mobile Fixes - COMPREHENSIVE OVERRIDE VERSION
 * Fixes hero title and story section display issues on mobile devices
 * This file MUST be loaded AFTER all other stylesheets
 * Uses maximum specificity to override ALL conflicting styles
 */

/* ===== MOBILE FIXES FOR ABOUT PAGE (max-width: 768px) ===== */
@media screen and (max-width: 768px) {

    /* ===== HERO SECTION FIXES ===== */
    /* Maximum specificity to override inline styles and other CSS files */
    body .hero-section,
    body section.hero-section {
        min-height: 450px !important;
        margin-top: 60px !important;
        padding: 80px 0 60px 0 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
    }

    body .hero-section .container,
    body section.hero-section .container {
        padding: 0 20px !important;
        max-width: 100% !important;
    }

    body .hero-section .hero-content,
    body section.hero-section .hero-content {
        padding: 20px !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* Hero Title - Make it readable and prominent on mobile */
    body .hero-section .hero-title,
    body section.hero-section .hero-title,
    body .hero-content .hero-title {
        font-size: 2.5em !important;
        line-height: 1.2 !important;
        letter-spacing: -1px !important;
        margin-bottom: 20px !important;
        padding: 0 10px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        opacity: 1 !important;
        transform: none !important;
        animation: fadeInUp 1s ease forwards !important;
    }

    /* Hero Subtitle - Ensure readability */
    body .hero-section .hero-subtitle,
    body section.hero-section .hero-subtitle,
    body .hero-content .hero-subtitle {
        font-size: 1.2em !important;
        line-height: 1.5 !important;
        max-width: 90% !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        opacity: 1 !important;
        transform: none !important;
        animation: fadeInUp 1s ease 0.2s forwards !important;
    }

    /* Ensure hero background animations don't cause overflow */
    body .hero-section .hero-background,
    body .hero-section .animated-gradient,
    body .hero-section .floating-shapes {
        overflow: hidden !important;
    }

    /* Re-enable animations for hero section (override global animation killer) */
    /* CRITICAL FIX: Use 'unset' instead of 'initial' to allow animations */
    body .hero-section *,
    body .hero-section *::before,
    body .hero-section *::after {
        animation: unset !important;
        animation-play-state: running !important;
        transition: all 0.3s ease !important;
    }

    /* Explicitly define hero animations with maximum specificity */
    body .hero-section .hero-title {
        animation: fadeInUp 1s ease forwards !important;
        opacity: 0 !important;
    }

    body .hero-section .hero-subtitle {
        animation: fadeInUp 1s ease 0.2s forwards !important;
        opacity: 0 !important;
    }

    /* ===== STORY SECTION FIXES ===== */
    body .story-section,
    body section.story-section {
        padding: 60px 0 !important;
        overflow-x: hidden !important;
    }

    body .story-section .container,
    body section.story-section .container {
        padding: 0 20px !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    /* Section title in story section */
    body .story-section .section-intro,
    body section.story-section .section-intro {
        margin-bottom: 40px !important;
        padding: 0 15px !important;
        text-align: center !important;
    }

    body .story-section .section-title,
    body section.story-section .section-title {
        font-size: 2em !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Timeline Container - Maximum specificity */
    body .story-section .story-timeline,
    body section.story-section .story-timeline {
        padding: 0 20px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        position: relative !important;
    }

    /* Timeline Line - Move to the left for mobile */
    body .story-section .timeline-line,
    body section.story-section .timeline-line {
        left: 20px !important;
        width: 2px !important;
        top: 0 !important;
        bottom: 0 !important;
        background: linear-gradient(to bottom, var(--primary-blue), var(--sky-blue)) !important;
    }

    /* Timeline Items - Maximum specificity */
    body .story-section .timeline-item,
    body section.story-section .timeline-item {
        padding-left: 60px !important;
        margin-bottom: 45px !important;
        padding-right: 15px !important;
        overflow-x: hidden !important;
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        animation: fadeInLeft 0.8s ease forwards !important;
    }

    /* Timeline Dots - Maximum specificity */
    body .story-section .timeline-dot,
    body section.story-section .timeline-dot {
        left: 11px !important;
        top: 8px !important;
        width: 18px !important;
        height: 18px !important;
        border-width: 3px !important;
        position: absolute !important;
        background: var(--primary-blue) !important;
        border-radius: 50% !important;
        border-color: white !important;
        box-shadow: 0 0 0 2px var(--primary-blue) !important;
    }

    /* Timeline Content - Maximum specificity */
    body .story-section .timeline-content,
    body section.story-section .timeline-content {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    body .story-section .timeline-content h3,
    body section.story-section .timeline-content h3 {
        font-size: 1.6em !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        color: var(--navy) !important;
    }

    body .story-section .timeline-content p,
    body section.story-section .timeline-content p {
        font-size: 1.05em !important;
        line-height: 1.7 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        color: var(--gray) !important;
    }

    /* Highlighted timeline content - Maximum specificity */
    body .story-section .timeline-content.highlight,
    body section.story-section .timeline-content.highlight {
        padding: 25px !important;
        margin-left: -10px !important;
        margin-right: -5px !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(0, 180, 216, 0.05)) !important;
    }

    /* Innovation Showcase in Story Section - FIXED: Added body prefix */
    body .innovation-showcase,
    body .story-section .innovation-showcase {
        margin-top: 50px !important;
        padding: 30px 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 15px !important;
    }

    body .showcase-label,
    body .innovation-showcase .showcase-label {
        font-size: 1.3em !important;
        letter-spacing: 1px !important;
        margin-bottom: 12px !important;
        display: block !important;
    }

    body .innovation-showcase .showcase-content h3 {
        font-size: 1.8em !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }

    body .innovation-showcase .showcase-content p {
        font-size: 1em !important;
        line-height: 1.6 !important;
        margin-bottom: 30px !important;
    }

    body .showcase-metrics,
    body .innovation-showcase .showcase-metrics {
        flex-direction: row !important;
        gap: 20px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    body .metric,
    body .showcase-metrics .metric {
        min-width: 80px !important;
        text-align: center !important;
    }

    body .metric-icon,
    body .metric .metric-icon {
        font-size: 2em !important;
        margin-bottom: 8px !important;
    }

    body .metric-label,
    body .metric .metric-label {
        font-size: 0.85em !important;
    }

    /* ===== ADDITIONAL SECTION FIXES (CONSOLIDATED FROM DUPLICATE 768PX QUERY) ===== */

    /* Container fixes */
    body .container,
    body section .container {
        max-width: 100% !important;
        padding: 0 20px !important;
        overflow-x: hidden !important;
    }

    /* Story grid */
    body .story-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* Founders grid */
    body .founders-grid {
        grid-template-columns: 1fr !important;
    }

    /* Team showcase fixes */
    body .team-showcase {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 0 20px !important;
    }

    body .team-member {
        flex-direction: column !important;
        text-align: center !important;
        padding: 30px 20px !important;
    }

    body .team-member .member-image {
        margin: 0 auto !important;
    }

    body .team-member .image-placeholder {
        width: 120px !important;
        height: 120px !important;
    }

    /* MVV cards fixes */
    body .mvv-cards {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 0 20px !important;
    }

    body .mvv-card {
        padding: 30px 20px !important;
    }

    /* Advantage carousel fixes */
    body .advantage-carousel {
        margin: 0 20px !important;
        height: auto !important;
        min-height: 400px !important;
    }

    body .carousel-slide {
        padding: 40px 20px !important;
    }

    body .carousel-arrow {
        display: none !important;
    }

    /* Process differentiators */
    body .process-differentiators {
        grid-template-columns: 1fr !important;
        padding: 0 20px !important;
        gap: 20px !important;
    }

    body .diff-card {
        padding: 30px 20px !important;
    }

    /* Promise grid */
    body .promise-grid {
        grid-template-columns: 1fr !important;
    }

    /* Ensure all headings fit */
    body h1,
    body h2,
    body h3,
    body h4,
    body h5,
    body h6 {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }

    /* Fix any remaining overflow */
    body section {
        overflow-x: hidden !important;
    }

    /* Adjust padding for all sections */
    body .story-section,
    body .team-section,
    body .mvv-section,
    body .why-section,
    body .process-section {
        padding: 60px 0 !important;
    }
}

/* ===== SMALL MOBILE DEVICES (max-width: 480px) ===== */
@media (max-width: 480px) {

    /* Hero Section - Even more compact - FIXED: Added body prefix */
    body .hero-section,
    body section.hero-section {
        min-height: 350px !important;
        padding: 40px 0 !important;
    }

    body .hero-section .hero-title,
    body .hero-content .hero-title {
        font-size: 1.8em !important;
        padding: 0 10px !important;
    }

    body .hero-section .hero-subtitle,
    body .hero-content .hero-subtitle {
        font-size: 1em !important;
        padding: 0 15px !important;
    }

    /* Story Section - More compact spacing - FIXED: Added body prefix */
    body .story-section .section-title,
    body section.story-section .section-title {
        font-size: 1.5em !important;
    }

    body .story-section .timeline-item,
    body section.story-section .timeline-item {
        padding-left: 45px !important;
        margin-bottom: 35px !important;
    }

    body .story-section .timeline-dot,
    body section.story-section .timeline-dot {
        width: 16px !important;
        height: 16px !important;
    }

    body .story-section .timeline-content h3,
    body section.story-section .timeline-content h3 {
        font-size: 1.3em !important;
    }

    body .story-section .timeline-content p,
    body section.story-section .timeline-content p {
        font-size: 0.95em !important;
    }

    body .innovation-showcase,
    body .story-section .innovation-showcase {
        padding: 25px 15px !important;
    }

    body .showcase-label,
    body .innovation-showcase .showcase-label {
        font-size: 1.1em !important;
    }

    body .innovation-showcase .showcase-content h3 {
        font-size: 1.5em !important;
    }

    body .metric-icon,
    body .metric .metric-icon {
        font-size: 1.8em !important;
    }
}

/* ===== VERY SMALL DEVICES (max-width: 375px) ===== */
@media (max-width: 375px) {

    /* FIXED: Added body prefix for maximum specificity */
    body .hero-section .hero-title,
    body .hero-content .hero-title {
        font-size: 1.6em !important;
    }

    body .hero-section .hero-subtitle,
    body .hero-content .hero-subtitle {
        font-size: 0.95em !important;
    }

    body .story-section .section-title,
    body section.story-section .section-title {
        font-size: 1.4em !important;
    }

    body .story-section .timeline-content h3,
    body section.story-section .timeline-content h3 {
        font-size: 1.2em !important;
    }

    body .story-section .timeline-content p,
    body section.story-section .timeline-content p {
        font-size: 0.9em !important;
    }

    body .showcase-metrics,
    body .innovation-showcase .showcase-metrics {
        gap: 15px !important;
    }
}

/* ===== EXTRA SMALL DEVICES (max-width: 320px) - iPhone SE ===== */
@media (max-width: 320px) {

    /* NEW: iPhone SE specific optimizations */
    body .hero-section .hero-title,
    body .hero-content .hero-title {
        font-size: 1.4em !important;
        padding: 0 8px !important;
    }

    body .hero-section .hero-subtitle,
    body .hero-content .hero-subtitle {
        font-size: 0.85em !important;
        padding: 0 12px !important;
    }

    body .story-section .section-title,
    body section.story-section .section-title {
        font-size: 1.3em !important;
    }

    body .story-section .timeline-content h3,
    body section.story-section .timeline-content h3 {
        font-size: 1.1em !important;
    }

    body .story-section .timeline-content p,
    body section.story-section .timeline-content p {
        font-size: 0.85em !important;
    }

    body .innovation-showcase,
    body .story-section .innovation-showcase {
        padding: 20px 12px !important;
    }
}

/* ===== FOOTER MOBILE FIX (max-width: 768px) ===== */
/* Fixes right-side cutoff on mobile devices */
@media screen and (max-width: 768px) {

    /* Footer container - ensure proper padding and prevent cutoff */
    body footer,
    body footer .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Footer content grid - single column with proper spacing */
    body footer .footer-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 0 !important;
        margin-bottom: 30px !important;
        text-align: center !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Footer brand section */
    body footer .footer-brand {
        padding: 0 10px !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Footer links sections */
    body footer .footer-links {
        padding: 0 10px !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    body footer .footer-links h4 {
        margin-bottom: 15px !important;
        font-size: 1.1em !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    body footer .footer-links ul {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    body footer .footer-links li {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body footer .footer-links a {
        display: inline-block !important;
        padding: 8px 0 !important;
        width: auto !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Footer bottom section */
    body footer .footer-bottom {
        padding: 20px 10px !important;
        text-align: center !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    body footer .footer-bottom p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        font-size: 0.9em !important;
        line-height: 1.6 !important;
    }

    body footer .footer-bottom a {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

/* ===== SMALL MOBILE FOOTER FIX (max-width: 480px) ===== */
@media screen and (max-width: 480px) {

    body footer,
    body footer .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    body footer .footer-content {
        gap: 25px !important;
    }

    body footer .footer-links h4 {
        font-size: 1em !important;
    }

    body footer .footer-bottom p {
        font-size: 0.85em !important;
    }
}

/* ===== VERY SMALL MOBILE FOOTER FIX (max-width: 375px) ===== */
@media screen and (max-width: 375px) {

    body footer,
    body footer .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body footer .footer-content {
        gap: 20px !important;
    }

    body footer .footer-bottom p {
        font-size: 0.8em !important;
    }
}

/* DUPLICATE 768PX QUERY REMOVED - All content consolidated into main 768px query above */
