/*
 * Testimonials + Shariah-Fatwa layout overrides (static mirror).
 *
 * The slide layout itself (quote on top, photo/name/role centred beneath it -
 * .slide_wrapper > p.testimonial-text-three + div.testimonial-info-four) is left
 * to the base stylesheet, which already matches the live site's own design
 * (single centred column) with no override needed. What's here is only the
 * handful of things the base stylesheet gets wrong for a self-hosted mirror:
 * the slider's own width, the slide-mask height never tracking the active
 * slide, and the arrow/dot styling the site explicitly asked to keep
 * (always-visible chip buttons instead of Webflow's default hover-only ones).
 *
 * Colours are the site's own custom properties, not new values.
 */

/* the base stylesheet sets .testimonial_slider{width:85vw}, which is wider than the
   container, so the adjacent slide shows through the mask. Match the container so
   each slide fills the mask exactly. */
.section_main.testimonial .testimonial_slider {
  width: 100%;
}

/* Mask height is kept in sync with the active slide by testimonial-mask-fix.js
   (Webflow's own runtime never sets one here, so it defaults to the tallest of
   the 7 slides always, leaving a large dead gap under shorter testimonials).
   This transition smooths that JS-driven resize the same way Webflow smooths
   the slide transform itself. */
.section_main.testimonial .testimonial_slider .w-slider-mask {
  transition: height 400ms ease;
}

/* The base stylesheet's redesign made .container.shariaah and .testimonials_main
   flex items/containers (previously block-level). A flex item's default min-width
   is `auto` - i.e. it refuses to shrink below its CONTENT's natural size, which here
   is the slide_wrapper's ~755-875px minimum (driven by the 200px photo + quote grid).
   That's why this section, alone among the page, did not shrink to the mobile
   viewport: its ancestor chain was 2-3x wider than the 375px screen, clipped only by
   .section_main.testimonial's own overflow-x:hidden - explaining the frozen intro
   animation elsewhere too, but here it visibly cropped the whole slide sideways.
   min-width:0 is the standard fix for an oversized flex/grid item. */
.section_main.testimonial .container.shariaah,
.section_main.testimonial .testimonials_main {
  min-width: 0;
}

/* arrows: small bordered buttons under the text column (right arrow is
   display:none in the base stylesheet, so it is re-shown here) */
.section_main.testimonial .testimonial_slider .w-slider-arrow-left,
.section_main.testimonial .testimonial_slider .w-slider-arrow-right {
  inset: auto auto 18px auto;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 1px solid var(--light-teal-2);
  border-radius: 6px;
  background-color: var(--light-teal-2);   /* #daf3f1 - the site's own token */
  color: #0e3a52;                          /* arrow glyph */
  font-size: 14px;
  display: flex;
  cursor: pointer;
  /* .3s matches the transition the site's own .button uses */
  transition: background-color .3s, border-color .3s, color .3s;
}

/* hover / focus: invert to a solid dark chip with a light chevron */
.section_main.testimonial .testimonial_slider .w-slider-arrow-left:hover,
.section_main.testimonial .testimonial_slider .w-slider-arrow-right:hover,
.section_main.testimonial .testimonial_slider .w-slider-arrow-left:focus-visible,
.section_main.testimonial .testimonial_slider .w-slider-arrow-right:focus-visible {
  background-color: #0e3a52;
  border-color: #0e3a52;
  color: var(--light-teal-2);
}

/* keyboard users get a visible ring; mouse users do not */
.section_main.testimonial .testimonial_slider .w-slider-arrow-left:focus-visible,
.section_main.testimonial .testimonial_slider .w-slider-arrow-right:focus-visible {
  outline: 2px solid #0e3a52;
  outline-offset: 2px;
}

.section_main.testimonial .testimonial_slider .w-slider-arrow-left:active,
.section_main.testimonial .testimonial_slider .w-slider-arrow-right:active {
  background-color: #09293a;
  border-color: #09293a;
}

@media (prefers-reduced-motion: reduce) {
  .section_main.testimonial .testimonial_slider .w-slider-arrow-left,
  .section_main.testimonial .testimonial_slider .w-slider-arrow-right {
    transition: none;
  }
}

.section_main.testimonial .testimonial_slider .w-slider-arrow-left  { left: 124px; }
.section_main.testimonial .testimonial_slider .w-slider-arrow-right { left: 166px; }
.section_main.testimonial .testimonial_slider .right-arrow          { display: flex; }

/* dots: right aligned, active one a teal pill */
.section_main.testimonial .slide-nav {
  opacity: 1;
  bottom: 24px;
  padding-right: 4px;
  font-size: 8px;
  text-align: right;
}

.section_main.testimonial .w-slider-dot {
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background-color: var(--gray-3);
}

.section_main.testimonial .w-slider-dot.w-active {
  width: 20px;
  border-radius: 4px;
  background-color: var(--teal);
}

@media screen and (max-width: 991px) {
  /* the card fills the container at this width, so keep it off the screen edge */
  .section_main.testimonial .testimonials_main {
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media screen and (max-width: 767px) {
  /* keep the arrows clear of the dots on narrow screens */
  .section_main.testimonial .testimonial_slider .w-slider-arrow-left  { left: 8px; }
  .section_main.testimonial .testimonial_slider .w-slider-arrow-right { left: 48px; }
  .section_main.testimonial .slide-nav { text-align: right; padding-right: 8px; }
}


/* ------------------------------------------------------------------ *
 * Shariah-Compliant Fatwa section
 *
 * Two <section id="insights"> elements exist on the homepage (a Webflow
 * quirk); only the first holds this block, and it is the only one whose
 * direct child is .container.shariaah - hence the child combinator.
 *
 * The section container is capped by .w-container, so it is opened to
 * 100%. The inner text block carries flex:1 from the base stylesheet,
 * which would stretch it across that new width - it is set to shrink-wrap
 * so the image + text group centres as a unit instead.
 * ------------------------------------------------------------------ */

#insights > .container.shariaah {
  box-sizing: border-box;   /* padding must sit inside the 100%, not add to it */
  width: 100%;
  max-width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}

#insights .flex-block {
  justify-content: center;
  align-items: center;
  grid-column-gap: 48px;
  gap: 48px;
}

/* .image-10 carries margin-left/right:auto, which in a flex row soaks up all the
   free space and pushes the image and copy to opposite edges */
#insights .flex-block .image-10 {
  margin-left: 0;
  margin-right: 0;
  flex: 0 0 auto;
}

/* stop the copy column stretching to fill the full-width row. It is also a
   .w-container, which carries margin-left/right:auto - in a flex row those soak up
   the free space and shove the two halves to opposite edges. */
#insights .flex-block > .container.shariaah {
  flex: 0 1 auto;
  margin-left: 0;
  margin-right: 0;
  max-width: min(520px, 100%);   /* align-items:center makes this size to content,
                                    so an absolute cap would overflow narrow screens */
}

@media screen and (max-width: 767px) {
  #insights > .container.shariaah {
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
  }
  /* the base stylesheet only stacks .flex-block at max-width:479px, so viewports
     between 480 and 767px keep it as a row and the 400px certificate overflows
     (true of the original too). Stack it from 767px down instead. */
  #insights .flex-block {
    flex-direction: column;
    align-items: center;
  }
  #insights .flex-block > .container.shariaah {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    align-items: center;
    text-align: center;
  }
  #insights .flex-block .image-10 {
    flex: 0 1 auto;          /* must be allowed to shrink on narrow screens */
    width: 100%;
    max-width: 400px;
    height: auto;
    padding-right: 0;
  }
}
