/* ==========================================================
   Mobile card slider (shared). Markup driven, see slider.js.
   Any container with [data-mslider] becomes a horizontal swipe slider at <= 960px.
   Above 960px nothing here applies, the page's own layout is untouched.

   Per instance knobs (set on the container, usually from the page CSS):
     --ms-w       slide width            (default 84%)
     --ms-gap     gap between slides     (default 12px)
     --ms-accent  active dot colour      (default currentColor)
     --ms-bleed   edge padding / bleed   (default var(--gutter), 0 for no bleed)
   ========================================================== */

.ms-nav { display: none; }

@media (max-width: 960px) {
  [data-mslider][data-mslider] {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--ms-gap, 12px);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--ms-bleed, var(--gutter, 16px));
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    /* Bleed: the track runs to the screen edge, content stays on the gutter so the next card peeks */
    margin-left: calc(-1 * var(--ms-bleed, var(--gutter, 16px)));
    margin-right: calc(-1 * var(--ms-bleed, var(--gutter, 16px)));
    padding-left: var(--ms-bleed, var(--gutter, 16px));
    padding-right: var(--ms-bleed, var(--gutter, 16px));
    /* Room for card shadows, without clipping them on the vertical axis */
    padding-top: 4px;
    padding-bottom: 6px;
    align-items: stretch;
    list-style: none;
  }
  [data-mslider][data-mslider]::-webkit-scrollbar { display: none; }

  [data-mslider][data-mslider] > * {
    flex: 0 0 var(--ms-w, 84%);
    width: var(--ms-w, 84%);
    max-width: none;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    margin: 0;
  }

  /* Generated controls */
  .ms-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
  .ms-nav[hidden] { display: none; }
  .ms-dots { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; }
  .ms-dot { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ms-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 999px;
    background: currentColor; opacity: .28; transition: width .3s cubic-bezier(.2,.8,.2,1), margin-left .3s cubic-bezier(.2,.8,.2,1), opacity .3s ease, background-color .3s ease; }
  .ms-dot[aria-current="true"]::before { width: 22px; margin-left: -11px; opacity: 1; background: var(--ms-accent, currentColor); }
  .ms-dot:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; border-radius: 10px; }
  .ms-arrows { display: flex; gap: 8px; flex: none; }
  .ms-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer; color: inherit; background: transparent;
    border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 28%, transparent); -webkit-tap-highlight-color: transparent;
    transition: opacity .25s ease, background-color .25s ease; }
  .ms-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .ms-btn:active { background: color-mix(in srgb, currentColor 12%, transparent); }
  .ms-btn:disabled { opacity: .3; cursor: default; }
  .ms-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
}

@media (max-width: 960px) and (prefers-reduced-motion: reduce) {
  .ms-dot::before { transition: none; }
}
