/* =========================================================
   MOBILE RESPONSIVENESS ENHANCEMENTS (css/mobile.css)
   Desktop (>= 768px) layout remains unchanged; only fluid
   media constraints apply globally.
   ========================================================= */

/* Fluid media across all viewports */
img,
video,
iframe,
canvas {
    max-width: 100%;
}

img,
video {
    height: auto;
}

/* Mobile-only layout, readability & tap-target rules */
@media (max-width: 767px) {
    /* Clip horizontal overflow without breaking sticky elements */
    html,
    body {
        overflow-x: clip;
        max-width: 100%;
    }

    main,
    section,
    header,
    footer,
    #slot-navbar,
    #slot-hero,
    #slot-architecture,
    #slot-command-os,
    #slot-vaultrag,
    #slot-projects,
    #slot-agency,
    #slot-academy,
    #slot-footer {
        max-width: 100%;
    }

    /* Prevent horizontal bloat inside flex/grid items & overlays */
    .consult-modal-card,
    .legal-modal-card,
    #health-tech-notes-modal > div,
    #ns-shell,
    #warroom-embed-container {
        max-width: 100%;
    }

    /* Word & URL wrapping */
    p,
    li,
    h1,
    h2,
    h3,
    h4,
    blockquote,
    dd,
    dt,
    a {
        overflow-wrap: anywhere;
    }

    /* Scroll code blocks & tables inside their own containers */
    pre,
    table {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Readable 16px body text & descriptive copy (keeps uppercase badges/labels & monospace telemetry compact) */
    section p:not(.uppercase):not(.font-mono):not(.font-code):not([class*="tracking-widest"]):not([class*="tracking-wider"]),
    section li,
    #why-arzel p,
    #notes-modal-content p,
    #notes-modal-content li,
    #legal-modal-body p,
    #legal-modal-body li,
    #ns-transition-details li {
        font-size: 16px;
        line-height: 1.6;
    }

    /* 16px form inputs prevent iOS Safari zoom on tap */
    input:not([type="hidden"]):not(.hidden),
    textarea,
    select {
        font-size: 16px !important;
        min-height: 44px;
    }

    /* 44x44px minimum tap targets across interactive controls */
    button:not([tabindex="-1"]),
    [role="button"],
    a[class*="px-"],
    a[class*="py-"],
    #theme-toggle-btn,
    #mobile-menu-btn,
    .notes-tab-btn,
    .legal-tab-btn,
    .consult-service-btn,
    .consult-pill,
    .consult-alt-btn,
    .cmd-scenario-tab,
    #vault-tab-retriever,
    #vault-tab-guardrail,
    #vault-tab-worm,
    #warroom-modal .nav-item,
    #floating-contact-pill,
    #floating-contact-card a,
    #floating-contact-card button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Center & size header buttons + mobile nav drawer links */
    #theme-toggle-btn,
    #mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #mobile-menu a,
    #mobile-menu button {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Expand compact footer links/buttons to 44px tap targets */
    footer a,
    footer button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* Align compact terminal/dashboard tab buttons vertically */
    #vault-tab-retriever,
    #vault-tab-guardrail,
    #vault-tab-worm,
    .notes-tab-btn,
    .legal-tab-btn,
    .consult-service-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
