/* Base adjustments for 912px width */
@media (min-width: 913px) and (max-width: 1024px) {
    /* Container adjustments */
    .container {
        max-width: 100% !important;
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }

    /* Typography scaling for mid-size screens */
    h1 {
        font-size: 2.75rem !important; /* Reduced from 3rem */
        line-height: 1.1 !important;
    }

    h2 {
        font-size: 2rem !important; /* Reduced from 2.25rem */
    }

    h3 {
        font-size: 1.375rem !important; /* Reduced from 1.5rem */
    }

    /* Text sizes for 912px */
    .text-5xl {
        font-size: 2.5rem !important;
    }

    /* Reduced from 3rem */
    .text-4xl {
        font-size: 2rem !important;
    }

    /* Reduced from 2.25rem */
    .text-3xl {
        font-size: 1.75rem !important;
    }

    /* Reduced from 1.875rem */
    .text-2xl {
        font-size: 1.375rem !important;
    }

    /* Reduced from 1.5rem */
    .text-xl {
        font-size: 1.125rem !important;
    }

    /* Reduced from 1.25rem */
    .text-lg {
        font-size: 1.0625rem !important;
    }

    /* Reduced from 1.125rem */
    /* Hero section optimization */
    .hero-content h1 {
        font-size: 2.5rem !important; /* Reduced for 912px */
    }

    .hero-content h1 span.block {
        font-size: 2.25rem !important; /* Reduced */
    }

    .hero-content p {
        font-size: 1.125rem !important;
        max-width: 700px !important;
    }

    /* Grid adjustments for 912px */
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1.25rem !important; /* Reduced gap */
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 1rem !important; /* Reduced gap */
    }

    /* Process cards optimization */
    .process-card {
        min-height: 420px !important; /* Reduced height */
    }

    .process-card .p-8 {
        padding: 1.25rem !important; /* Reduced padding */
    }

    .process-card h3 {
        font-size: 1.125rem !important; /* Smaller heading */
    }

    .process-card p {
        font-size: 0.9375rem !important;
        line-height: 1.4 !important;
    }

    /* Stats section optimization */
    #stats .grid {
        gap: 1rem !important; /* Tighter grid */
    }

    #stats .card-hover {
        padding: 1.25rem 0.75rem !important; /* Reduced padding */
        min-height: 130px !important;
    }

    #stats .text-5xl {
        font-size: 2.25rem !important; /* Smaller stats */
    }

    #stats .text-blue-200 {
        font-size: 0.8125rem !important; /* Smaller text */
    }

    /* Map section optimization */
    .lg\:grid-cols-2 {
        gap: 2rem !important; /* Reduced gap */
    }

    #contact .grid {
        gap: 2rem !important;
    }

    /* Footer optimization */
    .lg\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 1.5rem !important; /* Reduced gap */
    }

    /* Navigation optimization */
    .nav-links {
        gap: 1rem !important; /* Reduced navigation gap */
    }

    .nav-links a {
        font-size: 0.9375rem !important; /* Slightly smaller */
        padding: 0.5rem 0.625rem !important;
    }

    /* Logo size adjustment */
    .logo-image-picture {
        height: 2.75rem !important; /* Slightly smaller logo */
    }

    /* Spacing reductions */
    .py-16 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .py-12 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .mb-12 {
        margin-bottom: 2.5rem !important;
    }

    .mb-8 {
        margin-bottom: 1.75rem !important;
    }

    /* Button size adjustments */
    .hero-buttons a {
        padding: 0.75rem 1.25rem !important; /* Smaller buttons */
        font-size: 0.9375rem !important;
    }

    /* Reduce image heights */
    .h-64 {
        height: 14rem !important; /* Reduced from 16rem */
    }

    .h-96 {
        height: 20rem !important; /* Reduced from 24rem */
    }
}

/* Specific optimization for exactly 912px */
@media (width: 912px) {
    /* Even more aggressive optimizations */
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    /* Two-column layout for process segments */
    .md\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Three-column for stats */
    .md\:grid-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    /* Single column for map section */
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Reduce hero height */
    .h-\[88\.5vh\] {
        height: 75vh !important;
    }

    /* Adjust footer grid */
    .lg\:grid-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .lg\:col-span-2 {
        grid-column: span 3 !important;
    }
}

/* Optimization for 912px height devices (tablets in portrait) */
@media (max-height: 912px) and (min-width: 768px) {
    .h-\[88\.5vh\] {
        height: 80vh !important; /* Reduce hero height on shorter screens */
        min-height: 500px !important;
    }

    /* Reduce vertical spacing */
    .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Compact cards */
    .process-card {
        min-height: 380px !important;
    }

    .h-64 {
        height: 12rem !important;
    }
}

/* Tablet landscape optimization (912px width range) */
@media (min-width: 768px) and (max-width: 912px) {
    /* Adjust container padding */
    .container {
        padding-left: 1.75rem !important;
        padding-right: 1.75rem !important;
    }

    /* Adjust typography */
    h1 {
        font-size: 2.5rem !important;
    }

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

    /* Two-column layouts for medium tablets */
    .md\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Single column for complex sections */
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Adjust hero */
    .hero-content h1 {
        font-size: 2.25rem !important;
    }

    .hero-content h1 span.block {
        font-size: 2rem !important;
    }

    /* Adjust navigation */
    .nav-content {
        flex-wrap: wrap !important;
        gap: 1rem !important;
    }

    .nav-links {
        order: 3 !important;
        width: 100% !important;
        justify-content: center !important;
        margin-top: 0.5rem !important;
    }

    /* Hide some decorative elements */
    .top-banner .hidden.md\\:flex {
        display: none !important;
    }

    /* Compact footer */
    footer .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .lg\:col-span-2 {
        grid-column: span 3 !important;
    }
}

/* Specific fix for 912px with high DPI/zoom */
@media (min-width: 912px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 1.25) {
    /* Scale down everything for high DPI at this width */
    body {
        font-size: 15px !important;
    }

    /* Further reduce sizes */
    h1 {
        font-size: 2.5rem !important;
    }

    .text-5xl {
        font-size: 2.25rem !important;
    }

    /* Reduce spacing */
    .gap-4 {
        gap: 0.75rem !important;
    }

    .gap-6 {
        gap: 1rem !important;
    }

    /* Compact layout */
    .process-card {
        min-height: 360px !important;
    }

    .h-64 {
        height: 11rem !important;
    }
}

/* Fix for 912px with touch devices */
@media (min-width: 768px) and (max-width: 912px) and (hover: none) and (pointer: coarse) {
    /* Improve touch targets */
    a, button {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* Larger tap targets for navigation */
    .nav-links a {
        padding: 0.75rem 1rem !important;
    }

    /* Larger buttons */
    .hero-buttons a {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Increase spacing between interactive elements */
    .gap-4 {
        gap: 1rem !important;
    }

    /* Prevent text selection on interactive elements */
    button, a {
        user-select: none !important;
        -webkit-user-select: none !important;
    }
}

/* Performance optimization for 912px devices */
@media (min-width: 768px) and (max-width: 912px) {
    /* Reduce animations for better performance */
    .card-hover:hover {
        transform: translateY(-3px) !important; /* Reduced animation */
    }

    /* Simplify shadows */
    .shadow-lg {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    }

    /* Reduce blur effects */
    .backdrop-blur-sm {
        backdrop-filter: blur(4px) !important;
    }

    /* Optimize images */
    img {
        image-rendering: -webkit-optimize-contrast !important;
    }
}

/* Specific fixes for Safari on 912px */
@media (min-width: 768px) and (max-width: 912px) and (-webkit-min-device-pixel-ratio: 0) {
    /* Fix for Safari flexbox issues */
    .nav-content {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* Fix for Safari grid gaps */
    .grid {
        gap: 1rem !important;
    }

    /* Fix for Safari backdrop-filter */
    .backdrop-blur-sm {
        -webkit-backdrop-filter: blur(4px) !important;
    }
}

/* Print optimization for 912px screens (if printing) */
@media print {
    /* Remove unnecessary elements for printing */
    .hero-buttons,
    .menu-toggle-btn,
    .top-banner .hidden {
        display: none !important;
    }

    /* Optimize colors for printing */
    body {
        color: #000 !important;
        background: #fff !important;
    }

    /* Remove backgrounds */
    .gradient-blue,
    .gradient-dark,
    .gradient-teal {
        background: #fff !important;
        color: #000 !important;
    }

    /* Remove shadows */
    .shadow-lg,
    .shadow-md {
        box-shadow: none !important;
    }
}
