/* SIM swipe rows (ported from the Just Mercy swipe lists).
   Add the class `sim-swipe` to a row of cards. Below 1280px wide it becomes a horizontal scroll-snap track with
   dots; at 1280 and up the row keeps its own layout. The page sets how wide each card is per screen size with
   --swipe-card, and how far the track bleeds out of its padded box with --swipe-bleed.
   Scoped under #brx-content so it beats Bricks' own layout rules without !important. */

.sim-swipe__dots { display: none; }

@media (max-width: 79.99rem) {
  #brx-content .sim-swipe {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start; /* never centre a scroller: the left half would be out of reach */
    gap: var(--swipe-gap, 1rem);
    width: calc(100% + 2 * var(--swipe-bleed, 0px)); /* explicit width: an auto-width nowrap row sizes to max-content */
    max-width: none;
    margin-inline: calc(-1 * var(--swipe-bleed, 0px));
    padding-inline: var(--swipe-bleed, 0px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--swipe-bleed, 0px);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  #brx-content .sim-swipe::-webkit-scrollbar { display: none; }
  #brx-content .sim-swipe > * {
    flex: 0 0 var(--swipe-card, 85%);
    width: var(--swipe-card, 85%);
    max-width: none;
    min-width: 0;
    height: auto;
    scroll-snap-align: start;
  }
  .sim-swipe__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin-top: 1.5rem;
  }
}

/* Each dot is a 24px button with an 8px drawn dot, pulled back so the drawn dots sit 16px apart. */
.sim-swipe__dot {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-inline: -.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sim-swipe__dot::before {
  content: '';
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--swipe-dot, #14332d);
  opacity: .3;
  transition: opacity .2s ease-out;
}
.sim-swipe__dot:hover::before { opacity: .6; }
.sim-swipe__dot.is-active::before { opacity: 1; }
.sim-swipe__dot:focus-visible { outline: 2px solid var(--swipe-dot, #14332d); outline-offset: 2px; border-radius: 50%; }
.sim-swipe__dots[hidden] { display: none; }
