/* ==========================================================================
   SKYSHILP CONSTRUCTION - RESPONSIVE STYLESHEET
   File: assets/css/responsive.css
   Description: Device-specific layout adjustments and overrides.
   ========================================================================== */

/* ==========================================================================
   1. LARGE DESKTOP ADJUSTMENTS (Max 1400px)
   ========================================================================== */
@media (max-width: 1400px) {
    .container {
        max-width: 1140px;
    }

    /* Slight typography reduction for large screens */
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2rem; }
}

/* ==========================================================================
   2. DESKTOP & LAPTOP ADJUSTMENTS (Max 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }

    /* Navigation Adjustment */
    .menu-item a {
        font-size: 0.9rem;
        padding: 10px 0;
    }
    .menu-list {
        gap: 20px;
    }

    /* Hero Section */
    .hero-stats {
        padding: 20px 30px;
    }
    .stat-number {
        font-size: 1.75rem;
    }
    .stat-item {
        margin-right: 25px;
    }
}

/* ==========================================================================
   3. TABLET LANDSCAPE & SMALL DESKTOP (Max 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    /* --- NAVIGATION: SWITCH TO MOBILE --- */
    .main-menu, 
    .header-actions .btn {
        display: none; /* Hide Desktop Menu & CTA */
    }

    .mobile-menu-toggle {
        display: block; /* Show Hamburger */
        font-size: 1.5rem;
        color: var(--primary-color);
        padding: 10px;
    }

    /* Mobile Menu Container Styling (Slide-in Sidebar) */
    .mobile-menu-container {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden by default */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-white);
        z-index: 1001;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        overflow-y: auto;
        padding: 60px 20px 20px;
    }

    .mobile-menu-container.active {
        right: 0; /* Slide in */
    }

    .mobile-menu-inner ul {
        flex-direction: column;
        gap: 0;
    }

    .mobile-menu-inner li {
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-inner li a {
        display: block;
        padding: 15px 0;
        font-size: 1rem;
        color: var(--primary-color);
    }

    /* Mobile Dropdown Logic */
    .mobile-menu-inner .has-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        padding-left: 20px;
        border-top: none;
        transform: none;
        display: none; /* Hidden until toggled via JS */
        background-color: var(--bg-light);
    }
    
    .mobile-menu-inner .has-dropdown.active .dropdown-menu {
        display: block;
    }

    /* --- HERO SECTION --- */
    .hero-section {
        height: auto;
        padding: 120px 0 80px;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    /* Stats: Convert to 2-column grid */
    .hero-stats {
        position: static;
        margin-top: 40px;
        width: 100%;
        border-radius: var(--border-radius-md);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .stat-item { margin-right: 0; }

    /* --- GRID SYSTEM STACKING --- */
    .grid-4, 
    .features-grid, 
    .team-grid {
        grid-template-columns: repeat(2, 1fr); /* 4 col -> 2 col */
    }

    .grid-3, 
    .services-grid, 
    .projects-grid, 
    .blog-grid, 
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr); /* 3 col -> 2 col */
    }

    /* --- FOOTER --- */
    .footer-widgets {
        grid-template-columns: 1fr 1fr; /* 4 col -> 2 col */
        gap: 30px;
    }
}

/* ==========================================================================
   4. TABLET PORTRAIT (Max 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }

    /* --- TOP BAR --- */
    .top-bar {
        display: none; /* Hide top contact bar to save space */
    }

    /* --- TYPOGRAPHY SCALING --- */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
    p { font-size: 0.95rem; }

    /* --- HERO SECTION --- */
    .hero-content h1 {
        margin-bottom: 1rem;
    }
    
    .hero-subheading {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    /* --- GRID SYSTEM: FULL STACK --- */
    .services-grid, 
    .projects-grid, 
    .blog-grid, 
    .testimonials-grid, 
    .grid-2 {
        grid-template-columns: 1fr; /* All grids to 1 column */
    }
    
    .about-row, 
    .contact-row {
        flex-direction: column;
    }
    
    .col-image {
        order: -1; /* Image on top */
        margin-bottom: 30px;
    }

    /* --- SERVICES & PROJECTS --- */
    .service-card {
        padding: 25px;
    }
    
    .project-image {
        height: 220px;
    }

    /* --- CONTACT FORM --- */
    .contact-form {
        padding: 20px;
    }
    
    .contact-form .form-group {
        margin-bottom: 15px;
    }
    
    .contact-form button {
        width: 100%; /* Full width button */
    }
    
    .map-container iframe {
        height: 300px; /* Adjust map height */
    }
}

/* ==========================================================================
   5. EXTRA SMALL / MOBILE (Max 576px)
   ========================================================================== */
@media (max-width: 576px) {
    .container {
        width: 100%;
        padding: 0 15px;
    }

    /* --- GLOBAL SPACING --- */
    .section-padding {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }

    /* --- HEADER --- */
    .site-logo img {
        width: 140px; /* Resize logo */
        height: auto;
    }
    
    .search-container {
        display: none; /* Hide search on very small screens if needed */
    }

    /* --- HERO SECTION --- */
    .hero-section {
        padding: 100px 0 60px;
        background-position: center center;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }

    /* Stats: Single Column */
    .hero-stats {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    /* --- TEAM / GRID --- */
    .team-grid, 
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .team-card {
        text-align: center;
    }

    /* --- FOOTER --- */
    .footer-widgets {
        grid-template-columns: 1fr; /* 2 col -> 1 col */
        text-align: center;
    }
    
    .widget-title::after {
        left: 50%;
        transform: translateX(-50%); /* Center underline */
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .footer-bottom .bottom-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .inline-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .social-icons {
        justify-content: center;
    }
}

/* ==========================================================================
   6. ULTRA SMALL (Max 420px)
   ========================================================================== */
@media (max-width: 420px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Ensure form inputs don't overflow */
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* ==========================================================================
   7. TOUCH & PERFORMANCE OPTIMIZATION
   ========================================================================== */
@media (hover: none) {
    /* Remove hover transforms on touch devices to prevent sticky states */
    .service-card:hover, 
    .project-card:hover, 
    .team-card:hover, 
    .btn:hover {
        transform: none;
        box-shadow: var(--shadow-sm); /* Reset to default shadow */
    }
    
    /* Always show dropdown toggles or use JS click instead of hover */
    .has-dropdown .dropdown-menu {
        display: none; /* JS handle required */
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-container,
    .hero-content,
    .fade-in {
        transition: none !important;
        animation: none !important;
    }
}