/**
 * ULTIMATE Mobile Logo Fix - Maximum Specificity Override
 * Sevenfold Consulting Website
 *
 * This file MUST be loaded LAST to override ALL other CSS files
 * Fixes persistent logo overlap issue on mobile devices
 */

/* NUCLEAR OPTION: Disable ALL animations on mobile globally */
@media screen and (max-width: 768px) {
    /* Global animation killer */
    *, *::before, *::after {
        animation: none !important;
        animation-name: none !important;
        animation-duration: 0s !important;
        animation-play-state: paused !important;
        transition: none !important;
    }
}

/* Maximum specificity mobile logo fixes */
@media screen and (max-width: 768px) {
    /* Hero section critical spacing */
    body .hero,
    html body .hero,
    html body section.hero {
        padding-top: 90px !important;
        padding-bottom: 50px !important;
        min-height: auto !important;
    }

    /* Logo container - absolute positioning control */
    body .logo-hero-container,
    body .hero .logo-hero-container,
    body .hero-content .logo-hero-container {
        margin-bottom: 20px !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: relative !important;
        display: block !important;
    }

    /* Main logo wrapper - controlled scaling */
    body .hero .logo-full,
    body .hero-content .logo-full,
    body .logo-hero-container .logo-full,
    html body div.logo-full {
        /* Critical: Remove ALL transforms */
        transform: scale(0.8) !important;
        transform-origin: center center !important;

        /* Flexbox for alignment */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 15px !important;

        /* Size constraints */
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;

        /* Reset positioning */
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 auto !important;

        /* No animations */
        animation: none !important;
        transition: none !important;
    }

    /* Animated dots container - strict size control */
    body .logo-dots-animated,
    body .logo-dots-hero,
    html body div.logo-dots-animated,
    html body div.logo-dots-hero {
        /* Fixed dimensions to prevent expansion */
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;

        /* Positioning */
        position: relative !important;
        display: block !important;

        /* Kill animations */
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }

    /* Individual dots - static positioning */
    body .logo-dots-animated div,
    body .logo-dots-hero div,
    html body div.logo-dots-animated > div,
    html body div.logo-dots-hero > div {
        /* Fixed size */
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;

        /* Static positioning */
        position: absolute !important;

        /* Kill ALL animations and transforms */
        animation: none !important;
        animation-name: none !important;
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        animation-fill-mode: none !important;
        animation-play-state: paused !important;

        /* Reset transforms to static state */
        transform: translateY(0) translateX(0) scale(1) rotateY(0deg) rotateX(0deg) !important;
        opacity: 1 !important;

        /* Ensure visibility */
        display: block !important;
        visibility: visible !important;

        /* No transitions */
        transition: none !important;
    }

    /* Specific dot positioning - compact layout */
    body .logo-dots-animated div:nth-child(1) { top: 0 !important; left: 0 !important; }
    body .logo-dots-animated div:nth-child(2) { top: 0 !important; left: 15px !important; }
    body .logo-dots-animated div:nth-child(3) { top: 0 !important; left: 30px !important; }
    body .logo-dots-animated div:nth-child(4) { top: 0 !important; left: 45px !important; }
    body .logo-dots-animated div:nth-child(5) { top: 15px !important; left: 33px !important; }
    body .logo-dots-animated div:nth-child(6) { top: 30px !important; left: 22px !important; }
    body .logo-dots-animated div:nth-child(7) { top: 45px !important; left: 15px !important; }

    /* Logo text - controlled size */
    body .logo-text-hero,
    body .logo-text-main,
    html body span.logo-text-hero,
    html body span.logo-text-main {
        /* Reasonable font size */
        font-size: 2.2em !important;
        font-weight: 300 !important;
        letter-spacing: -1px !important;
        line-height: 1 !important;

        /* Prevent wrapping */
        white-space: nowrap !important;
        overflow: visible !important;

        /* No animations */
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }

    /* Kill any SVG animations if they exist */
    body svg.sevenfold-logo-svg,
    body .logo-container svg,
    body .animated-logo-container svg {
        animation: none !important;
        transform: none !important;
        height: 35px !important;
        max-height: 35px !important;
    }

    /* Override any logo-dot class animations */
    body .logo-dot,
    html body span.logo-dot {
        animation: none !important;
        transform: scale(1) !important;
        opacity: 0.9 !important;
    }
}

/* Smaller mobile devices (480px) */
@media screen and (max-width: 480px) {
    body .hero {
        padding-top: 80px !important;
    }

    body .logo-hero-container {
        margin-bottom: 15px !important;
    }

    body .hero .logo-full {
        transform: scale(0.7) !important;
        gap: 12px !important;
    }

    body .logo-dots-animated,
    body .logo-dots-hero {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
    }

    body .logo-dots-animated div {
        width: 8px !important;
        height: 8px !important;
    }

    /* Adjusted positions for smaller dots */
    body .logo-dots-animated div:nth-child(1) { top: 0 !important; left: 0 !important; }
    body .logo-dots-animated div:nth-child(2) { top: 0 !important; left: 12px !important; }
    body .logo-dots-animated div:nth-child(3) { top: 0 !important; left: 24px !important; }
    body .logo-dots-animated div:nth-child(4) { top: 0 !important; left: 36px !important; }
    body .logo-dots-animated div:nth-child(5) { top: 12px !important; left: 27px !important; }
    body .logo-dots-animated div:nth-child(6) { top: 24px !important; left: 18px !important; }
    body .logo-dots-animated div:nth-child(7) { top: 36px !important; left: 12px !important; }

    body .logo-text-hero,
    body .logo-text-main {
        font-size: 1.9em !important;
    }
}

/* Very small devices (375px) */
@media screen and (max-width: 375px) {
    body .hero {
        padding-top: 75px !important;
    }

    body .hero .logo-full {
        transform: scale(0.65) !important;
        gap: 10px !important;
    }

    body .logo-dots-animated,
    body .logo-dots-hero {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        max-width: 45px !important;
        min-height: 45px !important;
        max-height: 45px !important;
    }

    body .logo-dots-animated div {
        width: 7px !important;
        height: 7px !important;
    }

    body .logo-text-hero,
    body .logo-text-main {
        font-size: 1.7em !important;
    }
}

/* iPhone SE (320px) */
@media screen and (max-width: 320px) {
    body .hero {
        padding-top: 70px !important;
    }

    body .hero .logo-full {
        transform: scale(0.6) !important;
    }

    body .logo-dots-animated,
    body .logo-dots-hero {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    body .logo-text-hero,
    body .logo-text-main {
        font-size: 1.5em !important;
    }
}

/* iOS Safe Area Support */
@media screen and (max-width: 768px) {
    body .hero {
        padding-top: calc(90px + env(safe-area-inset-top)) !important;
    }

    /* Ensure body doesn't clip */
    body, html {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body .hero-content {
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

/* FINAL OVERRIDE: Ensure no animation can run on mobile */
@media screen and (max-width: 768px) {
    /* Target any possible animation keyframe references */
    @keyframes dropFlipSequence { to { transform: none; } }
    @keyframes glowPulse { to { transform: none; } }
    @keyframes gentlePulse { to { transform: none; } }
    @keyframes fadeIn { to { opacity: 1; } }
    @keyframes slideIn { to { transform: none; } }

    /* Double-check all logo elements have no animations */
    [class*="logo"] {
        animation: none !important;
        transition: none !important;
    }
}