/**
 * LIT Mobile Experience Audit - Feb 7, 2026
 * ==========================================
 * Comprehensive mobile fixes for all pages
 * - Touch targets 44px minimum
 * - No overflow/cutoff issues
 * - Proper spacing on small screens
 * - Form optimization for mobile
 */

/* =====================================================
   GLOBAL MOBILE FIXES
   ===================================================== */

/* Ensure no horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Minimum touch target size (44px) */
@media (max-width: 768px) {
    a, button, 
    .btn, 
    .nav-link,
    .save-btn,
    .share-btn,
    .share-icon,
    input[type="submit"],
    input[type="button"],
    [role="button"],
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure sufficient tap padding */
    .btn {
        padding: 14px 24px;
    }
    
    .btn-small {
        padding: 12px 20px;
        min-height: 44px;
    }
}

/* =====================================================
   HEADER / NAVIGATION MOBILE FIXES
   ===================================================== */

@media (max-width: 768px) {
    .header {
        padding: 12px 0;
    }
    
    .header .container {
        padding: 0 16px;
    }
    
    .logo img {
        height: 36px;
    }
    
    /* Ensure mobile menu button is tappable */
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }
    
    /* Mobile close button */
    .mobile-close-btn {
        width: 48px;
        height: 48px;
        top: 16px;
        right: 16px;
    }
    
    /* Mobile nav links */
    .mobile-nav .nav-link {
        padding: 14px 0;
        font-size: 1.25rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Hide desktop CTA in header on mobile */
    .header .btn {
        display: none !important;
    }
}

/* =====================================================
   HERO SECTION MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .hero {
        padding: 40px 0 48px;
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 16px;
    }
    
    .hero p,
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 24px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .hero-stat {
        flex: 0 0 auto;
        min-width: 100px;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-stats {
        gap: 12px;
    }
}

/* =====================================================
   EVENT CARDS MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .event-card {
        margin: 0;
    }
    
    .event-image {
        height: 180px;
    }
    
    .event-content {
        padding: 16px;
    }
    
    .event-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .event-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.85rem;
    }
    
    .event-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Ensure share/save buttons are tappable */
    .share-icons {
        gap: 8px;
    }
    
    .share-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .save-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* =====================================================
   VOTE SECTION MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .vote-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-icon {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    /* Category card images - MUST show on mobile */
    .category-image {
        height: 140px !important;
        display: block !important;
        visibility: visible !important;
        overflow: hidden;
    }
    
    .category-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Nominee cards */
    .nominee-card {
        padding: 16px;
        flex-wrap: nowrap;
    }
    
    /* Nominee images - MUST show on mobile */
    .nominee-image {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        display: block !important;
        visibility: visible !important;
        flex-shrink: 0 !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        border-radius: 12px;
    }
    
    .vote-btn {
        min-height: 44px;
        width: 100%;
        margin-top: 12px;
    }
    
    /* Progress bars */
    .progress-bar {
        height: 8px;
    }
    
    /* Categories grid on vote.html */
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .category-image {
        height: 120px !important;
    }
    
    .nominee-image {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
    }
    
    .nominee-card {
        gap: 12px;
    }
}

/* =====================================================
   TESTIMONIAL CAROUSEL MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .testimonial-carousel {
        padding: 0;
    }
    
    .testimonial-card-large {
        padding: 24px 20px;
    }
    
    .testimonial-text-large {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .testimonial-avatar-large {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .carousel-nav {
        margin-top: 20px;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 48px;
        height: 48px;
    }
    
    .carousel-dot {
        width: 12px;
        height: 12px;
    }
}

/* =====================================================
   FORMS MOBILE
   ===================================================== */

@media (max-width: 768px) {
    /* Input fields */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        min-height: 48px;
        padding: 14px 16px;
        width: 100%;
        border-radius: 12px;
    }
    
    /* Form layouts */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Labels */
    .form-label,
    label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    /* Submit buttons */
    .form-submit,
    form .btn,
    form button[type="submit"] {
        width: 100%;
        min-height: 48px;
    }
    
    /* Newsletter form */
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    /* Popup form */
    .popup-form {
        gap: 16px;
    }
    
    .popup-form input[type="email"] {
        padding: 16px 20px;
    }
}

/* =====================================================
   EXIT POPUP MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .exit-popup {
        padding: 12px;
        align-items: flex-end; /* Slide up from bottom on mobile */
    }
    
    .popup-content {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .popup-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    
    .popup-header {
        padding: 24px 20px;
    }
    
    .popup-header .popup-emoji {
        font-size: 2.5rem;
    }
    
    .popup-header h3 {
        font-size: 1.25rem;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-benefits li {
        font-size: 0.9rem;
        padding: 6px 0;
    }
}

/* =====================================================
   COUNTDOWN TIMER MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .weekend-countdown {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .countdown-message {
        text-align: center;
        line-height: 1.4;
    }
}

/* =====================================================
   GOOD NEWS PAGE MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card {
        margin: 0;
    }
    
    .news-image {
        height: 200px;
    }
    
    .news-content {
        padding: 16px;
    }
    
    .news-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
}

/* =====================================================
   INSIDER PAGE MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .pricing-card {
        padding: 24px 20px;
        margin: 0 -8px;
    }
    
    .price {
        font-size: 2.5rem;
    }
    
    .price-period {
        font-size: 0.9rem;
    }
    
    .feature-list li {
        font-size: 0.95rem;
        padding: 8px 0;
    }
    
    /* How It Works section */
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .step-card::after {
        display: none; /* Hide connector lines on mobile */
    }
    
    .step-icon {
        font-size: 2rem;
    }
}

/* =====================================================
   FAQ PAGE MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .faq-item {
        margin-bottom: 12px;
    }
    
    .faq-question {
        padding: 16px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .faq-answer {
        padding: 0 16px 16px;
        font-size: 0.95rem;
    }
    
    .faq-toggle {
        min-width: 24px;
    }
}

/* =====================================================
   FOOTER MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .footer {
        padding: 40px 0 24px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .social-icon {
        width: 44px;
        height: 44px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* =====================================================
   UTILITY MOBILE CLASSES
   ===================================================== */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    /* Spacing adjustments */
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 0 16px;
    }
    
    .section-title {
        font-size: 1.35rem;
    }
}

/* =====================================================
   SCROLL / OVERFLOW FIXES
   ===================================================== */

/* Prevent content from breaking out */
.container,
.event-card,
.news-card,
.category-card,
.pricing-card,
.testimonial-card-large {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Long text handling */
.event-title,
.news-title,
.category-title,
h1, h2, h3, h4 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* =====================================================
   SAFE AREA INSETS (iPhone X+ notch support)
   ===================================================== */

@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    
    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .sticky-cta {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* =====================================================
   LANDSCAPE MOBILE FIXES
   ===================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 24px 0;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .exit-popup {
        align-items: center;
    }
    
    .popup-content {
        max-height: 95vh;
        border-radius: 24px;
    }
}

/* =====================================================
   ARTICLE CONTENT MOBILE SPACING - Feb 7, 2026
   ===================================================== */

@media (max-width: 768px) {
    .article-content {
        padding: 32px 20px !important;
    }
    
    .container {
        padding: 0 20px !important;
    }
}

/* =====================================================
   PERFORMANCE - LAZY LOADING PLACEHOLDERS
   ===================================================== */

img[loading="lazy"] {
    background: var(--gray-100);
}

/* Image loading placeholder animation */
@keyframes image-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

img[loading="lazy"]:not([src]) {
    background: linear-gradient(
        90deg,
        var(--gray-100) 0px,
        var(--gray-50) 40px,
        var(--gray-100) 80px
    );
    background-size: 200px 100%;
    animation: image-loading 1.5s infinite;
}

/* ============================================
   ARTICLE MOBILE EDGE SPACING FIX
   ============================================ */

@media (max-width: 768px) {
    .article-content {
        padding: 32px 20px !important;
        max-width: 100% !important;
    }
    
    .article-content p,
    .article-content h2 {
        padding: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* General container mobile padding */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Hero sections on mobile */
    .hero .container,
    .article-hero .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .article-hero h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 24px 16px !important;
    }
    
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}
