/*
 * Keep the existing construction-gallery route in normal document flow.
 * The original Avada export can leave an inline gallery height behind while
 * the API renderer replaces its children, which otherwise pulls the footer up.
 */
main.site-gallery-route-main,
main.site-gallery-route-main > .fusion-row,
main.site-gallery-route-main #content,
main.site-gallery-route-main .post-content {
  display: flow-root !important;
  position: relative !important;
  float: none !important;
  height: auto !important;
  min-height: 1px !important;
  overflow: visible !important;
  clear: both !important;
}

main.site-gallery-route-main + .fusion-tb-footer,
main.site-gallery-route-main + .fusion-footer {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  float: none !important;
  clear: both !important;
  height: auto !important;
  transform: none !important;
}

.fusion-gallery-container.site-gallery-runtime-target {
  display: flow-root !important;
  position: relative !important;
  height: auto !important;
  min-height: 1px !important;
  overflow: visible !important;
}

.fusion-gallery-container.site-gallery-runtime-target > .site-gallery-app {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 1px !important;
}

.fusion-gallery-container.site-gallery-runtime-target .site-gallery-grid {
  position: relative !important;
  height: auto !important;
  min-height: 1px !important;
}

.fusion-gallery-container.site-gallery-runtime-target .site-gallery-item,
.fusion-gallery-container.site-gallery-runtime-target .site-gallery-card {
  position: relative !important;
  height: auto !important;
}

.awb-gallery-wrapper:has(> .fusion-gallery-container) {
  display: flow-root !important;
  position: relative !important;
  height: auto !important;
  min-height: 1px !important;
}

.fusion-gallery-container:not(.site-gallery-runtime-target) {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  height: auto !important;
  min-height: 1px !important;
  margin: 0 !important;
}

.fusion-gallery-container:not(.site-gallery-runtime-target) > .fusion-gallery-column {
  position: relative !important;
  inset: auto !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

.fusion-gallery-container:not(.site-gallery-runtime-target) > .fusion-clearfix {
  display: none !important;
}

.fusion-tb-footer,
.fusion-footer {
  position: relative !important;
  inset: auto !important;
  clear: both !important;
}

@media (max-width: 1100px) {
  .fusion-gallery-container:not(.site-gallery-runtime-target) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .fusion-gallery-container:not(.site-gallery-runtime-target) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .fusion-gallery-container:not(.site-gallery-runtime-target) {
    grid-template-columns: 1fr;
  }
}
