/* Quick Mobile Fixes for VU Institute of Computer Science Page */
/* 
   Add these styles to styles.css, particularly focusing on mobile responsiveness improvements
*/

/* 1. Desktop Grid Layout Adjustment for Smaller Laptops */
@media (max-width: 992px) {
    body {
        grid-template-columns: 200px 1fr;
    }
}

/* 2. Tablet and Mobile Layout - Single Column */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "banner"
            "menu"
            "content";
        padding-top: 60px; /* Account for banners */
    }

    #menu {
        grid-area: menu;
        border-right: none;
        border-bottom: 1px solid #ccc;
        overflow-y: auto;
        max-height: 200px; /* Limit menu height on mobile */
    }

    #content {
        grid-area: content;
        padding: 15px;
    }

    /* Improve mobile typography */
    .showdowncontainer p {
        line-height: 1.6;
        margin-bottom: 1em;
        font-size: 1em;
    }

    .showdowncontainer h1, 
    .showdowncontainer h2 {
        color: #333;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
        padding-bottom: 0.5em;
        border-bottom: 2px solid #e0e0e0;
    }

    .showdowncontainer h3, 
    .showdowncontainer h4 {
        margin-top: 1.2em;
        margin-bottom: 0.6em;
        color: #444;
    }

    .showdowncontainer ul,
    .showdowncontainer ol {
        margin-left: 1.5em;
        margin-bottom: 1em;
    }

    .showdowncontainer blockquote {
        margin: 1em 0;
        padding: 0.5em 1em;
        border-left: 4px solid #0366d6;
        background: linear-gradient(to right, rgba(3, 102, 214, 0.1), transparent);
        border-radius: 4px;
    }

    .showdowncontainer code {
        background: rgba(3, 102, 214, 0.1);
        padding: 0.2em 0.4em;
        border-radius: 4px;
        font-family: 'Courier New', Courier, monospace;
        color: #d63384;
    }

    .showdowncontainer pre {
        background: #f4f4f4;
        padding: 1em;
        border-radius: 8px;
        overflow-x: auto;
        border: 1px solid #ddd;
    }

    .showdowncontainer img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 1em auto;
    }

    .showdowncontainer table {
        width: 100%;
        border-collapse: collapse;
        margin: 1em 0;
    }

    .showdowncontainer th,
    .showdowncontainer td {
        border: 1px solid #ddd;
        padding: 0.75em;
        text-align: left;
    }

    .showdowncontainer th {
        background: #f4f4f4;
        font-weight: bold;
    }

    #banner {
        padding: 8px 15px;
    }

    .lang-switcher {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .lang-switcher a {
        width: 32px;
        height: 24px;
    }
}

/* 3. Very Small Mobile Screens (under 480px) */
@media (max-width: 480px) {
    .showdowncontainer h1 {
        font-size: 1.5em;
    }

    .showdowncontainer h2 {
        font-size: 1.3em;
    }

    #content {
        padding: 10px;
    }

    #menu {
        max-height: 150px;
        font-size: 0.9em;
    }

    .lang-switcher {
        right: 5px;
        gap: 6px;
        background: rgba(255,255,255,0.9);
    }

    .lang-switcher a {
        width: 28px;
        height: 20px;
    }
}

/* 4. Touch-Friendly Improvements */
@media (max-width: 768px) {
    .lang-switcher {
        top: 5px;
        transform: none;
    }

    .lang-switcher a {
        touch-action: manipulation;
    }

    .showdowncontainer a {
        word-wrap: break-word;
        hyphens: auto;
    }
}