/* ================================================================
   HERO FADE SLIDER
   All slides are absolute-positioned from the start so the
   JS initialisation never moves any element (zero CLS).
   ================================================================ */

/* The hero container is .slider-item.hero-slide in the template.
   JS adds .hero-slider class on init, plus ms-ready / ms-active. */
.hero-slider {
  position: relative;
  overflow: hidden;
}

/* All slides: absolutely fill the container, hidden by default */
.hero-slider > .slider-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
}

/* First slide visible before JS runs (progressive enhancement).
   Once JS adds .ms-ready, only .ms-active controls visibility. */
.hero-slider:not(.ms-ready) > .slider-wrapper:first-child {
  opacity: 1;
}

/* After JS adds .ms-ready: enable transitions and per-slide control */
.hero-slider.ms-ready > .slider-wrapper {
  transition: opacity .5s ease;
  pointer-events: none;
}
.hero-slider.ms-ready > .slider-wrapper.ms-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Hero pagination dots ── */
.ms-dots {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  text-align: center;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 5;
  pointer-events: none;
}
.ms-dots li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  pointer-events: auto;
}
/* A11y: 24×24 minimum touch target (WCAG 2.5.8); visual dot via ::before */
.ms-dots li button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-size: 0;
  cursor: pointer;
  padding: 0;
}
.ms-dots li button::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  transition: background .25s;
  flex-shrink: 0;
}
.ms-dots li.ms-active button::before,
.ms-dots li button:hover::before {
  background: #fff;
}

/* ================================================================
   SCROLL CAROUSEL
   ================================================================ */

.ms-carousel {
  position: relative;
  padding-bottom: 72px;
}

/* Scroll track wrapping carousel items */
.ms-track {
  display: flex !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.ms-track::-webkit-scrollbar { display: none; }
.ms-track > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Homepage + e-services related services: match fixed card slide width */
#services .ms-carousel .ms-track > *,
.page-node-type-e-services section.bg-primary-05 .ms-carousel .ms-track > * {
  flex: 0 0 304px;
  width: 304px;
  max-width: 304px;
  box-sizing: border-box;
}

#services .ms-carousel .ms-track,
.page-node-type-e-services section.bg-primary-05 .ms-carousel .ms-track {
  width: 100%;
}

/* ── Carousel arrow buttons — large green filled circles at bottom-left ── */
.ms-carousel .slick-arrow {
  position: absolute;
  top: auto;
  bottom: 0;
  transform: none;
  z-index: 2;
  border: 0;
  border-radius: 50% !important;
  height: 48px;
  width: 48px;
  background-color: var(--colors-brand-600, #1B8354);
  color: #fff;
  cursor: pointer;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
}
.ms-carousel .slick-arrow:hover,
.ms-carousel .slick-arrow:focus {
  background-color: var(--colors-brand-700, #14684A);
  color: #fff;
  outline: none;
}
.ms-carousel .slick-arrow:active {
  transform: scale(0.96);
}
.ms-carousel .slick-arrow::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1.125rem;
  color: #fff;
}

/* Arrow positions: paired at bottom-left in both directions; swap order in RTL so next sits first (leftmost). */
.ms-carousel .slick-prev { left: 0; right: auto; }
.ms-carousel .slick-next { left: 60px; right: auto; }
[dir="rtl"] .ms-carousel .slick-prev { left: 60px; right: auto; }
[dir="rtl"] .ms-carousel .slick-next { left: 0; right: auto; }

/* Icons — leftmost button always shows `<`, rightmost always shows `>` (visual pattern `[<][>]`).
   In LTR: prev (left) = <, next (right) = >.
   In RTL: next (left) = <, prev (right) = >. Global custom.css RTL flip provides this. */
.ms-carousel .slick-prev::before { content: "\f104"; }
.ms-carousel .slick-next::before { content: "\f105"; }

/* Mobile: smaller arrows */
@media (max-width: 767px) {
  .ms-carousel { padding-bottom: 60px; }
  .ms-carousel .slick-arrow { width: 40px; height: 40px; }
  .ms-carousel .slick-next,
  [dir="rtl"] .ms-carousel .slick-next { left: 50px; }
}

/* ── Carousel pagination dots — bottom-right ── */
.ms-carousel .slick-dots {
  position: absolute;
  bottom: 12px;
  right: 0;
  left: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  width: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
[dir="rtl"] .ms-carousel .slick-dots {
  right: 0;
  left: auto;
  justify-content: flex-start;
}
/* Dot indicator lives on the LI itself (matches production): 16×16 round, white with green border;
   active = green fill. Button inside is a transparent touch target. */
.ms-carousel .slick-dots li {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 5px;
  background: #fff;
  border: 1px solid var(--colors-brand-600, #1B8354);
  border-radius: 50%;
  transition: background .2s, transform .2s;
}
.ms-carousel .slick-dots li.slick-active {
  background-color: var(--colors-brand-600, #1B8354);
  border-color: var(--colors-brand-600, #1B8354);
}
.ms-carousel .slick-dots li:hover {
  background-color: var(--colors-brand-100, #DCFAE9);
}
.ms-carousel .slick-dots li.slick-active:hover {
  background-color: var(--colors-brand-700, #14684A);
}
.ms-carousel .slick-dots li button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0;
  color: transparent;
  cursor: pointer;
  display: block;
}
.ms-carousel .slick-dots li button::before {
  content: none;
}

/* ── No-overflow state: track fits its container, so navigation is unnecessary.
   Hide arrows + dots and collapse the bottom padding reserved for them. ── */
.ms-carousel.ms-no-overflow .slick-arrow,
.ms-carousel.ms-no-overflow .slick-dots {
  display: none !important;
}
.ms-carousel.ms-no-overflow {
  padding-bottom: 0;
}
