/* Mobile polish overrides and utilities */

/* Prevent horizontal scrolling due to wide content */
html, body {
  overflow-x: hidden;
}

/* Ensure media scales down on small screens */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Keep iframes from overflowing; for full responsive ratio use .responsive-embed */
iframe {
  max-width: 100%;
  border: 0;
}

/* Utility: wrap embeds to maintain 16:9 aspect ratio */
.responsive-embed {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
}
.responsive-embed iframe,
.responsive-embed embed,
.responsive-embed object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Utility: horizontally scrollable wrapper for wide tables or code blocks */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 600px;
}

/* Hero/heading fixes for small screens (Divi breakpoint) */
@media (max-width: 980px) {
  /* Make main content container full-width on mobile */
  #et-main-area #main-content .container {
    width: 100% !important;
    max-width: none !important;
  }
  /* Only affect the first hero section */
  #et-main-area #main-content .et_pb_section_0 {
    padding-left: 5% !important;
    padding-right: 5% !important;
  }
  #et-main-area #main-content .et_pb_section_0 .et_pb_row {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
  }
  #et-main-area #main-content .et_pb_section_0 .et_pb_column {
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #et-main-area #main-content .et_pb_section_0 .et_pb_heading_0 .et_pb_heading_container,
  #et-main-area #main-content .et_pb_section_0 .et_pb_heading_0 .et_pb_module_heading {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
    display: block !important;
  }
}

/* Full-bleed hero in Safari portrait: detach from centered container */
@media (max-width: 980px) and (orientation: portrait) {
  #et-main-area #main-content .et_pb_section_0 {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 5vw !important;
    padding-right: 5vw !important;
  }
  #et-main-area #main-content .et_pb_section_0 .et_pb_row {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Explicitly remove any heading module caps in hero */
@media (max-width: 980px) {
  #et-main-area #main-content .et_pb_section_0 .et_pb_heading_0,
  #et-main-area #main-content .et_pb_section_0 .et_pb_heading_0 .et_pb_heading_container,
  #et-main-area #main-content .et_pb_section_0 .et_pb_heading_0 .et_pb_module_heading {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
    display: block !important;
    text-align: left !important;
  }
}

  }
  .et_pb_section_0 .et_pb_module_heading {
    display: block !important;
    white-space: normal !important;
    word-break: normal !important;
  }
  /* Ensure the first column in the hero is not constrained */
  .et_pb_section_0 .et_pb_column_0 {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* As a last resort, expand the H1 itself */
  .et_pb_section_0 .et_pb_heading_0 h1.et_pb_module_heading {
    display: block !important;
    width: 100% !important;
  }
}
