/* MOBILE CSS - with z-index fix that makes links work */

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* Hide floating menu completely */
.mobile-more-menu {
    display: none !important;
}

@media (max-width: 768px) {
    /* THE MAGIC FIX - z-index hierarchy */
    .story, .story-link {
        position: relative;
        z-index: 1;
    }
    
    .category-nav {
        position: relative;
        z-index: 1000;
    }
    
    .category-nav-inner {
        position: relative;
        z-index: 1001;
    }
    
    .nav-link {
        position: relative;
        z-index: 1002;
    }

    a, button, [role="button"], input[type="submit"] {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(245, 158, 11, 0.3);
    }

    /* Prevent scroll-triggered link opens */
    .story-link {
        touch-action: manipulation;
    }

    .story-source a,
    .share-btn-small,
    .footer-links a {
        min-height: auto;
    }

    .nav-link {
        font-size: 0.7rem;
        padding: 10px 12px;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    .category-nav {
        margin-left: -20px;
        margin-right: -20px;
        padding: 0;
    }

    .category-nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 8px;
    }

    .category-nav-inner::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        font-size: 0.65rem;
        padding: 10px 10px;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 44px;
    }

    .logo {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .footer-links a {
        display: inline-block;
        padding: 4px 0;
    }
}

@media (max-width: 400px) {
    .nav-link {
        font-size: 0.6rem;
        padding: 10px 8px;
    }

    .logo {
        font-size: 1.5rem;
    }
}
