/**
 * UnderScope Footer Fixes (sitewide)
 *
 * - Desktop: footer spans full viewport width (edge to edge)
 * - Tablet: search and subscribe bars stay within their quadrant (no overflow)
 */

/* Allow footer breakout — ancestors must not clip overflow */
html,
body,
#page,
.site,
body:has(footer),
body:has(#footer),
body:has(.rehub_footer),
body:has(.rh-footer),
.rh-outer-wrap,
.rh-outer-wrap:has(footer),
.rh-outer-wrap:has(#footer),
.rh-container:has(footer),
.rh-container:has(#footer),
main:has(footer),
main:has(#footer),
.wp-site-blocks:has(footer),
#page:has(footer),
.site:has(footer) {
  overflow-x: visible !important;
}

/* Desktop: footer spans full viewport width (edge to edge) */
@media (min-width: 1025px) {
  footer,
  #footer,
  .rehub_footer,
  .rh-footer,
  .footer,
  .site-footer,
  [data-elementor-type="footer"],
  .footer_widget_area,
  .rh-footer-wrap,
  .elementor-location-footer,
  .elementor-element[data-elementor-type="footer"],
  .elementor-section.elementor-location-footer {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    box-sizing: border-box;
  }
  /* Copyright bar at bottom — also full width */
  .footer-bottom,
  .rh-copyright,
  .copyright-bar,
  .site-info {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    box-sizing: border-box;
  }
  footer .rh-container,
  footer .container,
  #footer .rh-container,
  #footer .container,
  .rehub_footer .rh-container,
  .rh-footer .rh-container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Tablet: contain search and subscribe within their quadrant */
@media (min-width: 768px) and (max-width: 1024px) {
  footer .footer_widget,
  footer .footer-col,
  footer .footer_column,
  footer .elementor-widget-wrap,
  #footer .footer_widget,
  #footer .footer-col,
  .rehub_footer .footer_widget,
  .rh-footer .footer_widget {
    min-width: 0;
    overflow: hidden;
  }
  footer .custom_search_box,
  footer .wp-block-rehub-searchbox,
  footer .search-form,
  footer .mc4wp-form,
  footer .newsletter-form,
  footer [class*="subscribe"],
  #footer .custom_search_box,
  #footer .wp-block-rehub-searchbox,
  #footer .mc4wp-form,
  #footer [class*="subscribe"] {
    max-width: 100%;
    min-width: 0;
  }
  footer .custom_search_box form,
  footer .wp-block-rehub-searchbox form,
  footer .mc4wp-form form {
    flex-wrap: wrap;
    max-width: 100%;
  }
  footer .custom_search_box input[type="text"],
  footer .custom_search_box input[type="email"],
  footer .mc4wp-form input[type="email"] {
    max-width: 100%;
    box-sizing: border-box;
  }
}
