/* ============================================
   Mobile-Specific Optimizations
   Sports News Theme - Responsive Design
   ============================================ */

/* ===== Touch Target Optimization ===== */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
}

/* ===== Typography - Mobile First ===== */
@media (max-width: 767px) {
    body {
        font-size: 16px;
        line-height: 1.5;
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .text-sm {
        font-size: 0.875rem;
    }

    .text-xs {
        font-size: 0.75rem;
    }
}

/* ===== Layout Adjustments for Tablet/Desktop ===== */
@media (min-width: 768px) {

    /* Hide mobile-only elements */
    .lg\:hidden {
        display: none;
    }

    /* Show desktop elements */
    .lg\:flex {
        display: flex;
    }

    .lg\:block {
        display: block;
    }
}

/* ===== Mobile Navigation (< 1024px) ===== */
@media (max-width: 1023px) {

    /* Hide desktop nav */
    nav.desktop-nav,
    .lg\:flex.items-center {
        display: none !important;
    }

    /* Show mobile menu button */
    .lg\:hidden {
        display: block;
    }

    /* Header adjustments */
    .header {
        height: 4rem;
    }

    /* Mobile menu styling */
    nav ul {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
}

/* ===== Grid System - Mobile ===== */
@media (max-width: 767px) {

    /* Container spacing */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Vertical spacing */
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Height adjustments */
    .h-20 {
        height: 4rem;
    }

    .w-10,
    .h-10 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .w-12,
    .h-12 {
        width: 3rem;
        height: 3rem;
    }

    .p-10 {
        padding: 1rem;
    }

    /* Text sizes */
    .text-3xl {
        font-size: 1.5rem;
    }

    .text-2xl {
        font-size: 1.25rem;
    }

    .text-xl {
        font-size: 1.125rem;
    }

    /* Ticker - Mobile Optimizations */
    .breaking-news-ticker-wrapper {
        padding: 0.5rem 0;
    }
    
    .ticker-container {
        height: 1.5rem;
    }
    
    .ticker-track {
        font-size: 0.75rem;
    }
    
    .ticker-item {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        gap: 0.5rem;
    }
    
    .ticker-pause-btn {
        display: none !important;
    }

    /* Grid layouts - stack on mobile */
    .grid {
        gap: 1rem;
    }

    .md\:grid-cols-2,
    .lg\:grid-cols-3,
    .lg\:grid-cols-4,
    .lg\:grid-cols-12 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    /* Full width columns on mobile */
    .lg\:col-span-7,
    .lg\:col-span-5,
    .lg\:col-span-4,
    .lg\:col-span-8,
    .lg\:col-span-12 {
        grid-column: span 1 / span 1;
    }

    /* Flex direction */
    .flex-col {
        flex-direction: column;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
        -webkit-user-drag: none;
        -khtml-user-drag: none;
        -moz-user-drag: none;
        -o-user-drag: none;
        user-drag: none;
    }

    /* Forms - prevent iOS zoom */
    input,
    select,
    textarea {
        font-size: 16px;
    }

    /* Buttons */
    button {
        cursor: pointer;
        min-height: 44px;
    }
}

/* ===== Extra Small Mobile (< 480px) ===== */
@media (max-width: 479px) {
    body {
        font-size: 14px;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .text-2xl {
        font-size: 1.125rem;
    }

    .text-xl {
        font-size: 1rem;
    }

    .text-lg {
        font-size: 0.875rem;
    }
}

/* ===== Performance Optimizations ===== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Loading states */
.loading {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.loaded {
    opacity: 1;
}

/* Focus states for accessibility */
*:focus {
    outline: 2px solid #E31B23;
    outline-offset: 2px;
}

/* Mobile menu transitions */
.mobile-menu-item {
    transition: background-color 0.2s ease;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Video optimization */
video {
    width: 100%;
    height: auto;
}

/* Table optimization for mobile */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide less important columns */
    .hidden-mobile {
        display: none;
    }
}

/* ===== Reduce Motion Preference ===== */
@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 (Optional) ===== */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ===== Landscape Orientation ===== */
@media (max-width: 767px) and (orientation: landscape) {

    /* Reduce vertical spacing in landscape */
    .py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .py-24 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

/* ===== Print Styles ===== */
@media print {

    /* Hide non-essential elements */
    header,
    footer,
    aside,
    .no-print {
        display: none !important;
    }

    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }

    /* Show URLs after links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
}