/* Responsive Design for Nairobi Review - Modern Design System */

/* Mobile First Approach */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Logo sizing for mobile */
    .logo-img {
        height: 40px;
        min-width: 100px;
        max-width: 100%;
    }

    .nav-logo {
        max-width: 150px;
        min-width: 100px;
    }

    .footer-logo .logo-img {
        height: 60px;
        min-width: 120px;
        max-width: 200px;
    }

    .footer-logo {
        max-width: 250px;
        min-width: 120px;
    }
    
    /* Typography */
    .hero-title {
        font-size: var(--font-size-3xl);
        line-height: var(--line-height-tight);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Spacing */
    section {
        padding: var(--space-8) 0;
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    /* Navigation */
    .nav-container {
        padding: var(--space-3) var(--space-4);
    }
    
    .nav-logo {
        font-size: var(--font-size-lg);
    }
    
    /* Hero Section */
    .hero-content {
        padding: var(--space-8) var(--space-4);
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Cards */
    .card {
        padding: var(--space-4);
    }
    
    .show-content {
        padding: var(--space-4);
    }
    
    .contributor-card,
    .service-card {
        padding: var(--space-6);
    }
    
    /* Grid Layouts */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
    
    /* Forms */
    .contact-form {
        padding: var(--space-6);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-size-base);
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Typography */
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    /* Grid Layouts */
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Hero CTA */
    .hero-cta {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-cta .btn {
        flex: 1;
        min-width: 200px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Logo sizing for tablet */
    .logo-img {
        height: 45px;
        min-width: 110px;
        max-width: 100%;
    }

    .nav-logo {
        max-width: 160px;
        min-width: 110px;
    }

    .footer-logo .logo-img {
        height: 70px;
        min-width: 130px;
        max-width: 250px;
    }

    .footer-logo {
        max-width: 280px;
        min-width: 130px;
    }
    
    /* Typography */
    .hero-title {
        font-size: var(--font-size-5xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xl);
    }
    
    .section-title {
        font-size: var(--font-size-4xl);
    }
    
    /* Navigation */
    .nav-menu {
        gap: var(--space-6);
    }
    
    /* Grid Layouts */
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Hero Section */
    .hero-content {
        padding: var(--space-12) var(--space-6);
    }
    
    /* Cards */
    .show-content {
        padding: var(--space-5);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: var(--space-8);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: var(--space-6);
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Typography */
    .hero-title {
        font-size: var(--font-size-6xl);
    }
    
    /* Grid Layouts */
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
    
    .footer-brand {
        grid-column: auto;
        text-align: left;
        margin-bottom: 0;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Container */
    .container {
        max-width: 1200px;
    }
    
    /* Grid Layouts */
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Typography */
    .hero-title {
        font-size: var(--font-size-7xl);
    }
    
    /* Spacing */
    section {
        padding: var(--space-24) 0;
    }
    
    .hero-content {
        padding: var(--space-20) var(--space-6);
    }
}

/* Extra Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .container-xl {
        max-width: 1600px;
    }
}

/* Navigation Responsive Behavior */
@media (max-width: 767.98px) {
    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        padding: var(--space-4);
        gap: var(--space-2);
        transform: translateY(-100%);
        transition: transform var(--transition-normal);
        z-index: var(--z-dropdown);
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-link {
        padding: var(--space-3) var(--space-4);
        width: 100%;
        text-align: center;
        border-radius: var(--radius-lg);
    }
    
    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--space-2);
    }
    
    .nav-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Menu Toggle Animation */
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Tablet Specific Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Show Cards in 2 columns */
    .shows-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Contributors in 2 columns */
    .contributors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Services in 2 columns */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Contact methods stack vertically */
    .contact-methods {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .contact-method {
        margin-bottom: 0;
    }
}

/* Desktop Specific Adjustments */
@media (min-width: 1024px) {
    /* Show Cards in 3 columns */
    .shows-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8);
    }
    
    /* Contributors in 3 columns */
    .contributors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8);
    }
    
    /* Services in 3 columns */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8);
    }
    
    /* Contact methods in 2 columns */
    .contact-methods {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
}

/* Large Desktop Adjustments */
@media (min-width: 1200px) {
    /* Show Cards in 4 columns */
    .shows-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Contributors in 4 columns */
    .contributors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Services in 5 columns */
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-bg,
    .floating-elements,
    .nav-toggle,
    .btn,
    .hero-cta,
    .cta-section {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .section-title {
        page-break-after: avoid;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Reduced Motion */
@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;
    }
    
    .hero-shapes .shape {
        animation: none;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 100vh;
        padding: var(--space-4) 0;
    }
    
    .hero-content {
        padding: var(--space-8) var(--space-6);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--space-4);
    }
    
    .hero-description {
        margin-bottom: var(--space-6);
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
.btn:focus,
.nav-link:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
        outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}
}

/* Container Queries (Future-proofing) */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }
    
    @container (min-width: 300px) {
        .card-content {
            display: flex;
            gap: var(--space-4);
        }
    }
}

/* Hover Support */
@media (hover: hover) {
    .card:hover,
    .btn:hover,
    .nav-link:hover,
    .social-button:hover {
        transform: translateY(-2px);
    }
    
    .show-card:hover {
        transform: translateY(-4px);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .social-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .btn:hover,
    .nav-link:hover,
    .social-button:hover {
        transform: none;
    }
}

/* Specific Breakpoints for Common Devices */

/* iPhone SE (375px) */
@media (max-width: 374px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }
}

/* iPhone 12/13/14 (390px) */
@media (min-width: 375px) and (max-width: 389px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }
}

/* iPad (768px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-content {
        max-width: 600px;
    }
}

/* iPad Pro (1024px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .hero-content {
        max-width: 700px;
    }
}

/* Desktop (1200px+) */
@media (min-width: 1200px) {
    .hero-content {
        max-width: 800px;
    }
}