/* =============================================================
   AHLEDHIKR INSTITUTE — TESTIMONIALS STYLESHEET  v1.0
   -------------------------------------------------------------
   Companion stylesheet for assets/testimonials.js.
   Depends on the CSS custom properties defined in styles.css
   (`:root` block — colours, fonts, radii, shadows).

   Load order in HTML:
     <link rel="stylesheet" href="assets/styles.css">
     <link rel="stylesheet" href="assets/testimonials.css">
     <script   src="assets/testimonials.js"></script>
   ============================================================= */


/* =============================================================
   1.  SECTION WRAPPER
   ============================================================= */
.testimonials {
  position: relative;
  padding-block: clamp(8px, 2vw, 24px);
}


/* =============================================================
   2.  TRACK  —  grid-stack all slides in a single cell so the
       track adopts the height of the tallest slide. This is the
       layout fix that prevents mobile height-jumping.
   ============================================================= */
.testimonials-track {
  display: grid !important;
  align-items: stretch;
  position: relative;
  width: 100%;
  overflow: hidden;
}


/* =============================================================
   3.  SLIDE  —  the card itself
   ============================================================= */
.testimonial-slide {
  /* stacking */
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;

  /* card surface */
  background: var(--ivory);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4.5vw, 56px);
  box-shadow: var(--shadow-sm);

  /* internal layout */
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  position: relative;
  overflow: hidden;
}

.testimonial-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* Decorative opening curly quote, set in stone, sits behind the text */
.testimonial-slide::before {
  content: "\201C";
  position: absolute;
  top: -10px;
  left: clamp(16px, 3vw, 36px);
  font-family: var(--f-display);
  font-size: clamp(110px, 14vw, 180px);
  line-height: 1;
  color: var(--stone);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}


/* =============================================================
   4.  QUOTE TEXT
   ============================================================= */
.testimonial-text {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

/* Arabic phrases embedded within an English quote — set in Amiri,
   slightly larger so the diacritics breathe, and shaded green. */
.testimonial-text .arabic-phrase {
  font-family: var(--f-arabic);
  font-style: normal;
  font-size: 1.05em;
  color: var(--green-deep);
  white-space: nowrap;
}


/* =============================================================
   5.  ATTRIBUTION  —  initials disc + name + role
   ============================================================= */
.testimonial-attr {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: clamp(16px, 2.2vw, 24px);
  border-top: 1px solid var(--rule);
  position: relative;
  z-index: 1;
}

.testimonial-attr-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ivory);
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(10, 74, 44, 0.22);
}

.testimonial-attr-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.testimonial-attr-name {
  font-family: var(--f-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--green-deep);
  line-height: 1.2;
}

.testimonial-attr-role {
  font-family: var(--f-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--stone-deep);
  line-height: 1.3;
}


/* =============================================================
   6.  CONTROLS  —  prev / next / dots
   ============================================================= */
.testimonials-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: clamp(20px, 3vw, 28px);
}

.testimonials-prev,
.testimonials-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--green-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease,
              color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.testimonials-prev:hover,
.testimonials-next:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--ivory);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.testimonials-prev:active,
.testimonials-next:active {
  transform: translateY(0);
}

.testimonials-prev svg,
.testimonials-next svg {
  width: 16px;
  height: 16px;
}

.testimonials-dots {
  display: flex;
  gap: 9px;
  align-items: center;
}

.testimonials-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease, width .25s ease;
}

.testimonials-dot:hover {
  background: var(--stone-deep);
}

.testimonials-dot.active {
  background: var(--green);
  width: 22px;
  border-radius: 4px;
}


/* =============================================================
   7.  SINGLE  —  hide controls when only one entry is shown
   ============================================================= */
.testimonials.single .testimonials-controls {
  display: none;
}


/* =============================================================
   8.  GRID VARIANT  —  data-testimonials="grid"
   ============================================================= */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.testimonial-grid-card {
  background: var(--ivory);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}

.testimonial-grid-card:hover {
  border-color: var(--stone-deep);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.testimonial-grid-card::before {
  content: "\201C";
  position: absolute;
  top: -14px;
  right: 16px;
  font-family: var(--f-display);
  font-size: 80px;
  line-height: 1;
  color: var(--stone);
  opacity: 0.25;
  pointer-events: none;
  user-select: none;
}

.testimonial-grid-card .testimonial-text {
  font-family: var(--f-display);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
}

.testimonial-grid-card .testimonial-attr {
  padding-top: 16px;
  margin: 0;
}


/* =============================================================
   9.  MOBILE TUNING  (< 720px)
   ============================================================= */
@media (max-width: 720px) {
  .testimonial-slide {
    padding: 28px 22px;
    gap: 22px;
    border-radius: var(--radius);
  }

  .testimonial-slide::before {
    top: -6px;
    left: 14px;
    font-size: 90px;
  }

  .testimonial-text {
    font-size: 1.08rem;
    line-height: 1.55;
  }

  .testimonial-attr {
    gap: 14px;
  }

  .testimonial-attr-mark {
    width: 42px;
    height: 42px;
    font-size: 0.85rem;
  }

  .testimonial-attr-name {
    font-size: 0.98rem;
  }

  .testimonial-attr-role {
    font-size: 0.66rem;
    letter-spacing: 0.14em;
  }

  .testimonials-controls {
    gap: 12px;
    margin-top: 18px;
  }

  .testimonials-prev,
  .testimonials-next {
    width: 36px;
    height: 36px;
  }
}
