/*! GoodCycle slider component (copied from the Moodi setup) — static fallback + Swiper (https://swiperjs.com/), initialised by js/main.js.
    Markup: .slider > .swiper.slider__viewport > ul.swiper-wrapper.slider__track > li.swiper-slide.slider__slide
            + .slider__nav (partial components/slider/slider-nav.html)
    Static (no JS): the viewport is a native horizontal scroll row (no scrollbar, scroll-snap),
    which reproduces the Figma "peek" of the next slide at the frame edge.
    Swiper: add data-slider (+ optional preset name / data-slider-options) on .slider; js/main.js lazy-loads
    js/slider.js. Once Swiper adds .swiper-initialized the static scroll rules switch off and Swiper's
    transform layout takes over at the same positions (slidesPerView 'auto'; widths from
    --slider-slide-width, gap from --slider-gap, offsets from --slider-offset). See README "Sliders".
    Modifiers (one per preset type, named by what they hold):
               .slider--step-cards         "Two simple steps" cards (mobile-only variant)
               .slider--ingredient-cards   ingredient image cards
               .slider--review-cards       compact product review cards (product section)
               .slider--testimonial-cards  tall "Real Voices" cards, next arrow from 750px
               .slider--article-cards      "Your Cycle Digest" article cards
               .slider--bleed          slides run past the container to the viewport edge (the section clips)
               .slider--nav-tablet-up  optional: hides the arrows below 750px (CSS, so nothing flashes before JS)
    Configure per instance with custom properties on the .slider element:
      --slider-slide-width   width of one slide                       (default 267px)
      --slider-gap           space between slides (= Swiper spaceBetween) (default 15px)
      --slider-offset        inline start/end inset of the first/last slide (default 20px)
      --slider-nav-gap       space between the row and the nav           (default 25px) */

.slider {
  --slider-slide-width: 267px;
  --slider-gap: 15px;
  --slider-offset: 20px;
  --slider-nav-gap: 25px;
  display: flex; flex-direction: column; gap: var(--slider-nav-gap);
  min-width: 0;
}

/* Viewport (= Swiper container). position: relative keeps absolutely positioned
   descendants (e.g. .sr-only text) inside the scroll box. */
.slider .slider__viewport { position: relative; overflow: hidden; width: 100%; margin-inline: 0; } /* swiper.css centres .swiper with auto margins, which in this flex column would shrink-wrap it to the full track width */

/* Track (= Swiper wrapper) and slides */
.slider .slider__track { display: flex; margin: 0; padding: 0; list-style: none; }
.slider .slider__slide {
  flex: 0 0 var(--slider-slide-width);
  width: var(--slider-slide-width);                                 /* wins over swiper.css .swiper-slide { width: 100% } */
  height: auto;                                                      /* equal-height slides (row stretch) */
  min-width: 0;
}

/* ---- Static mode (no Swiper yet): native scroll row with the Figma peek ---- */
.slider .slider__viewport:not(.swiper-initialized) {
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--slider-offset);
}
.slider .slider__viewport:not(.swiper-initialized)::-webkit-scrollbar { display: none; }
.slider .slider__viewport:not(.swiper-initialized) .slider__track {
  gap: var(--slider-gap);
  width: max-content;
  padding-inline: var(--slider-offset);
}
.slider .slider__viewport:not(.swiper-initialized) .slider__slide { scroll-snap-align: start; }

/* ---- Navigation (prev / next; optional pagination slot) ---- */
.slider__nav { display: flex; justify-content: center; align-items: center; gap: 10px; } /* [FIGMA] 10 */
.slider__button {
  display: inline-grid; place-items: center;
  width: 50px; height: 50px; padding: 0;                             /* [FIGMA] 50 */
  border: var(--border-width-default, 1px) solid var(--icon-button-border, #781c45);
  border-radius: var(--radius-pill, 999px);
  background: var(--icon-button-background, #f8f9f0);
  color: var(--icon-button-text, #781c45);
  cursor: pointer;
}
.slider__button img { width: 24px; height: 24px; }                  /* [FIGMA] 24 icon */
.slider__button.swiper-button-disabled { opacity: 0.4; cursor: default; } /* class Swiper adds at either end */
.slider__button.swiper-button-lock { display: none; }               /* Swiper: all slides fit, nav not needed */
.slider__pagination:empty { display: none; }                        /* optional slot; Swiper fills it if configured */

/* Optional: arrows only from tablet up. CSS does the hiding so there is no flash before JS;
   the matching preset sets navigation.enabled false below 750 and true from 750. */
.slider--nav-tablet-up > .slider__nav { display: none; }
@media (width >= 750px) {
  .slider--nav-tablet-up > .slider__nav { display: flex; }
}

/* ---- Bleed: the viewport keeps the container's left edge, but slides stay visible up to
   the viewport edge (Figma cards are cut off by the FRAME, not by the content box).
   The section that holds the slider clips horizontally (overflow-x: clip). ---- */
.slider--bleed .slider__viewport.swiper-initialized { overflow: visible; }
.slider--bleed .slider__viewport:not(.swiper-initialized) { margin-right: calc(var(--slider-bleed, 0px) * -1); }
.slider--bleed .slider__viewport:not(.swiper-initialized) .slider__track { padding-right: var(--slider-bleed, 0px); }

/* ---- Layout modifiers (pair with the JS presets of the same name) ----
   Offsets are 0: each slider sits inside its section's content box. */
.slider--step-cards,
.slider--ingredient-cards,
.slider--review-cards,
.slider--testimonial-cards,
.slider--article-cards { --slider-offset: 0px; --slider-bleed: var(--layout-page-margin, 20px); }

/* "Two simple steps" — mobile-only card variant (Figma 11642:8008): 307 cards, gap 20 */
.slider--step-cards { --slider-slide-width: 307px; --slider-gap: 20px; }

/* Ingredients (Figma I11642:7875;11122:3291 / I11642:8051;11122:5992) */
.slider--ingredient-cards { --slider-slide-width: 292px; --slider-gap: 20px; }      /* [FIGMA] mobile */
@media (width >= 750px) { .slider--ingredient-cards { --slider-slide-width: 346px; --slider-gap: 20.7px; } } /* [GENERATED] midpoint */
@media (width >= 990px) { .slider--ingredient-cards { --slider-slide-width: 400px; --slider-gap: 21.43px; } } /* [FIGMA] desktop (instances 401.43 apart − 400) */

/* Product review cards (Figma I11642:7879;11264:2963 / I11642:8055;11264:3181) */
.slider--review-cards { --slider-slide-width: 273px; --slider-gap: 14px; }          /* [FIGMA] mobile */
@media (width >= 750px) { .slider--review-cards { --slider-slide-width: 366px; } }  /* [GENERATED] midpoint */
@media (width >= 990px) { .slider--review-cards { --slider-slide-width: 459px; } }  /* [FIGMA] desktop */

/* "Real Voices" testimonials (Figma I11642:7881;10932:5715 / I11642:8172;10932:5812) */
.slider--testimonial-cards { --slider-slide-width: 293px; --slider-gap: 10px; }     /* [FIGMA] mobile */
@media (width >= 750px) { .slider--testimonial-cards { --slider-gap: 15px; } }       /* [GENERATED] midpoint */
@media (width >= 990px) { .slider--testimonial-cards { --slider-gap: 20px; } }       /* [FIGMA] desktop */
.slider--testimonial-cards { position: relative; }
.slider--testimonial-cards > .slider__nav {                                          /* [FIGMA] arrow 'Group 64' over the row */
  position: absolute; z-index: 2; top: 50%; right: calc(38px - var(--layout-page-margin, 20px)); transform: translateY(-50%); /* [FIGMA] x1352: 38 from the frame edge */
}

/* Articles (Figma I11642:7900;10931:2203 / I11642:8195;10931:2238): 305 cards, gap 20 */
.slider--article-cards { --slider-slide-width: 305px; --slider-gap: 20px; }
