/* MWORC site-wide responsive safeguards. */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

img,
picture,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

img,
video,
canvas {
    height: auto;
}

.entry-content,
.site-content,
.site-main,
.elementor,
.elementor-section,
.elementor-container,
.elementor-widget-wrap,
.elementor-widget-container {
    min-width: 0;
}

.entry-content pre,
.entry-content code,
.entry-content table {
    max-width: 100%;
}

.entry-content pre,
.entry-content table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 921px) {
    .ast-primary-header-bar .site-primary-header-wrap,
    .site-header .ast-container,
    .site-content .ast-container {
        padding-right: 16px;
        padding-left: 16px;
    }

    .ast-header-break-point .main-header-menu .menu-link,
    .ast-header-break-point .main-header-menu .sub-menu .menu-link {
        min-height: 44px;
        padding: 10px 18px;
        line-height: 1.4;
    }

    .ast-header-break-point .ast-menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 767px) {
    html {
        scroll-padding-top: 72px;
    }

    body,
    p,
    li,
    a,
    button,
    input,
    select,
    textarea {
        overflow-wrap: anywhere;
    }

    .site-branding img,
    .custom-logo {
        width: auto;
        max-width: min(34vw, 132px);
        height: auto;
    }

    /* Elementor exports 244–326px fixed widths on several MWORC pages. */
    .elementor .e-con,
    .elementor .e-con.e-child,
    .elementor .e-con.e-parent {
        --width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .elementor .elementor-widget {
        --container-widget-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .elementor .elementor-widget-container {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .elementor .e-con-inner {
        width: 100%;
        max-width: 100%;
    }

    .elementor-widget-heading h1.elementor-heading-title,
    .entry-content h1 {
        font-size: clamp(2rem, 9vw, 2.65rem) !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere;
    }

    .elementor-widget-heading h2.elementor-heading-title,
    .entry-content h2 {
        font-size: clamp(1.75rem, 8.5vw, 2.25rem) !important;
        line-height: 1.16 !important;
        overflow-wrap: anywhere;
    }

    .elementor-widget-heading h3.elementor-heading-title,
    .entry-content h3 {
        font-size: clamp(1.35rem, 6.5vw, 1.75rem) !important;
        line-height: 1.2 !important;
    }

    .entry-content p,
    .entry-content li,
    .elementor-widget-text-editor {
        line-height: 1.55;
    }

    /* Avoid the large word gaps produced by justified mobile paragraphs. */
    .site-main .elementor-widget-text-editor,
    .site-main .elementor-widget-text-editor p {
        text-align: left !important;
        text-justify: auto;
    }

    /* Keep the introductory hero copy centered. */
    .site-main .elementor > .e-con:first-child .elementor-widget-text-editor,
    .site-main .elementor > .e-con:first-child .elementor-widget-text-editor p {
        text-align: center !important;
    }

    .elementor-widget-button,
    .elementor-widget-button .elementor-button-wrapper {
        max-width: 100%;
    }

    .elementor-widget-button .elementor-button,
    .entry-content .button,
    .entry-content button,
    .entry-content input[type="button"],
    .entry-content input[type="submit"] {
        max-width: 100%;
        min-height: 44px;
        white-space: normal;
    }

    .entry-content input:not([type="checkbox"]):not([type="radio"]),
    .entry-content select,
    .entry-content textarea,
    .wpforms-container input:not([type="checkbox"]):not([type="radio"]),
    .wpforms-container select,
    .wpforms-container textarea,
    .forminator-ui input:not([type="checkbox"]):not([type="radio"]),
    .forminator-ui select,
    .forminator-ui textarea {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    .wpforms-container .wpforms-field-row,
    .wpforms-container .wpforms-field-row-block,
    .forminator-ui .forminator-row,
    .give-form-wrap,
    .give-form,
    .give-donation-levels-wrap {
        width: 100%;
        max-width: 100%;
    }

    .entry-content table,
    .woocommerce table.shop_table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* SureCart's alignwide product list uses negative desktop margins. */
    .entry-content .wp-block-surecart-product-list,
    .entry-content .wp-block-surecart-product-list.alignwide,
    .wp-block-surecart-product-list-content,
    .wp-block-surecart-product-template-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .wp-block-surecart-product-list > .wp-block-group {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap !important;
        gap: 12px;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .wp-block-surecart-product-list-search,
    .wp-block-surecart-product-list-search .sc-form-control {
        width: 100% !important;
        max-width: 100% !important;
    }

    .wp-block-surecart-product-list-content {
        display: block !important;
    }

    .elementor iframe,
    .entry-content iframe {
        width: 100%;
    }

    /* The large source asset is used as a footer mark, not a hero image. */
    .elementor img.wp-image-471 {
        width: min(68vw, 240px) !important;
        max-width: 240px !important;
        height: auto !important;
    }

    /* Keep grouped footer/social icons in a compact horizontal row. */
    .elementor .e-con:has(> .elementor-widget-icon + .elementor-widget-icon) {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 14px !important;
    }

    .elementor .e-con:has(> .elementor-widget-icon + .elementor-widget-icon) > .elementor-widget-icon {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 480px) {
    .site-header .ast-container,
    .site-content .ast-container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .elementor .e-con {
        --container-default-padding-top: 14px;
        --container-default-padding-right: 14px;
        --container-default-padding-bottom: 14px;
        --container-default-padding-left: 14px;
    }

    .woocommerce ul.products[class*="columns-"] {
        grid-template-columns: minmax(0, 1fr);
    }

    .woocommerce ul.products[class*="columns-"] li.product {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
}
