/**
 * Article View Mobile Menu Fixes
 * This file specifically addresses issues with the mobile menu in article view
 */

/* Only apply these fixes to mobile devices */
@media (max-width: 767px) {
    /* Main fixes for article view */
    .article-detail .article-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-top: 0 !important;
        margin-bottom: 15px !important;
        word-break: break-word !important;
        display: block !important;
        width: 100% !important;
        order: 1 !important;
    }
    
    /* Fix the article layout flow to ensure correct order */
    .article-detail {
        display: flex !important;
        flex-direction: column !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding: 0 !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }
    
    .article-detail .article-header {
        order: 0 !important;
        margin-bottom: 5px !important;
        background-color: #fff !important;
        border-radius: 8px !important;
        padding: 10px !important;
        margin-bottom: 0 !important;
    }
    
    .article-detail .article-featured-image-fixed,
    .article-detail .article-video {
        order: 2 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Place banner directly after featured image */
    .article-detail .article-banner {
        order: 3 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .article-detail .article-content-fixed {
        order: 4 !important;
        margin-top: 0 !important;
        background-color: #fff !important;
        border-radius: 8px !important;
        padding: 10px !important;
        margin-top: 5px !important;
    }
    
    /* Move share buttons to the bottom of the article */
    .article-detail .article-share-section,
    .article-detail .article-share-section-fixed {
        order: 5 !important;
        padding-top: 5px !important;
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        background-color: #fff !important;
        border-radius: 8px !important;
        padding: 10px !important;
        margin-top: 5px !important;
    }
    
    /* Fix for conflicting margin-top values */
    /* Override all other article container margin styles for mobile only */
    body.article-view {
        padding-top: 60px !important;
        margin-top: 0 !important;
    }
    
    body.article-view .article-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding: 5px !important;
    }
    
    /* Regular article container (not in article-view body class) */
    .article-container {
        margin-top: 0 !important;
        padding: 5px !important;
    }
    
    /* Menu toggle button visibility fixes */
    .menu-toggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Main menu positioning for article view */
    .main-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 80% !important;
        height: calc(100vh - 60px) !important;
        background-color: #222 !important;
        z-index: 999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        overflow-y: auto !important;
    }
    
    .main-menu.active {
        transform: translateX(0) !important;
    }
    
    /* Fix for header in article view */
    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        margin-bottom: 0 !important;
    }
    
    /* Make sure the logo is visible and centered */
    .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1002 !important;
        max-height: 40px !important;
    }
    
    .logo img {
        max-height: 40px !important;
        width: auto !important;
    }
    
    /* Menu overlay */
    .mobile-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 998 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s ease, visibility 0.3s ease !important;
    }
    
    .mobile-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Fix for navigation items */
    .nav-items, 
    .mobile-nav-items {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    .nav-item,
    .mobile-nav-item {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .nav-link,
    .mobile-nav-link {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        padding: 12px 15px !important;
        color: white !important;
        font-size: 1rem !important;
        text-decoration: none !important;
    }
    
    /* Fix for overall layout */
    body {
        padding-top: 60px !important;
        margin-top: 0 !important;
        background-color: #f5f5f5 !important;
    }
    
    main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Fix gaps between elements */
    .article-meta {
        margin-bottom: 5px !important;
    }
    
    /* Create spacing between content sections */
    .article-main > div {
        margin-bottom: 5px !important;
    }
} 