/**
 * Enhanced Mobile Responsiveness CSS
 * Mobile-first design with touch-friendly interactions
 */

/* Base mobile-first styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Improve touch targets on mobile */
.touch-device button,
.touch-device .btn,
.touch-device input[type="button"],
.touch-device input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
}

.touch-device a {
    min-height: 44px;
    display: inline-block;
    line-height: 44px;
}

/* Mobile-first navigation improvements */
@media (max-width: 768px) {
    /* Ensure mobile navigation is accessible */
    .main-nav.active {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Mobile-friendly form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
        border: 2px solid #ddd;
        width: 100%;
        transition: border-color 0.3s ease;
    }
    
    /* Update the existing focus styles with better ones */

    /* Form input focus styles */
    input:focus,
    textarea:focus,
    select:focus {
        border-color: #7F503D !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(127, 80, 61, 0.2) !important;
    }
    
    /* Mobile-friendly buttons */
    .btn,
    button {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 8px;
        min-height: 44px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    /* Button focus styles for touch devices */
    .touch-device .btn:active {
        outline: none !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 8px rgba(127, 80, 61, 0.3) !important;
    }
    
    /* Hero section mobile optimization */
    .hero {
        height: 60vh;
        min-height: 400px;
        padding: 20px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        letter-spacing: 3px;
    }
    
    .hero h2 {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    /* Card grid responsive */
    .article-cards,
    .highlights-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* About section mobile */
    .about {
        flex-direction: column;
        text-align: center;
    }
    
    .about-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto 30px;
    }
    
    /* Subscribe form mobile */
    .subscribe-form {
        flex-direction: column;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .subscribe-form input {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .subscribe-form button {
        border-radius: 8px;
    }
}

/* Small screens (phones in landscape, small tablets) */
@media (max-width: 576px) {
    /* Header mobile optimization */
    .site-header {
        padding: 15px 20px;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    /* Text size adjustments */
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    /* Article content mobile */
    .article-content {
        padding: 20px 15px;
    }
    
    .article-hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    /* Book page mobile */
    .book-container {
        flex-direction: column;
    }
    
    .book-image-gallery {
        width: 100%;
        margin-bottom: 30px;
    }
    
    .book-description {
        width: 100%;
    }
    
    /* Service page mobile */
    .service-header h1 {
        font-size: 1.8rem;
    }
    
    /* Contact form mobile */
    .contact-form {
        padding: 20px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .site-header {
        padding: 10px 15px;
    }
    
    .hero h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .hero h2 {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    /* Ensure minimum spacing */
    .card,
    .article-content,
    .book-content,
    .contact-form {
        padding: 15px;
    }
}

/* Touch-specific enhancements */
.touch-device {
    /* Improve scroll behavior on touch devices */
    -webkit-overflow-scrolling: touch;
}

.touch-device .btn:hover {
    /* Disable hover effects on touch devices */
    background-color: inherit;
    transform: none;
}

.touch-device .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* General focus styles */
*:focus {
    outline: none !important;
}

/* Skip to main content focus styles */
.skip-to-main:focus {
    outline: none !important;
    background: #7F503D !important;
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Print styles */
@media print {
    .site-header,
    .mobile-menu-btn,
    .auth-nav,
    .subscribe,
    .flash-message {
        display: none !important;
    }
    
    .hero {
        height: auto;
        background: none !important;
    }
    
    .article-content,
    .book-content {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    button {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid #333;
    }
}

/* 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;
    }
} 