/* ============================================================
   RIHM — carousel.css
   Reusable carousel module shared by Faculty & Testimonials
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
.rihm-carousel-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* hard clip — no horizontal scroll */
}

/* ── Track (the scrolling belt) ────────────────────────────── */
.rihm-carousel-track {
  display: flex;
  gap: 1.5rem;                  /* gutter between cards */
  will-change: transform;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
  padding: .5rem .25rem 1.5rem; /* room for box-shadows */
  /* prevent native horizontal scroll leaking out */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Each slide ────────────────────────────────────────────── */
.rihm-carousel-slide {
  flex: 0 0 auto;             /* never shrink */
  /* width set via JS / CSS custom property */
  min-width: 0;
  box-sizing: border-box;
}

/* ── Slide widths via data-cols ─────────────────────────────
   JS sets --carousel-cols on .rihm-carousel-wrap;
   the calculation accounts for the gap.                       */
.rihm-carousel-slide {
  width: calc(
    (100% - (var(--carousel-cols, 3) - 1) * 1.5rem)
    / var(--carousel-cols, 3)
  );
}

/* ── Navigation buttons ─────────────────────────────────────── */
.rihm-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--white);
  color: var(--navy);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 4px 16px rgba(27, 35, 112, .12);
  /* keep inside container — no overflow */
  flex-shrink: 0;
}
.rihm-carousel-btn:hover,
.rihm-carousel-btn:focus-visible {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
  transform: translateY(-50%) scale(1.1);
  outline: 3px solid rgba(201, 162, 39, .5);
  outline-offset: 2px;
}
.rihm-carousel-btn:disabled,
.rihm-carousel-btn[aria-disabled="true"] {
  opacity: .35;
  pointer-events: none;
}
.rihm-carousel-btn-prev { left: -20px; }
.rihm-carousel-btn-next { right: -20px; }

/* On small screens bring buttons inside */
@media (max-width: 575px) {
  .rihm-carousel-btn-prev { left: 4px; }
  .rihm-carousel-btn-next { right: 4px; }
  .rihm-carousel-btn { width: 36px; height: 36px; font-size: .85rem; }
}

/* ── Dot indicators ─────────────────────────────────────────── */
.rihm-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;              /* no overflow on tiny screens */
}
.rihm-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--light-gray);
  border: 2px solid var(--gold);
  cursor: pointer;
  transition: all .3s ease;
  padding: 0;
  flex-shrink: 0;
}
.rihm-carousel-dot.active,
.rihm-carousel-dot:hover {
  background: var(--gold);
  width: 24px;
  border-radius: 4px;
}
.rihm-carousel-dot:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* ── Outer wrapper padding for buttons ──────────────────────── */
.rihm-carousel-outer {
  position: relative;
  padding: 0 28px;              /* reserve space for abs buttons */
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 575px) {
  .rihm-carousel-outer { padding: 0 44px; }
}

/* ── Fade-in entrance for slides ────────────────────────────── */
.rihm-carousel-slide {
  opacity: 0;
  animation: slideEnter .4s ease forwards;
}
@keyframes slideEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Uniform card height inside carousel ───────────────────── */
.rihm-carousel-track .faculty-card,
.rihm-carousel-track .testimonial-card {
  height: 100%;
}
.rihm-carousel-slide {
  display: flex;
  flex-direction: column;
}
.rihm-carousel-slide > * { flex: 1; }

/* ── Autoplay progress bar ──────────────────────────────────── */
.rihm-carousel-progress {
  height: 3px;
  background: var(--light-gray);
  border-radius: 2px;
  margin-top: 1.2rem;
  overflow: hidden;
  display: none; /* shown only when autoplay on */
}
.rihm-carousel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 2px;
  width: 0%;
  transition: width linear;
}
.rihm-carousel-wrap[data-autoplay] .rihm-carousel-progress { display: block; }