/* Shared responsive layer for all BloodLife portals (loaded after page styles). */

img, video { max-width: 100%; }

/* Wide tables scroll inside their card instead of pushing the page sideways (wrapper added by responsive.js). */
.rsp-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    /* table-grid.css allows breaking anywhere, which crushes columns into "Ju n 22, 20 26" on phones.
       Break only at spaces and let the table scroll horizontally instead. */
    body table:not([role="presentation"]) > :is(thead, tbody, tfoot) > tr > :is(th, td),
    body table:not([role="presentation"]) > tr > :is(th, td) {
        overflow-wrap: normal;
        word-break: normal;
    }

    body table:not([role="presentation"]) > thead > tr > th { white-space: nowrap; }
}

/* ─── Donor / Seeker portal sidebars → off-canvas drawer on phones & tablets ─── */
.rsp-menu-toggle,
.rsp-drawer-backdrop { display: none; }

@media (max-width: 991.98px) {
    body.rsp-has-drawer .rsp-drawer-parent { display: block !important; }

    body.rsp-has-drawer .rsp-drawer {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(84vw, 300px) !important;
        max-width: 300px !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        transform: translateX(-105%);
        transition: transform .25s ease, box-shadow .25s ease;
        z-index: 1060 !important;
    }

    body.rsp-drawer-open .rsp-drawer {
        transform: translateX(0);
        box-shadow: 0 24px 60px rgba(15, 23, 42, .35) !important;
    }

    body.rsp-has-drawer .rsp-drawer-main {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        min-width: 0 !important;
    }

    body.rsp-has-drawer .rsp-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
        z-index: 1055;
    }

    body.rsp-drawer-open .rsp-drawer-backdrop { opacity: 1; pointer-events: auto; }
    body.rsp-drawer-open { overflow: hidden; }

    body.rsp-has-drawer .rsp-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        left: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 1050;
        border: 0;
        border-radius: 999px;
        padding: 12px 18px;
        background: #b91c1c;
        color: #fff;
        font: 700 14px/1 Inter, system-ui, sans-serif;
        box-shadow: 0 12px 28px rgba(185, 28, 28, .35);
        cursor: pointer;
    }

    body.rsp-has-drawer .rsp-menu-toggle:focus-visible { outline: 3px solid #fecaca; outline-offset: 2px; }

    /* The layout's back-to-top button also sits bottom-left; lift it above the Menu button. */
    body.rsp-has-drawer #scrollToTopButton { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; left: 16px !important; }
    body.rsp-drawer-open .rsp-menu-toggle { opacity: 0; pointer-events: none; }
}
