/* ===== Content Cards Slider ===== */
.rt{
  --rt-bg:#FFF9F3;
  --rt-gap:16px;
  --rt-pad:24px;
  --rt-card-pad:28px;

  background:var(--rt-bg);
  padding:var(--rt-pad);
  position:relative;
  width:100%;
  box-sizing:border-box;
}

/* edge paint guards (cover sub-pixel gaps) */
.rt::before,
.rt::after{
  content:"";
  position:absolute;
  top:0; bottom:0;
  width:8px;
  background:var(--rt-bg);
  pointer-events:none;
}
.rt::before{ left:0; }
.rt::after{ right:0; }

/* Track must be scrollable */
.rt-track{
  display:flex;
  flex-wrap:nowrap;
  gap:var(--rt-gap);
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;
}
/* hide the scrollbar, keep scrolling */
.rt-track::-webkit-scrollbar{ display:none; }
.rt-track{ scrollbar-width:none; -ms-overflow-style:none; }

/* Let flex items actually shrink on mobile and kill HS hard mins */
.rt-track,
.rt-slide,
.rt-card,
.rt-content { min-width: 0 !important; }

/* Anything inside the rich text can’t be wider than the card */
.rt-content > * { max-width: 100% !important; box-sizing: border-box; }

/* HS embed wrappers sometimes set min-width; zero that out */
.rt-content .hs-embed-wrapper,
.rt-content .hs-embed-wrapper *,
.rt-content .hs-form,
.rt-content iframe,
.rt-content img { min-width: 0 !important; }

/* As an extra guard in the iframe-in-app world, clip any sub-pixel bleed */
@media (max-width: 768px){
  .rt { overflow-x: clip; }          /* modern */
  @supports not (overflow: clip){ .rt { overflow-x: hidden; } }
}

/* One full viewport per slide */
.rt-slide{
  flex:0 0 100%;
  display:flex;
  justify-content:center;
}

/* Card */
.rt-card{
  width:100%;
  max-width:min(960px,100%);
  background:var(--rt-bg);
  border-radius:18px;
  box-shadow:none;
  padding:var(--rt-card-pad);
  display:grid;
  place-items:center;
  min-height:320px;
}

.rt-content{ width:100%; text-align:center; }
.rt-content img,
.rt-content video,
.rt-content iframe{ max-width:100%; height:auto; }
.rt-content .hs-form{ min-height:240px; }

/* Arrows */
.rt-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  background:transparent; border:0; color:#000;
  font-size:30px; line-height:1; padding:6px 10px;
  cursor:pointer; z-index:5; user-select:none;
}
.rt-prev{ left:10px; }
.rt-next{ right:10px; }

/* Kill theme hover/focus styles on slider arrows */
.rt .rt-nav{
  -webkit-appearance:none;
  appearance:none;
  background:transparent !important;
  color:#000 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

.rt .rt-nav:hover,
.rt .rt-nav:active,
.rt .rt-nav:focus{
  background:transparent !important;
  color:#000 !important;
  box-shadow:none !important;
}

/* Keep or remove focus ring—your call */
.rt .rt-nav:focus-visible{
  outline: 0;               /* remove completely */
  /* or: outline:2px solid #111; outline-offset:2px;  (subtle accessible ring) */
}

/* Dots (small and immune to theme button styles) */
.rt-dots{ display:flex; justify-content:center; gap:4px; padding-top:10px; }
.rt-dots .rt-dot{
  all:unset;
  width:6px; height:6px; border-radius:50%;
  background:#cfcfcf; display:inline-block; cursor:pointer;
}
.rt-dots .rt-dot.is-active{ background:#111; }
.rt-dots .rt-dot:focus-visible{ outline:2px solid #000; outline-offset:2px; }

/* Hide controls if single slide */
.rt--single .rt-nav, .rt--single .rt-dots{ display:none !important; }

/* ===== Mobile containment & no sideways bleed ===== */
@media (max-width:768px){
  .rt{
    --rt-ui:60px;
    --rt-pad:20px;
    --rt-card-pad:16px;

    width:min(100%,100vw);
    max-width:100vw;
    overflow-x:clip;
  }
  @supports not (overflow:clip){ .rt{ overflow-x:hidden; } }

  /* lock finger-swipe horizontally; arrows still scroll via JS */
  .rt-track{
    overflow-x:hidden;
    touch-action:pan-y;
    overscroll-behavior-x:contain;
  }

  /* buffer to absorb rounding (set to 6px) */
  .rt-track::before,
  .rt-track::after{
    content:"";
    flex:0 0 10px;
  }

  /* keep slides/cards within the viewport; long content scrolls inside */
  .rt-slide{
    min-height:calc(100dvh - var(--rt-ui));
    align-items:stretch;
  }
  .rt-card{
    max-height:calc(100dvh - (var(--rt-pad)*2) - var(--rt-ui));
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }

  .rt-prev{ left:6px; }
  .rt-next{ right:6px; }
  .rt-nav:focus-visible{ outline-offset:-3px; }

  .rt-dots{ padding-top:8px; }
}

/* Optional full-bleed utility */
@media (max-width:768px){
  .rt--fullbleed{
    margin-left:calc(50% - 50vw);
    margin-right:calc(50% - 50vw);
    width:100vw;
  }
}
