/**
 * User Articles Page - Mobile Styles
 * App-style design for lovesite.co.il
 * Works with site header and footer
 */

@media (max-width: 768px) {
    /* ========================================
       Page Body - Mobile
       ======================================== */
    body.user-articles-page-body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
    }

    /* Accessibility widget positioning */
    .a11y-widget-panel {
        z-index: 9999 !important;
        position: fixed !important;
    }

    /* ========================================
       MOBILE RESTRUCTURE SUPPORT
       JS moves articles-page to be direct child of body
       ======================================== */

    /* When JS has restructured, hide old content (header.php tables) */
    body.mobile-restructured > *:not(.articles-page):not(.mobile-header):not(.mobile-bottom-nav):not(.a11y-widget-panel):not(script):not(style):not(link) {
        display: none !important;
    }

    /* The articles-page after JS moves it */
    body.mobile-restructured > .articles-page {
        display: block !important;
    }

    /* ========================================
       Articles Page Wrapper - Mobile
       ======================================== */
    .articles-page {
        display: block !important;
        padding: 70px 12px 90px !important;
        min-height: 100vh !important;
        width: 100% !important;
        position: relative !important;
        z-index: 10 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Hide desktop back button */
    .back-button {
        display: none !important;
    }

    /* ========================================
       Hero Section - Mobile
       ======================================== */
    .hero-section {
        border-radius: 20px !important;
        padding: 24px 16px !important;
        margin-bottom: 20px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    }

    .hero-section::before {
        height: 4px !important;
    }

    .hero-header {
        margin-bottom: 20px !important;
    }

    .hero-icon {
        font-size: 48px !important;
        margin-bottom: 12px !important;
    }

    .hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 8px !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
    }

    .hero-stats {
        gap: 30px !important;
        margin-top: 16px !important;
    }

    .hero-stat-value {
        font-size: 1.6rem !important;
    }

    .hero-stat-label {
        font-size: 0.8rem !important;
    }

    /* ========================================
       Featured Article - Mobile
       ======================================== */
    .featured-article {
        border-radius: 16px !important;
        padding: 24px 16px !important;
        margin-top: 20px !important;
    }

    .featured-badge {
        top: -10px !important;
        right: 16px !important;
        padding: 6px 14px !important;
        font-size: 0.8rem !important;
        border-radius: 16px !important;
    }

    .featured-content {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .featured-visual {
        display: none !important;
    }

    .featured-text h3 {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }

    .featured-author {
        margin-bottom: 12px !important;
        gap: 8px !important;
    }

    .author-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    .author-info {
        font-size: 0.9rem !important;
    }

    .featured-excerpt {
        padding: 14px !important;
        border-radius: 10px !important;
        font-size: 0.95rem !important;
        margin-bottom: 16px !important;
        line-height: 1.7 !important;
    }

    .featured-cta {
        padding: 12px 24px !important;
        border-radius: 25px !important;
        font-size: 0.95rem !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .featured-cta:hover {
        transform: none !important;
    }

    .featured-cta:active {
        transform: scale(0.98) !important;
    }

    /* ========================================
       Articles Section - Mobile
       ======================================== */
    .articles-section {
        margin-top: 24px !important;
    }

    .section-header {
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }

    .section-title {
        font-size: 1.2rem !important;
        justify-content: center !important;
    }

    .write-btn {
        padding: 12px 20px !important;
        border-radius: 20px !important;
        font-size: 0.9rem !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .write-btn:hover {
        transform: none !important;
    }

    /* ========================================
       Articles Grid - Mobile
       ======================================== */
    .articles-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .article-card {
        border-radius: 14px !important;
    }

    .article-card:hover {
        transform: none !important;
    }

    .article-card:active {
        transform: scale(0.99) !important;
    }

    .article-card-header {
        padding: 16px !important;
    }

    .article-card-icon {
        font-size: 1.6rem !important;
        top: 12px !important;
        left: 12px !important;
    }

    .article-card-title {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }

    .article-card-body {
        padding: 16px !important;
    }

    .article-card-excerpt {
        font-size: 0.9rem !important;
        margin-bottom: 12px !important;
        line-height: 1.6 !important;
    }

    .article-card-meta {
        padding-top: 12px !important;
    }

    .article-card-author {
        font-size: 0.8rem !important;
        gap: 6px !important;
    }

    .article-card-author-avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }

    .article-card-link {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
        background: rgba(102, 126, 234, 0.1) !important;
        border-radius: 16px !important;
    }

    .article-card-link:hover {
        gap: 5px !important;
    }

    /* ========================================
       Empty State - Mobile
       ======================================== */
    .empty-state {
        padding: 40px 16px !important;
        border-radius: 16px !important;
    }

    .empty-icon {
        font-size: 60px !important;
        margin-bottom: 16px !important;
    }

    .empty-title {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }

    .empty-text {
        font-size: 0.95rem !important;
        margin-bottom: 20px !important;
    }

    .empty-cta {
        padding: 12px 24px !important;
        border-radius: 25px !important;
        font-size: 0.95rem !important;
        width: 100% !important;
        justify-content: center !important;
    }

    /* ========================================
       Pagination - Mobile
       ======================================== */
    .pagination {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 24px !important;
    }

    .pagination a,
    .pagination span {
        padding: 10px 14px !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
    }

    .pagination a:hover {
        transform: none !important;
    }

    /* ========================================
       Touch Feedback
       ======================================== */
    .article-card,
    .featured-cta,
    .write-btn,
    .empty-cta,
    .pagination a {
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    /* ========================================
       Safe Area Support (iPhone notch)
       ======================================== */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .articles-page {
            padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* Small phones */
@media (max-width: 375px) {
    .articles-page {
        padding: 65px 10px 85px !important;
    }

    .hero-section {
        padding: 20px 14px !important;
    }

    .hero-icon {
        font-size: 40px !important;
    }

    .hero-title {
        font-size: 1.4rem !important;
    }

    .hero-stats {
        gap: 20px !important;
    }

    .hero-stat-value {
        font-size: 1.4rem !important;
    }

    .featured-article {
        padding: 20px 14px !important;
    }

    .featured-text h3 {
        font-size: 1.1rem !important;
    }

    .article-card-header {
        padding: 14px !important;
    }

    .article-card-body {
        padding: 14px !important;
    }
}
