/* Keep Divi's original layout while allowing the home slider to shrink on phones. */
@media (max-width: 980px) {
  body.home .et_pb_section_0.et_pb_fullwidth_section {
    height: auto;
  }
}

/* Archivarix serves missing uploads as a transparent 1px image. Remove the
   resulting empty Divi frames while retaining their neighbouring text. */
img[data-archive-missing="true"],
.et_pb_image:has(img[data-archive-missing="true"]),
.et_pb_main_blurb_image:has(img[data-archive-missing="true"]),
.et_pb_team_member_image:has(img[data-archive-missing="true"]),
.wp-caption:has(img[data-archive-missing="true"]) {
  display: none !important;
}

.et_pb_column:has(> .et_pb_image:only-child img[data-archive-missing="true"]) {
  display: none !important;
}

.et_pb_row:has(> .et_pb_column > .et_pb_image:only-child img[data-archive-missing="true"]) > .et_pb_column:not(:has(> .et_pb_image:only-child img[data-archive-missing="true"])) {
  width: 100% !important;
  margin-right: 0 !important;
}

/* The archive lacks Divi's base tab rules. Restore the original tab behaviour
   while preserving the equal-width variants from the child theme. */
.et_pb_tabs > .et_pb_tabs_controls {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0 !important;
  margin: 0;
}

.et_pb_tabs > .et_pb_tabs_controls > li {
  float: none;
  list-style: none;
  height: auto !important;
  margin: 0;
}

.et_pb_tabs > .et_pb_tabs_controls > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 12px;
}

.et_pb_tabs > .et_pb_all_tabs > .et_pb_tab {
  display: none;
}

.et_pb_tabs > .et_pb_all_tabs > .et_pb_tab.et_pb_active_content {
  display: block;
}

.et_pb_tabs > .et_pb_all_tabs > .et_pb_tab.et-pb-active-slide {
  display: block;
}

/* Product photos are absent from the archive; their columns and the empty
   spacer rows must not keep half-width cards and large white gaps. */
.et_pb_tabs .et_pb_row:has(> .et_pb_column_empty:only-child),
.et_pb_tabs .et_pb_text:has(.iconflex img[data-archive-missing="true"]),
.et_pb_tabs .et_pb_column:has(> .et_pb_image img[data-archive-missing="true"]):not(:has(> :not(.et_pb_image))) {
  display: none !important;
}

.et_pb_tabs .et_pb_row:has(> .et_pb_column > .et_pb_image img[data-archive-missing="true"]) > .et_pb_column:not(:has(> .et_pb_image img[data-archive-missing="true"])) {
  width: 100% !important;
  margin-right: 0 !important;
}

.et_pb_tabs .et_pb_tab_content .et_pb_row:has(> .et_pb_column > .et_pb_image img[data-archive-missing="true"]) {
  max-width: 860px !important;
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}

.et_pb_tabs .et_pb_tab_content .et_pb_row:has(> .et_pb_column > .et_pb_image img[data-archive-missing="true"]) .et_pb_text:has(h3) {
  margin-bottom: 24px !important;
}

/* The offers page contains an empty section after its sole banner. */
body.page-id-2934 #main-content .et_pb_section_1 {
  display: none;
}
