/* ===== MOBILE FIRST RESPONSIVE DESIGN ===== */

/* ===== EXTRA SMALL DEVICES (Portrait phones, less than 576px) ===== */
@media (max-width: 575.98px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* Page Header */
    .page-header {
        padding: 100px 0 40px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    /* Grid Layouts */
    .features-grid,
    .values-grid,
    .services-grid,
    .modules-grid,
    .process-steps,
    .testimonials-grid,
    .stories-grid,
    .articles-grid,
    .categories-grid,
    .related-grid,
    .waiting-content,
    .tips-grid,
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-card.featured {
        grid-column: span 1;
    }
    
    /* Two column layouts to single column */
    .about-intro,
    .services-intro,
    .intro-content,
    .blog-intro-content,
    .contact-intro,
    .article-intro {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    /* Team Grid */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Forms */
    .newsletter-input-group {
        flex-direction: column;
    }
    
    /* Article Navigation */
    .article-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Thanks Page */
    .thanks-actions {
        flex-direction: column;
        align-items: center;
    }
    
    /* Buttons */
    .hero-buttons,
    .thanks-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    /* Spacing adjustments */
    .features,
    .values,
    .team,
    .stats,
    .services-overview,
    .main-services,
    .learning-modules,
    .process,
    .testimonials-intro,
    .testimonials-main,
    .success-stories,
    .review-form-section,
    .blog-intro,
    .featured-articles,
    .newsletter-section,
    .blog-categories,
    .contact-content,
    .contact-section,
    .contact-faq,
    .while-waiting,
    .quick-tips,
    .legal-content,
    .thanks-section {
        padding: 60px 0;
    }
    
    .cta {
        padding: 60px 0;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
}

/* ===== SMALL DEVICES (Landscape phones, 576px and up) ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Grid adjustments for small tablets */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Cookie banner adjustments */
    .cookie-content {
        flex-direction: row;
        align-items: center;
    }
    
    .cookie-buttons {
        flex-direction: row;
    }
}

/* ===== MEDIUM DEVICES (Tablets, 768px and up) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding: 0 1.5rem;
    }
    
    /* Navigation remains desktop-style */
    .hamburger {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        position: static;
        flex-direction: row;
        background-color: transparent;
        width: auto;
        box-shadow: none;
        top: auto;
        left: auto;
    }
    
    .nav-menu li {
        margin: 0 0 0 1.5rem;
    }
    
    /* Hero adjustments */
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    /* Grid layouts */
    .features-grid,
    .values-grid,
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-card.featured {
        grid-column: span 2;
    }
    
    .categories-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats remain 4 columns */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Process steps */
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Two column layouts remain */
    .about-intro,
    .services-intro,
    .intro-content,
    .blog-intro-content,
    .contact-intro,
    .article-intro {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact grid adjustments */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer remains single column */
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ===== LARGE DEVICES (Desktops, 992px and up) ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Most layouts work well at this size */
    .contact-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    /* Services grid can show 2 columns */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Articles grid */
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-card.featured {
        grid-column: span 2;
    }
}

/* ===== EXTRA LARGE DEVICES (Large desktops, 1200px and up) ===== */
@media (min-width: 1200px) {
    /* Full 3-column layouts */
    .features-grid,
    .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .article-card.featured {
        grid-column: span 2;
    }
    
    .categories-grid,
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .waiting-content,
    .tips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Process steps can show 4 */
    .process-steps {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== ULTRA WIDE SCREENS (1400px and up) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Hero content can be larger */
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .hero-content p {
        font-size: 1.375rem;
    }
    
    /* Page headers */
    .page-header h1 {
        font-size: 3rem;
    }
    
    .cta-content h2 {
        font-size: 3rem;
    }
}

/* ===== LANDSCAPE ORIENTATION ADJUSTMENTS ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 90px 0 40px;
    }
    
    .page-header {
        padding: 90px 0 30px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images and icons remain crisp */
    .feature-card img,
    .value-card img,
    .service-card img,
    .category-card img,
    .related-card img,
    .waiting-item img,
    .tip-card img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== REDUCED MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== DARK MODE SUPPORT (if system preference) ===== */
@media (prefers-color-scheme: dark) {
    /* This would be implemented if dark mode was required */
    /* Currently maintaining light theme for brand consistency */
}

/* ===== PRINT MEDIA RESPONSIVE ===== */
@media print {
    /* Ensure single column layout for printing */
    .hero-container,
    .about-intro,
    .services-intro,
    .intro-content,
    .blog-intro-content,
    .contact-intro,
    .article-intro {
        grid-template-columns: 1fr !important;
    }
    
    .features-grid,
    .values-grid,
    .services-grid,
    .testimonials-grid,
    .articles-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Adjust spacing for print */
    .features,
    .values,
    .main-services,
    .testimonials-main {
        padding: 2rem 0 !important;
    }
}

/* ===== FOCUS MANAGEMENT FOR KEYBOARD USERS ===== */
@media (max-width: 767.98px) {
    .nav-menu.active {
        /* Ensure mobile menu is keyboard accessible */
    }
    
    .nav-menu.active .nav-link:focus {
        background-color: rgba(39, 174, 96, 0.1);
    }
}

/* ===== HOVER STATES FOR NON-TOUCH DEVICES ===== */
@media (hover: hover) and (pointer: fine) {
    .feature-card:hover,
    .value-card:hover,
    .service-card:hover,
    .testimonial-card:hover,
    .article-card:hover,
    .category-card:hover,
    .related-card:hover,
    .waiting-item:hover {
        transform: translateY(-5px);
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects and increase touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 0;
    }
    
    /* Remove transform effects that don't work well on touch */
    .feature-card:hover,
    .value-card:hover,
    .service-card:hover,
    .testimonial-card:hover,
    .article-card:hover,
    .category-card:hover,
    .related-card:hover,
    .waiting-item:hover {
        transform: none;
    }
}
