/* ============================================================
   INDIGENIOUS — Mobile & Responsive Overrides
   v1.0 | April 2026
   Applied AFTER inline page styles to fix mobile UX
   ============================================================ */

/* ============================================================
   TABLET (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.8rem !important;
    }

    .section-header h2,
    .ecosystem-header h2,
    .infrastructure h2 {
        font-size: 2rem !important;
    }

    /* Reduce section padding on tablet */
    section {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .footer-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}

/* ============================================================
   MOBILE NAV — Unified hamburger behavior (max-width: 768px)
   This overrides BOTH index.html and sub-page nav styles
   ============================================================ */
@media (max-width: 768px) {

    /* --- NAV LAYOUT --- */
    nav {
        padding: 0.75rem 1rem !important;
    }

    .nav-container {
        position: relative;
        flex-wrap: nowrap !important;
    }

    .nav-logo {
        font-size: 1.3rem !important;
    }

    /* Show hamburger */
    .hamburger {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        z-index: 1001;
        order: 3;
    }

    .hamburger span {
        width: 24px;
        height: 2px;
        background: var(--text-primary, #111827);
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }

    /* Hamburger X animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hide nav-right on mobile (Sign In, Get Started, lang toggle) */
    .nav-right {
        display: none !important;
    }

    /* Nav center: slide-down mobile menu */
    .nav-center {
        display: flex !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: column !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid var(--border, #E5E7EB) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
        gap: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.35s ease !important;
        z-index: 999;
    }

    .nav-center.active {
        max-height: 600px !important;
    }

    .nav-center a {
        padding: 1rem 1.5rem !important;
        border-bottom: 1px solid var(--border, #E5E7EB) !important;
        width: 100% !important;
        text-align: left !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: var(--text-primary, #111827) !important;
        text-decoration: none !important;
        display: block !important;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-center a:active {
        background: var(--bg-light, #F9FAFB) !important;
    }

    /* Mobile menu: add Sign In + Get Started + Lang toggle at bottom */
    .nav-center .mobile-nav-extras {
        display: flex !important;
        flex-direction: column;
        padding: 0.75rem 1.5rem 1rem;
        gap: 0.75rem;
        border-top: 1px solid var(--border, #E5E7EB);
        background: var(--bg-light, #F9FAFB);
    }

    .nav-center .mobile-nav-extras a {
        border-bottom: none !important;
        padding: 0.75rem 1rem !important;
        border-radius: 0.5rem;
        text-align: center !important;
        font-weight: 600 !important;
    }

    .nav-center .mobile-nav-extras .btn-nav-mobile {
        background: var(--emerald, #1B6B3A) !important;
        color: white !important;
        border-radius: 0.5rem;
        font-weight: 600;
    }

    .nav-center .mobile-nav-extras .mobile-lang-toggle {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .nav-center .mobile-nav-extras .mobile-lang-toggle a {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.85rem !important;
        border-radius: 0.25rem;
    }

    /* --- HERO SECTION (homepage) --- */
    .hero {
        padding: 7rem 1.5rem 3.5rem !important;
        min-height: auto !important;
        margin-top: 0 !important;
    }

    /* Hero background map image: ensure it renders fully on mobile */
    .hero-bg {
        overflow: hidden !important;
    }

    .hero-map-image {
        background-size: cover !important;
        background-position: center center !important;
    }

    /* Kill the 600px glow orb that causes overflow on mobile */
    .hero-glow {
        width: 300px !important;
        height: 300px !important;
    }

    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .hero p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .hero-buttons {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .hero-buttons a,
    .hero-buttons .btn-primary,
    .hero-buttons .btn-outline {
        width: 100% !important;
        text-align: center !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }

    .hero-trust {
        font-size: 0.85rem !important;
    }

    /* --- SUB-PAGE HERO (contact, about, etc.) --- */
    /* These pages use margin-top to push below fixed nav.
       The inline CSS sets margin-top: 8rem at 768px which is way too much.
       Override to a sane value that just clears the fixed nav (~56px). */
    .hero[style],
    section.hero {
        margin-top: 0 !important;
        padding-top: 5rem !important;
    }

    /* Contact page specific: reduce hero padding */
    .hero-content {
        padding: 0 !important;
    }

    /* Contact page main section */
    .contact-main {
        padding: 2rem 1.25rem !important;
    }

    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* --- ANIMATION SAFETY NET --- */
    /* Prevent content from being permanently invisible if CSS animations
       fail to fire (missing keyframes, mobile Safari quirks, etc.) */
    .form-container,
    .info-container,
    .visual-card,
    .info-card,
    .trust-strip,
    .contact-details {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* --- STATS BAR --- */
    .stats-bar {
        padding: 2rem 1rem !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .stat-item h3 {
        font-size: 1.6rem !important;
    }

    .stat-item p {
        font-size: 0.8rem !important;
    }

    /* --- MAP SECTION --- */
    .map-section {
        padding: 3.5rem 1rem !important;
    }

    .map-container {
        height: auto !important;
        aspect-ratio: 1000 / 600 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .map-svg {
        width: 100% !important;
        height: auto !important;
    }

    .map-stats {
        gap: 1.5rem !important;
        flex-wrap: wrap !important;
    }

    .map-stat-value {
        font-size: 1.3rem !important;
    }

    /* --- TICKER --- */
    .ticker-section::before,
    .ticker-section::after {
        width: 60px !important;
    }

    .ticker-item {
        padding: 0 1.5rem !important;
        font-size: 0.95rem !important;
    }

    /* --- GRIDS: Force single column --- */
    .solutions-grid,
    .testimonials-grid,
    .infrastructure-grid,
    .enterprise-grid,
    .problem-list,
    .solution-grid,
    .values-grid,
    .features-grid,
    .pricing-grid,
    .team-grid,
    .steps-grid,
    .benefits-grid,
    .principles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* --- CARDS --- */
    .solution-card,
    .testimonial-card,
    .infrastructure-card,
    .enterprise-card,
    .feature-card,
    .pricing-card,
    .benefit-card,
    .principle-card,
    .value-card,
    .step-card {
        padding: 1.25rem !important;
    }

    /* --- SECTION PADDING: reduce vertical space --- */
    .infrastructure,
    .solutions-section,
    .testimonials,
    .enterprise-section,
    .ecosystem,
    .features-section,
    .principles-section {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .section-header {
        margin-bottom: 2rem !important;
    }

    .section-header h2 {
        font-size: 1.8rem !important;
    }

    .section-header p {
        font-size: 0.95rem !important;
    }

    /* --- PROCESS TIMELINE --- */
    .process-timeline {
        padding-left: 0 !important;
    }

    .timeline-connector {
        display: none !important;
    }

    /* --- PHOTO HERO (About page etc.) --- */
    .photo-hero {
        min-height: 350px !important;
        height: 50vh !important;
    }

    .photo-hero-content h2 {
        font-size: 1.8rem !important;
    }

    .photo-hero-content p {
        font-size: 0.95rem !important;
    }

    /* --- ECOSYSTEM DIAGRAM --- */
    .eco-layout {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .eco-column {
        max-width: 100% !important;
        align-items: stretch !important;
    }

    .eco-hub {
        width: 140px !important;
        height: 140px !important;
        margin: 0 auto !important;
    }

    .eco-connectors {
        display: none !important;
    }

    .ecosystem-header {
        margin-bottom: 2.5rem !important;
    }

    .ecosystem-header h2 {
        font-size: 1.8rem !important;
    }

    /* --- CTA SECTION --- */
    .cta-section {
        padding: 3.5rem 1.5rem !important;
    }

    .cta-section h2 {
        font-size: 1.8rem !important;
    }

    .cta-section p {
        font-size: 0.95rem !important;
        max-width: 100% !important;
    }

    /* --- FOOTER --- */
    footer {
        padding: 2.5rem 1.25rem 1.5rem !important;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-section a {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }

    .footer-bottom {
        font-size: 0.8rem !important;
    }

    .footer-logo {
        font-size: 1.1rem !important;
    }
}

/* ============================================================
   SMALL MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {

    nav {
        padding: 0.625rem 0.75rem !important;
    }

    .nav-logo {
        font-size: 1.15rem !important;
    }

    .hero {
        padding: 6rem 1rem 3rem !important;
    }

    .hero h1 {
        font-size: 1.6rem !important;
    }

    .hero p {
        font-size: 0.9rem !important;
    }

    .btn-primary,
    .btn-outline {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }

    /* Stats: 2x2 grid on small phones */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .stat-item h3 {
        font-size: 1.3rem !important;
    }

    /* Footer: stack to single column on small phones */
    .footer-container,
    .footer-content {
        grid-template-columns: 1fr !important;
    }

    /* Ticker fade narrower */
    .ticker-section::before,
    .ticker-section::after {
        width: 30px !important;
    }

    /* Section padding tighter */
    .infrastructure,
    .solutions-section,
    .testimonials,
    .enterprise-section,
    .ecosystem,
    .features-section,
    .principles-section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .map-container {
        height: 220px !important;
    }
}

/* ============================================================
   TOUCH ENHANCEMENTS
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
    /* Prevent hover effects sticking on touch devices */
    .solution-card:hover,
    .enterprise-card:hover,
    .infrastructure-card:hover,
    .eco-card:hover,
    .feature-card:hover,
    .benefit-card:hover {
        transform: none !important;
    }

    /* Ensure tap targets are at least 44px */
    .nav-center a {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Prevent text selection on interactive elements */
    .hamburger,
    .btn-primary,
    .btn-outline,
    .btn-nav {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============================================================
   PRICING PAGES — Different nav markup (.nav-links, .nav-cta)
   ============================================================ */
@media (max-width: 768px) {
    /* Hide nav-links and nav-cta, show hamburger */
    .nav-links {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: column !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid var(--border, #E5E7EB) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
        gap: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.35s ease !important;
        z-index: 999;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-links.active {
        display: flex !important;
        max-height: 600px !important;
    }

    .nav-links li {
        list-style: none !important;
    }

    .nav-links a,
    .nav-links li a {
        padding: 1rem 1.5rem !important;
        border-bottom: 1px solid var(--border, #E5E7EB) !important;
        width: 100% !important;
        text-align: left !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: var(--text-primary, #111827) !important;
        text-decoration: none !important;
        display: block !important;
        opacity: 1 !important;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links a:active,
    .nav-links li a:active {
        background: var(--bg-light, #F9FAFB) !important;
    }

    .nav-cta {
        display: none !important;
    }

    /* Pricing page nav needs flex-row not column */
    nav:has(.nav-links) {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }

    /* Pricing page hamburger */
    .pricing-hamburger {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        z-index: 1001;
        margin-left: auto;
    }

    .pricing-hamburger span {
        width: 24px;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }

    .pricing-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .pricing-hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .pricing-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Pricing footer */
    .footer-content {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-column ul {
        padding: 0 !important;
    }

    .footer-column a {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr !important;
    }

    /* Pricing hero margin fix */
    nav:has(.nav-links) + .skip-link + section.hero,
    nav:has(.nav-links) ~ section.hero {
        margin-top: 70px !important;
    }
}

/* ============================================================
   PREVENT HORIZONTAL OVERFLOW (all breakpoints)
   ============================================================ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}
