/* ==========================================================================
   Mobile View Fixes (mobile-fixes.css)
   This stylesheet applies structural overrides for smaller screens to 
   prevent layout breaking and horizontal scrolling.
   ========================================================================== */

/* Target screens smaller than 768px (standard mobile/tablet breakpoint) */
@media screen and (max-width: 768px) {
    
    /* 1. Prevent horizontal scrolling on the whole page */
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* 2. Hide the sidebar completely on mobile to reclaim the space */
    .sidebar {
        display: none !important;
    }

    /* 3. Tell the main content area to take up the full screen */
    .main {
        width: 100% !important;
        margin-left: 0 !important; /* Removes the gap left by the desktop sidebar */
        padding: 15px !important;  /* Gives your text some breathing room off the edges */
        box-sizing: border-box;
    }
    
    /* 4. Ensure your code blocks don't force the screen to stretch */
    pre, code, .code-block, div[class*="language-"] {
        max-width: 100%;
        overflow-x: auto !important; /* Allows users to swipe left/right inside the code block itself */
        word-wrap: break-word; /* Failsafe for long unbroken strings */
        box-sizing: border-box;
    }
    
    /* 5. Ensure images are responsive and don't break the layout */
    img {
        max-width: 100%;
        height: auto;
    }
}