/* ================================
   APEX Ingénierie - Styles Responsive
   ================================ */

/* ===== RESPONSIVE BREAKPOINTS ===== */
/* 
   xs: 0-575px (Mobile portrait)
   sm: 576-767px (Mobile landscape)
   md: 768-991px (Tablet)
   lg: 992-1199px (Desktop small)
   xl: 1200px+ (Desktop large)
*/

/* ===== TABLET & MOBILE OPTIMIZATION ===== */

/* Large Desktop (xl: 1200px+) */
@media (min-width: 1200px) {
    .container {
        padding: 0 3rem;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 4rem;
    }
}

/* Desktop Small (lg: 992-1199px) */
@media (max-width: 1199px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-3xl: 5rem;
    }
    
    .hero-container {
        gap: var(--spacing-xl);
    }
}

/* Tablet (md: 768-991px) */
@media (max-width: 991px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-3xl: 4rem;
        --spacing-2xl: 3rem;
    }
    
    /* Navigation simplifiée */
    .nav-container {
        height: 60px;
        justify-content: center;
    }
    
    /* Hero Section */
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xl);
        padding-top: 60px; /* Compenser la navbar réduite */
    }
    
    .hero-logo-img {
        width: 300px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    /* Expertises Grid */
    .expertises-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Methodology */
    .methodology-process {
        flex-direction: column;
        gap: var(--spacing-2xl);
    }
    
    .methodology-process::before {
        display: none;
    }
    
    .process-step::after {
        content: '';
        position: absolute;
        bottom: -var(--spacing-lg);
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: var(--spacing-lg);
        background: linear-gradient(var(--color-accent), var(--color-primary));
    }
    
    .process-step:last-child::after {
        display: none;
    }
    
    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    /* Legal Page */
    .page-header {
        padding: calc(60px + var(--spacing-2xl)) 0 var(--spacing-2xl) 0;
    }
    
    .legal-section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
}

/* Mobile Landscape (sm: 576-767px) */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
        --spacing-3xl: 3rem;
        --spacing-2xl: 2rem;
        --spacing-xl: 1.5rem;
    }
    
    /* Navigation */
    .nav-container {
        height: 50px;
        padding: 0 var(--container-padding);
        justify-content: center;
    }
    
    .nav-cta-only {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero {
        min-height: calc(100vh - 50px);
        margin-top: 50px;
    }    .hero-container {
        padding-top: var(--spacing-xl);
    }
    
    .hero-logo-img {
        width: 240px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .btn-icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    /* Section Headers */
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    /* Expertises */
    .expertises-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .expertise-card {
        padding: var(--spacing-lg);
    }
    
    /* Projects */
    .project-content {
        padding: var(--spacing-md);
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    /* CTA Section */
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .cta .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Mobile Portrait (xs: 0-575px) */
@media (max-width: 575px) {
    :root {
        --container-padding: 1rem;
        --spacing-3xl: 2.5rem;
        --spacing-2xl: 1.5rem;
        --spacing-xl: 1.25rem;
        --spacing-lg: 1rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-subtitle,
    .section-subtitle,
    .cta-subtitle {
        font-size: 1rem;
    }
    
    /* Navigation */
    .nav-container {
        height: 60px;
    }
    
    .nav-logo .logo {
        height: 45px;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    /* Hero */
    .hero {
        margin-top: 60px;
        min-height: calc(100vh - 60px);
    }
    
    .hero-container {
        gap: var(--spacing-xl);
    }
    
    .hero-visual {
        max-width: 250px;
    }
    
    .geometric-shapes .shape-1 {
        width: 80px;
        height: 80px;
    }
    
    .geometric-shapes .shape-2 {
        width: 60px;
        height: 60px;
    }
    
    .geometric-shapes .shape-3 {
        width: 70px;
        height: 70px;
    }
    
    .wireframe-grid {
        width: 200px;
        height: 200px;
        background-size: 20px 20px;
    }
    
    /* Cards & Content */
    .expertise-card,
    .project-content {
        padding: var(--spacing-md);
    }
    
    .card-title,
    .project-title {
        font-size: 1.1rem;
    }
    
    .card-description,
    .project-description {
        font-size: 0.9rem;
    }
    
    /* Methodology */
    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .step-title {
        font-size: 1.2rem;
    }
    
    .step-description {
        font-size: 0.9rem;
    }
    
    /* CTA */
    .cta-title {
        font-size: 1.75rem;
    }
    
    /* Footer */
    .footer-content {
        text-align: left;
    }
    
    .footer-description {
        font-size: 0.9rem;
    }
    
    .contact-item {
        font-size: 0.9rem;
    }
    
    .footer-list a {
        font-size: 0.9rem;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Réduction des animations sur mobile pour les performances */
@media (max-width: 767px) {
    .hero-gradient,
    .shape-1,
    .shape-2,
    .shape-3,
    .wireframe-grid {
        animation: none;
    }
    
    .scroll-indicator {
        animation-duration: 3s;
    }
}

/* Optimisation pour les écrans à faible densité */
@media (max-resolution: 144dpi) {
    .hero-pattern,
    .cta-pattern {
        background-size: 40px 40px;
    }
}

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Tailles de touche optimisées pour mobile */
    .btn {
        min-height: 48px;
        padding: 1rem 1.5rem;
    }
    
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .social-link {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Suppression des effets de survol sur tactile */
    .expertise-card:hover,
    .project-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* ===== ACCESSIBILITÉ ===== */

/* Mode sombre (si le système le supporte) */
@media (prefers-color-scheme: dark) {
    /* Les variables resteront inchangées pour maintenir l'identité de marque */
    /* Mais on peut ajuster certains contrastes si nécessaire */
}

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --color-text-secondary: #444444;
        --color-border: #cccccc;
    }
    
    .expertise-card,
    .project-card {
        border-width: 2px;
    }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .hero-gradient,
    .shape-1,
    .shape-2,
    .shape-3,
    .wireframe-grid,
    .scroll-indicator,
    .step-number::after {
        animation: none;
    }
    
    .hero-scroll {
        display: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-scroll,
    .cta,
    .footer-social {
        display: none;
    }
    
    .hero {
        min-height: auto;
        page-break-after: always;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .expertise-card,
    .project-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="mailto:"]:after {
        content: " (" attr(href) ")";
    }
    
    a[href^="tel:"]:after {
        content: " (" attr(href) ")";
    }
}
