/* Morse Policy Forum | Member Portal Full-Viewport UX Pro v0.16.94.
 * Exclusively scoped to the Member Portal: no theme-wide selectors and no
 * changes to membership forms, gateways, public directory or other pages.
 */
/* Keep the site header at its own canonical width. Only the portal canvas
 * expands to the viewport, with comfortable, responsive left/right gutters.
 * Width is relative to the page main (not 100vw) to avoid scrollbar overflow. */
body.mpfm-member-portal-fullwidth {
    --mpfm-portal-canvas-width: calc(100% - clamp(32px, 4vw, 80px));
}

/* Both rendering routes retain the live theme header and footer. The regular
 * WordPress page gets a dedicated main element; the protected virtual route
 * already uses the protected-stage template and only needs a portal canvas. */
body.mpfm-member-portal-wordpress .mpfm-member-portal-page-main,
body.mpfm-member-portal-virtual .mpfm-protected-stage-template {
    display: flow-root;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: clamp(22px, 3vw, 44px) 0 clamp(50px, 5vw, 90px) !important;
    background: linear-gradient(180deg, #f3f7fb 0%, #fff 65%, #f6f9fd 100%);
}
body.mpfm-member-portal-wordpress .mpfm-member-portal-page-article,
body.mpfm-member-portal-wordpress .mpfm-member-portal-page-article > .entry-content,
body.mpfm-member-portal-wordpress .mpfm-member-portal-page-article > .et_builder_inner_content,
body.mpfm-member-portal-virtual .mpfm-protected-stage-template__article,
body.mpfm-member-portal-virtual .mpfm-protected-stage-template__content {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
}

/* Saved protected-stage width settings (60%-100%) must not constrain the
 * Member Portal. This targets the portal page only, preserving every other
 * virtual page's configurable layout and access restrictions. */
body.mpfm-member-portal-virtual .mpfm-vpage-main-section,
body.mpfm-member-portal-virtual .mpfm-vpage-container,
body.mpfm-member-portal-virtual .mpfm-vpage-content,
body.mpfm-member-portal-virtual .mpfm-vpage-no-wrapper {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.mpfm-member-portal-virtual .mpfm-vpage-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Genuine full-viewport member workspace, independent of the Command
 * Header's 1520px cap. Keep intentional internal layout proportions. */
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell {
    box-sizing: border-box;
    display: block;
    width: var(--mpfm-portal-canvas-width) !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell > * {
    min-width: 0;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-premium-profile-header {
    width: 100%;
    max-width: none;
    margin: 0 0 clamp(18px, 2vw, 28px);
    border-radius: clamp(18px, 2.2vw, 28px);
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-app-layout {
    display: grid;
    grid-template-columns: minmax(228px, 264px) minmax(0, 1fr);
    gap: clamp(15px, 1.9vw, 28px);
    align-items: start;
    width: 100%;
    min-width: 0;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-nav,
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panels,
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panel {
    min-width: 0;
    max-width: 100%;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panel {
    padding: clamp(18px, 2.4vw, 38px);
    border-radius: clamp(18px, 2.2vw, 28px);
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-nav {
    top: 22px;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-profile-edit-form {
    max-width: 1040px;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-security-form {
    max-width: 760px;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell :is(input, textarea, select) {
    max-width: 100%;
}
/* Explicitly allow embedded financial tables and file lists to scroll within
 * their own panel instead of shifting the entire page sideways. */
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panels {
    overflow-wrap: break-word;
}
body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panel :is(table, pre) {
    max-width: 100%;
}

@media (max-width: 1040px) {
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-app-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-tab {
        min-width: 0;
        padding: 11px 13px;
    }
}
@media (max-width: 660px) {
    body.mpfm-member-portal-wordpress .mpfm-member-portal-page-main,
    body.mpfm-member-portal-virtual .mpfm-protected-stage-template {
        padding-top: 18px !important;
        padding-bottom: 52px !important;
    }
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 10px;
        border-radius: 19px;
    }
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-tab {
        padding: 11px 10px;
        border-radius: 13px;
        font-size: 13px;
        overflow-wrap: anywhere;
    }
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-panel {
        padding: 18px 14px;
        border-radius: 18px;
    }
}
@media (max-width: 360px) {
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-nav {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (prefers-reduced-motion: reduce) {
    body.mpfm-member-portal-fullwidth .mpfm-member-portal-shell .mpfm-portal-tab {
        transition: none;
    }
}
