/* Tailwind Responsive Enhancement Overrides */
/* Mobile-first approach for Android & iOS devices */

/* Ensure proper viewport and text rendering */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent word breaking for headings */
h1, h2, h3, h4, h5, h6 {
    word-break: keep-all;
    overflow-wrap: normal;
    word-wrap: normal;
    hyphens: none;
    -webkit-hyphens: none;
}

/* Allow word breaking only for paragraphs */
p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure images scale properly on mobile */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix for iOS input styling */
input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* Prevent zoom on iOS input focus */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    font-size: 16px;
}

/* Mobile menu touch targets - only for nav and buttons, not all links */
button,
nav a,
.btn {
    min-height: 44px;
}

/* Safe area for notched devices - apply to footer only */
@supports(padding: max(0px)) {
    .professional-footer {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* Mobile viewport fixes */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Fix hero section on mobile */
    .hero-wrapper {
        grid-template-columns: 1fr !important;
        padding: 0 12px !important;
    }
    
    .hero-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Fix hero title word breaking on mobile */
    .hero-title,
    .hero-content h1 {
        font-size: 0.9rem !important;
        max-width: 100% !important;
        width: 100% !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        word-wrap: normal !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
        line-height: 1.4 !important;
    }

    .hero-subtitle {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }

    /* Ensure buttons are touch-friendly */
    .btn,
    button {
        min-height: 48px;
        min-width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }

    /* Stack grids on mobile */
    .grid,
    [class*="grid-"] {
        grid-template-columns: 1fr !important;
    }

    /* Fix images to full view on mobile */
    .timeline-media img,
    .gallery-item img,
    .card img,
    .showcase-image img,
    .about-image img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
    }
    
    /* Hero image - full view on mobile */
    .hero-image {
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    
    .hero-image img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    }

    /* Adjust cards for mobile */
    .card {
        min-width: 100%;
    }
}

/* Small Android phones (360px and below) */
@media (max-width: 400px) {
    .hero-wrapper {
        padding: 0 10px !important;
    }
    
    .hero-title,
    .hero-content h1 {
        font-size: 0.68rem !important;
        line-height: 1.5 !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        word-wrap: normal !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
    
    .hero-subtitle {
        font-size: 0.65rem !important;
    }
}

/* Extra small phones (320px) */
@media (max-width: 350px) {
    .hero-title,
    .hero-content h1 {
        font-size: 0.6rem !important;
        line-height: 1.5 !important;
    }
    
    .hero-subtitle {
        font-size: 0.55rem !important;
    }
}

/* Tablet and up */
@media (min-width: 641px) and (max-width: 1024px) {
    .timeline-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Large devices */
@media (min-width: 1025px) {
    .timeline-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Prevent horizontal scroll on mobile */
body,
html {
    overflow-x: hidden;
}

/* Touch-friendly links and buttons */
a,
button {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

/* Improve form inputs on mobile */
textarea {
    resize: vertical;
    min-height: 120px;
}

/* Safe scrolling for fixed elements */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Prevent image distortion */
img {
    object-fit: cover;
    object-position: center;
}

/* Fix overflow on small screens */
@media (max-width: 640px) {
    .container {
        width: 100%;
        padding: 0 12px;
    }

    section {
        padding: 2rem 0;
    }
}

/* ===== MOBILE FOOTER FIXES FOR ANDROID & iOS ===== */
@media (max-width: 768px) {
    /* Ensure footer is visible and properly positioned */
    .professional-footer {
        position: relative;
        width: 100%;
        margin-top: 0 !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Fix footer logos for mobile */
    .footer-logos-bottom {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .footer-logo-img {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    /* Ensure proper text wrapping in footer */
    .footer-branding,
    .footer-tagline,
    .footer-copyright {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Fix footer legal links for mobile touch */
    .footer-legal {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .footer-legal a {
        padding: 8px 4px;
        display: inline-block;
    }

    /* Fix footer nav for mobile */
    .footer-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .footer-nav a {
        padding: 8px 12px;
        display: inline-block;
    }

    /* Fix social icons */
    .footer-socials {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Extra small screens (small Android phones) */
@media (max-width: 375px) {
    .professional-footer {
        padding: 1.5rem 0.75rem 1rem;
    }

    .footer-branding h3 {
        font-size: 1rem;
    }

    .footer-tagline {
        font-size: 0.75rem;
    }

    .footer-logo-img {
        width: 36px;
        height: 36px;
    }

    .footer-nav a {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .footer-legal a {
        font-size: 0.7rem;
    }

    .footer-copyright {
        font-size: 0.7rem;
    }

    /* Header logos for extra small screens */
    .logo-container {
        gap: 0.35rem;
    }

    .logo {
        width: 28px !important;
        height: 28px !important;
    }
}
