/* Shared footer only: isolate it from legacy page typography and widget gaps. */
body .main-footer {
    width: calc(100% - 48px) !important;
    max-width: none !important;
    margin: 48px auto 0 !important;
    padding: 48px 32px 32px !important;
    box-sizing: border-box !important;
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}
body .main-footer .container {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
body .main-footer .row {
    display: grid !important;
    grid-template-columns: 265px minmax(0, 1fr);
    align-items: center;
    gap: 32px 48px;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
body .main-footer [class*="footer-sidebar-"] {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
body .main-footer :is(.widget, figure, p, ul, li) {
    margin: 0 !important;
}
body .main-footer .wp-block-image {
    display: block;
    width: 265px;
    max-width: 100%;
}
body .main-footer .wp-block-image img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}
body .main-footer :is(p, a, li) {
    font-family: "Instrument Sans", sans-serif !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
}
body .main-footer p { font-size: 14.4px !important; }
body .main-footer :is(a, li) { font-size: 14px !important; }
body .main-footer .footer-sidebar-2,
body .main-footer .footer-sidebar-4 {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 16px 32px !important;
}
body .main-footer .footer-sidebar-2 a { white-space: nowrap; }
body .main-footer .footer-sidebar-2 .wp-block-social-links {
    padding: 0 !important;
    gap: 0 !important;
}
body .main-footer .footer-bottom {
    width: 100% !important;
    margin: 32px 0 0 !important;
    padding: 24px 0 0 !important;
    box-sizing: border-box !important;
}
body .main-footer .footer-bottom .row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px 40px;
}
body .main-footer .footer-sidebar-3 {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    text-align: left !important;
}
body .main-footer .footer-sidebar-3 p {
    text-wrap: balance;
    overflow-wrap: break-word;
}
@media (max-width: 991px) {
    body .main-footer {
        width: calc(100% - 24px) !important;
        margin-top: 32px !important;
        padding: 32px 24px !important;
    }
    body .main-footer .row,
    body .main-footer .footer-bottom .row {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 24px;
    }
    body .main-footer .wp-block-image { width: 240px; }
    body .main-footer .footer-sidebar-2,
    body .main-footer .footer-sidebar-4 {
        justify-content: center !important;
    }
    body .main-footer .footer-sidebar-3 {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    body .main-footer .footer-sidebar-3 .widget { max-width: 100%; }
}
@media (max-width: 600px) {
    body .main-footer { padding: 32px 20px !important; }
    body .main-footer .wp-block-image { width: 220px; }
    body .main-footer .footer-sidebar-2,
    body .main-footer .footer-sidebar-4 {
        flex-direction: column !important;
        gap: 12px !important;
    }
    body .main-footer .footer-sidebar-3 { max-width: 40ch !important; }
    body .main-footer .footer-bottom { margin-top: 24px !important; }
}
/* The RSS widget has a legacy full-row width; keep it with the other links. */
body .main-footer .footer-sidebar-2 > .widget {
    width: auto !important;
    flex: 0 0 auto !important;
}
body .main-footer .wp-social-link {
    display: block !important;
    padding: 0 !important;
}
body .main-footer .wp-block-social-link-anchor {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px !important;
    box-sizing: border-box;
    line-height: 1 !important;
}
body .main-footer .wp-block-social-link-anchor svg {
    display: block;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px;
}
/* These four legacy templates give the body 10px desktop side margins.
   Compensate within the footer without changing the rest of their content. */
@media (min-width: 1101px) {
    body:is(.page-id-700181,.page-id-700316,.page-id-700326,.page-id-700262) .main-footer {
        width: calc(100vw - 48px) !important;
        margin-left: 14px !important;
        margin-right: 0 !important;
    }
}
