/* =============================================
   Testimonials Block
   ============================================= */

/*
 * overflow-x: clip prevents peeking slides from creating a horizontal
 * scrollbar. This is also what crops them, so testimonials.js stretches the
 * block to both screen edges (--bleed-*) and pushes the swiper and controls
 * back into the content column (--content-offset). Without the bleed, the
 * slide peeking in from the left is cut at the content margin instead of at
 * the edge of the screen.
 *
 * The negative margins need !important to beat the `margin: auto !important`
 * WordPress applies to children of a constrained layout, and the doubled
 * class keeps this rule above that .wp-container-* one.
 */
.testimonials-block {
  overflow-x: clip;
  width: 100%;
}

.testimonials-block.testimonials-block--bleed {
  margin-left: calc(var(--bleed-left, 0px) * -1) !important;
  margin-right: calc(var(--bleed-right, 0px) * -1) !important;
  max-width: none !important;
  width: var(--bleed-width, 100%) !important;
}

/*
 * Swiper — content left margin → viewport right edge, positioned by JS.
 * Scoped to the block so it outranks Swiper's own `.swiper { margin: auto }`,
 * which would otherwise centre it inside the bled-out block.
 */
.testimonials-block .testimonials-block__swiper {
  margin-left: var(--content-offset, 0px);
  margin-right: 0;
  overflow: visible;
  width: var(--swiper-width, 100%);
}

/* ---- Slide & Card ---- */
.testimonials-block .swiper-wrapper .swiper-slide {
  align-self: stretch;
  height: auto;
}

.testimonials-block__card {
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: -webkit-fill-available;
  gap: 40px;
  padding: 24px;
}

/*
 * Background color, plus the resulting quote/author-name/author-meta colors,
 * are set inline (see testimonials.php) since "Card Background Color" is a
 * free-pick color swatch, not a fixed set of options — see
 * inc/color-contrast.php for the contrast logic. The rules below are just
 * fallbacks in case the field has no value.
 */

@media (min-width: 1024px) {
  .testimonials-block__card {
    padding: 40px;
  }
}

/* ---- Quote icon ---- */

.testimonials-block__quote-icon {
  height: 20px;
  width: 25px;
}

.testimonials-block__quote-icon svg {
  display: block;
  height: 100%;
  width: 100%;
}

/* ---- Quote text ---- */

.testimonials-block__quote {
  color: var(--wp--preset--color--navy-blue, #000000);
  font-size: var(--wp--preset--font-size--heading-4, 1.5rem);
  font-weight: 400;
  margin: 0 0 40px;
}

@media (min-width: 1024px) {
  .testimonials-block__quote {
    margin: 0 0 60px;
  }
}

/* ---- Author ---- */

.testimonials-block__author {
  align-items: center;
  display: flex;
  gap: 20px;
  margin-top: auto;
}

.testimonials-block__author-image {
  flex-shrink: 0;
}

.testimonials-block__author-image img {
  border-radius: 50%;
  display: block;
  height: 60px;
  object-fit: cover;
  width: 60px;
}

.testimonials-block__author-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.testimonials-block .testimonials-block__author-name {
  color: var(--wp--preset--color--navy-blue, #000000);
  font-size: var(--wp--preset--font-size--body-2, 1rem);
  font-weight: 600;
  margin: 0;
}

.testimonials-block .testimonials-block__author-meta {
  color: var(--wp--preset--color--cool-grey-dark, #555);
  font-size: var(--wp--preset--font-size--body-2, 1rem);
  font-weight: 400;
  margin: 0;
}

/* ---- Controls row (progress left, arrows right) ---- */

/*
 * Controls span the content left margin to the page's right padding edge
 * (capped by a custom property set in JS): progress bar aligned with the
 * cards, arrows at the page gutter.
 */
.testimonials-block__controls {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-left: var(--content-offset, 0px);
  margin-top: 40px;
  max-width: var(--controls-max-width, 100%);
}

@media (min-width: 1024px) {
  .testimonials-block__controls {
    margin-top: 60px;
  }
}

/* Swiper progressbar pagination — override defaults for inline layout */

.testimonials-block__pagination.swiper-pagination-progressbar.swiper-pagination-horizontal {
  flex: 1;
  height: 2px;
  max-width: 60%;
  position: relative; /* override Swiper's absolute positioning */
}

@media (min-width: 1024px) {
  .testimonials-block__pagination.swiper-pagination-progressbar.swiper-pagination-horizontal {
    max-width: 20%;
  }
}

.testimonials-block__pagination.swiper-pagination-progressbar {
  background: var(--wp--preset--color--cool-grey-medium, #e0e0e0);
  border-radius: 2px;
  inset: auto; /* clear Swiper's top/left/right/bottom */
}

.testimonials-block__pagination .swiper-pagination-progressbar-fill {
  background: var(--wp--preset--color--navy-blue, #001d3d);
  border-radius: 2px;
}

/* Nav buttons */

.testimonials-block__nav {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.testimonials-block__nav-btn {
  align-items: center;
  background: var(--wp--preset--color--royal-blue, #2F6FC7);
  border: 0;
  color: var(--wp--preset--color--white, #FFFFFF);
  cursor: pointer;
  display: flex;
  height: 48px;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
  width: 48px;
  border-radius: 100%;
}

.testimonials-block__nav-btn:hover {
  background: var(--wp--preset--color--navy-blue, #0C2853);
  border-color: var(--wp--preset--color--navy-blue, #0C2853);
  color: #fff;
}

.testimonials-block__nav-btn.swiper-button-disabled {
  cursor: default;
  opacity: 0.35;
  pointer-events: none;
}
