/**
 * USARM Mobile Responsive Styles
 * Complete mobile optimization for all screen sizes
 */

/* ==========================================================================
   MOBILE BREAKPOINTS
   ========================================================================== */

/* Mobile Large (768px and down) */
@media (max-width: 768px) {
    
    /* Overall mobile content spacing */
    body {
        line-height: 1.6 !important;
        font-size: 16px !important;
    }
    
    /* Header mobile improvements */
    .site-header,
    header {
        padding: 15px !important;
    }
    
    /* Navigation mobile spacing */
    .main-navigation,
    .primary-navigation {
        margin: 10px 0 !important;
    }
    
    /* Main content area mobile spacing */
    .content,
    main,
    #main {
        padding: 20px 15px !important;
    }
    
    /* Blog post excerpts - better spacing */
    .post-excerpt,
    .entry-summary,
    .post-content p {
        line-height: 1.7 !important;
        margin-bottom: 16px !important;
        font-size: 16px !important;
    }
    
    /* Post titles mobile spacing */
    .post-title,
    .entry-title,
    h1, h2, h3 {
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        margin-top: 20px !important;
    }
    
    /* "Read More" links spacing */
    .read-more,
    .more-link {
        margin-top: 15px !important;
        display: inline-block !important;
    }
    
    /* Individual post/article spacing */
    .post,
    .blog-post,
    article {
        margin-bottom: 30px !important;
        padding-bottom: 25px !important;
        border-bottom: 1px solid #eee;
    }
    
    /* Front page specific spacing */
    .home .post,
    .front-page .post {
        padding: 20px 15px !important;
        margin-bottom: 35px !important;
    }
    
    /* Category/tag labels mobile spacing */
    .post-categories,
    .category-list,
    .post-meta {
        margin: 15px 0 !important;
        line-height: 1.5 !important;
    }
    
    /* Featured images mobile spacing */
    .post-thumbnail,
    .featured-image {
        margin-bottom: 20px !important;
    }
    
    /* Widget spacing in sidebar */
    .widget {
        margin-bottom: 30px !important;
        padding: 20px 15px !important;
    }
    
    /* Menu items mobile spacing */
    .menu-item {
        padding: 12px 0 !important;
    }
    
    /* Form elements spacing */
    input[type="text"],
    input[type="email"],
    input[type="search"],
    textarea {
        margin-bottom: 15px !important;
    }
    
    /* Audio Player Mobile Optimization */
    .media-kit-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        margin: 20px 0;
    }
    
    .media-kit-container .circular-btn {
        min-width: 48px;
        min-height: 48px;
        flex-shrink: 0;
    }
    
    .media-kit-container .media-title {
        font-size: 16px;
        line-height: 1.4;
        width: 100%;
        order: -1; /* Title appears first on mobile */
    }
    
    .media-controls-row {
        display: flex;
        gap: 12px;
        align-items: center;
        width: 100%;
    }
    
    /* Persistent Player Mobile */
    #persistent-player,
    #usarm-direct-audio-player {
        padding: 12px 15px;
        flex-direction: column;
        gap: 15px;
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .player-info {
        text-align: center;
        width: 100%;
    }
    
    #current-title,
    #current-track-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .player-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    
    /* Search Input Mobile */
    #aircheck-search-input {
        width: 100% !important;
        min-width: unset !important;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 25px;
    }
    
    /* Lightbox Mobile */
    .fullwidth-lightbox-overlay {
        padding: 20px;
    }
    
    .fullwidth-lightbox-image {
        max-width: 90vw;
        max-height: 70vh;
        object-fit: contain;
    }
    
    .fullwidth-lightbox-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .lightbox-arrows {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    
    .lightbox-arrow-left {
        left: 10px;
    }
    
    .lightbox-arrow-right {
        right: 10px;
    }
    
    /* Accessibility Toggle Mobile */
    .accessibility-toggle {
        top: 10px;
        right: 10px;
        z-index: 10000;
    }
    
    .a11y-toggle-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Forms Mobile */
    input[type="text"],
    input[type="email"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Tables Mobile */
    .wp-list-table {
        font-size: 12px;
    }
    
    .wp-list-table td,
    .wp-list-table th {
        padding: 8px 4px;
    }
    
    /* Navigation Improvements */
    .menu-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Mobile Medium (600px and down) */
@media (max-width: 600px) {
    
    /* Increase overall spacing on smaller screens */
    .content,
    main,
    #main {
        padding: 25px 20px !important;
    }
    
    /* Blog posts need more breathing room */
    .post,
    .blog-post,
    article {
        margin-bottom: 40px !important;
        padding: 25px 20px !important;
    }
    
    /* Text content spacing */
    .post-content p,
    .entry-summary,
    .post-excerpt {
        margin-bottom: 18px !important;
        line-height: 1.75 !important;
    }
    
    /* Headers more space */
    h1, h2, h3 {
        margin-top: 25px !important;
        margin-bottom: 18px !important;
    }
    
    .media-kit-container {
        padding: 15px;
        gap: 12px;
        margin: 25px 0;
    }
    
    .media-kit-container .media-title {
        font-size: 15px;
        line-height: 1.4;
        margin: 10px 0;
    }
    
    .circular-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    #persistent-player,
    #usarm-direct-audio-player {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .player-controls {
        gap: 12px;
    }
    
    .player-controls button {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Stack form elements */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row > * {
        width: 100%;
    }
}

/* Mobile Small (480px and down) */
@media (max-width: 480px) {
    
    /* Maximum spacing for very small screens */
    .content,
    main,
    #main {
        padding: 20px 15px !important;
    }
    
    /* Posts need even more space on tiny screens */
    .post,
    .blog-post,
    article {
        margin-bottom: 35px !important;
        padding: 20px 15px !important;
    }
    
    /* Text readability on small screens */
    .post-content p,
    .entry-summary,
    .post-excerpt {
        font-size: 16px !important;
        line-height: 1.8 !important;
        margin-bottom: 20px !important;
    }
    
    /* Titles spacing */
    h1 {
        font-size: 24px !important;
        line-height: 1.2 !important;
        margin: 20px 0 15px 0 !important;
    }
    
    h2, h3 {
        margin: 20px 0 12px 0 !important;
        line-height: 1.3 !important;
    }
    
    .media-kit-container {
        padding: 15px;
        gap: 10px;
        margin: 20px 0;
    }
    
    .media-kit-container .media-title {
        font-size: 14px;
        line-height: 1.3;
        margin: 10px 0;
    }
    
    .circular-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    #persistent-player,
    #usarm-direct-audio-player {
        padding: 8px 10px;
        gap: 10px;
    }
    
    #current-title,
    #current-track-title {
        font-size: 12px;
    }
    
    .player-controls {
        gap: 10px;
    }
    
    .player-controls button {
        min-width: 36px;
        min-height: 36px;
    }
    
    /* Smaller accessibility toggle */
    .a11y-toggle-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Lightbox adjustments */
    .fullwidth-lightbox-overlay {
        padding: 15px;
    }
    
    .fullwidth-lightbox-image {
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 12px;
    }
}

/* ==========================================================================
   LANDSCAPE ORIENTATION (MOBILE)
   ========================================================================== */

@media (max-width: 768px) and (orientation: landscape) {
    
    #persistent-player,
    #usarm-direct-audio-player {
        flex-direction: row;
        padding: 8px 15px;
        max-height: 80px;
    }
    
    .player-info {
        text-align: left;
        flex: 1;
    }
    
    .player-controls {
        flex-shrink: 0;
        width: auto;
    }
    
    .fullwidth-lightbox-image {
        max-height: 80vh;
        max-width: 85vw;
    }
}

/* ==========================================================================
   TABLET SPECIFIC (768px to 1024px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    
    .media-kit-container {
        padding: 15px 18px;
        gap: 15px;
    }
    
    .media-kit-container .media-title {
        font-size: 15px;
    }
    
    .circular-btn {
        min-width: 42px;
        min-height: 42px;
    }
    
    #aircheck-search-input {
        width: 400px !important;
        font-size: 15px;
    }
}

/* ==========================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    
    /* Increase all touch targets */
    .circular-btn,
    .play-btn,
    .queue-btn,
    button {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }
    
    /* Remove hover effects on touch devices */
    .circular-btn:hover,
    .play-btn:hover,
    .queue-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Add active states instead */
    .circular-btn:active,
    .play-btn:active,
    .queue-btn:active {
        transform: scale(0.95);
        background-color: #8B1A1D;
    }
    
    /* Improve form input spacing */
    input,
    textarea,
    select {
        margin: 8px 0;
    }
}

/* ==========================================================================
   HIGH DPI DISPLAYS
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    
    .circular-btn img,
    .player-controls img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT (MOBILE)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    
    .media-kit-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .media-kit-container .media-title {
        color: #f7fafc;
    }
    
    .media-kit-container .meta-station,
    .media-kit-container .meta-dj {
        color: #a0aec0;
    }
    
    #persistent-player,
    #usarm-direct-audio-player {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-top-color: #AC2125;
    }
    
    .fullwidth-lightbox-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ==========================================================================
   PRINT STYLES (MOBILE)
   ========================================================================== */

@media print {
    
    #persistent-player,
    #usarm-direct-audio-player,
    .accessibility-toggle,
    .circular-btn,
    .play-btn,
    .queue-btn {
        display: none !important;
    }
    
    .media-kit-container {
        background: transparent !important;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .media-kit-container .media-title {
        color: #000 !important;
        font-weight: bold;
    }
}