/* Static first paint uses the same card widths and gaps as the guarded Owl
   replacement. Keep image heights intrinsic, as in this site's child theme. */
html.usaip-site-performance .recent-gallery {
  min-width: 0;
}
html.usaip-site-performance .recent-gallery-wrapper {
  --usaip-site-poster-width: calc((100% - 6.4px) / 1.2);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
html.usaip-site-performance .recent-gallery-wrapper:not(.owl-loaded) {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 32px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
html.usaip-site-performance .recent-gallery-wrapper:not(.owl-loaded)::-webkit-scrollbar {
  display: none;
}
html.usaip-site-performance .recent-gallery-wrapper:not(.owl-loaded) > .gallery-item {
  flex: 0 0 var(--usaip-site-poster-width);
  width: var(--usaip-site-poster-width);
  min-width: 0;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
html.usaip-site-performance .recent-gallery-wrapper:not(.owl-loaded) > .gallery-item > img {
  display: block;
  width: 100%;
  height: auto;
}
html.usaip-site-performance .recent-gallery-wrapper.owl-loaded {
  display: block;
  overflow: hidden;
}
html.usaip-site-performance .recent-gallery-wrapper .owl-stage-outer {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
html.usaip-site-performance .recent-gallery-wrapper .owl-stage {
  display: flex;
  align-items: flex-start;
}
html.usaip-site-performance .recent-gallery-wrapper .owl-item {
  flex-shrink: 0;
}
html.usaip-site-performance .recent-gallery-wrapper .owl-item > .gallery-item {
  width: 100%;
}
@media (min-width: 600px) {
  html.usaip-site-performance .recent-gallery-wrapper {
    --usaip-site-poster-width: calc((100% - 64px) / 3);
  }
}
@media (min-width: 1000px) {
  html.usaip-site-performance .recent-gallery-wrapper {
    --usaip-site-poster-width: calc((100% - 128px) / 5);
  }
}

/* Testimonials remain one row while below the initialization margin. */
html.usaip-site-performance :is(#testicar1, #testicar2) .owl-carousel .htb-row:not(.owl-loaded) {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 48px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
html.usaip-site-performance :is(#testicar1, #testicar2) .owl-carousel .htb-row:not(.owl-loaded)::-webkit-scrollbar {
  display: none;
}
html.usaip-site-performance :is(#testicar1, #testicar2) .owl-carousel .htb-row:not(.owl-loaded) > :not(.owl-stage-outer) {
  flex: 0 0 calc((100% - 9.6px) / 1.2);
  width: calc((100% - 9.6px) / 1.2);
  max-width: none;
  padding: 0;
}
@media (min-width: 600px) {
  html.usaip-site-performance :is(#testicar1, #testicar2) .owl-carousel .htb-row:not(.owl-loaded) > :not(.owl-stage-outer) {
    flex-basis: calc((100% - 120px) / 3.5);
    width: calc((100% - 120px) / 3.5);
  }
}

/* Never reveal an inactive Elementor tab or alter the desktop grid. */
@media (max-width: 768px) {
  html.usaip-site-performance #just-added .e-active.owl-carousel > .e-con-inner:not(.owl-loaded) {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  html.usaip-site-performance #just-added .e-active.owl-carousel > .e-con-inner:not(.owl-loaded) > :not(.owl-stage-outer) {
    flex: 0 0 calc((100% - 20px) / 2);
  }
}
@media (prefers-reduced-motion: reduce) {
  html.usaip-site-performance .recent-gallery-wrapper .owl-stage,
  html.usaip-site-performance :is(#testicar1, #testicar2) .owl-carousel .owl-stage,
  html.usaip-site-performance #just-added .owl-carousel > .e-con-inner .owl-stage {
    transition-duration: 0s !important;
  }
}
