/* ==========================================================================
   کاد — بخش «معرفی اساتید» (اسلایدر کارت‌ها؛ صفحه‌ی اصلی و درباره‌ی ما)
   ========================================================================== */

.teachers-section {
  position: relative;
  overflow: hidden; /* اسلایدهای پنهان کمی بیرون از کارت جابه‌جا می‌شن؛ نباید اسکرول افقی بسازن */
}

.teachers-head {
  align-items: flex-end;
}

.teachers-sub {
  margin-top: var(--space-1);
  font-size: var(--text-body2-size);
}

.teachers-controls {
  display: flex;
  gap: var(--space-2);
}

.teachers-controls .btn-icon {
  border: 1px solid var(--color-gray-200);
  background: var(--color-white);
}

/* ---------- ردیف اسلایدها: همه روی هم، فقط یکی دیده می‌شود (ارتفاع = بلندترین کارت، بدون پرش) ---------- */
.teachers-track {
  display: grid;
}

.teacher-slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-48px) scale(0.985);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease), visibility 0s linear 0.65s;
  pointer-events: none;
}

.teacher-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
  pointer-events: auto;
}

/* اسلاید خارج‌شونده، به سمت مخالفِ ورودی می‌رود (در RTL: ورود از چپ، خروج به راست) */
.teacher-slide.is-leaving {
  transform: translateX(48px) scale(0.985);
}

/* ---------- کارت ---------- */
.teacher-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: var(--space-10);
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-8) var(--space-10);
  position: relative;
  overflow: hidden;
}

/* خط طلایی باریک بالای کارت، شبیه لبه‌ی برگه‌ی جزوه */
.teacher-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary-light), var(--color-primary-dark));
}

.teacher-photo-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
}

/* قاب طلایی جابه‌جاشده پشت عکس */
.teacher-photo-wrap::before {
  content: '';
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  opacity: 0.55;
}

.teacher-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-gray-100);
  box-shadow: var(--shadow-lg);
}

.teacher-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.teacher-photo-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background: linear-gradient(160deg, var(--color-primary-lighter), var(--color-gray-100));
}

.teacher-photo-empty svg {
  width: 84px;
  height: 84px;
  stroke-width: 1.4;
}

.teacher-info {
  min-width: 0;
}

.teacher-subject {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-lighter);
  color: var(--color-primary-dark);
  font-size: var(--text-body2-size);
  font-weight: var(--fw-semibold);
}

[data-theme='dark'] .teacher-subject {
  color: var(--color-primary);
}

.teacher-subject svg {
  width: 16px;
  height: 16px;
}

.teacher-name {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: var(--space-4) 0 var(--space-3);
}

.teacher-bio {
  color: var(--color-gray-600);
  line-height: 2;
  white-space: pre-line;
  max-width: 62ch;
}

.teacher-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: var(--fw-medium);
  transition: background var(--transition-fast), color var(--transition-fast);
}

[data-theme='dark'] .teacher-phone {
  color: var(--color-primary);
}

.teacher-phone:hover {
  background: var(--color-primary);
  color: #1a140d;
}

.teacher-phone svg {
  width: 18px;
  height: 18px;
}

.teacher-phone-label {
  font-size: var(--text-body2-size);
}

.teacher-phone-number {
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}

/* ---------- انیمیشن ورود محتوا: عکس و متن یکی‌یکی وارد می‌شن ---------- */
.teacher-slide.is-active .teacher-photo-wrap {
  animation: teacher-photo-in 0.8s var(--ease) both;
}

.teacher-slide.is-active .teacher-info > * {
  animation: teacher-text-in 0.7s var(--ease) both;
}

.teacher-slide.is-active .teacher-info > :nth-child(1) { animation-delay: 0.15s; }
.teacher-slide.is-active .teacher-info > :nth-child(2) { animation-delay: 0.25s; }
.teacher-slide.is-active .teacher-info > :nth-child(3) { animation-delay: 0.35s; }
.teacher-slide.is-active .teacher-info > :nth-child(4) { animation-delay: 0.45s; }

@keyframes teacher-photo-in {
  from { opacity: 0; transform: translateX(-24px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes teacher-text-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- نقطه‌ها و نوار پیشرفت ---------- */
.teachers-footer {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-5);
  padding-inline: var(--space-2);
}

.teachers-dots {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.teachers-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-gray-200);
  transition: width var(--transition-base), background var(--transition-base);
}

.teachers-dot:hover {
  background: var(--color-gray-300);
}

.teachers-dot.is-active {
  width: 30px;
  background: var(--color-primary);
}

.teachers-progress {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-gray-100);
  overflow: hidden;
}

.teachers-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--color-primary);
  transform-origin: right center; /* در RTL نوار از راست پر می‌شه */
  animation: teachers-progress 6.5s linear forwards;
}

.teachers-slider.is-idle .teachers-progress span {
  animation: none !important;
  transform: scaleX(0);
}

@keyframes teachers-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---------- موبایل ---------- */
@media (max-width: 860px) {
  .teacher-card {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-5) var(--space-8);
    text-align: center;
  }

  .teacher-photo-wrap {
    max-width: 210px;
  }

  .teacher-photo-wrap::before {
    inset: 10px -10px -10px 10px;
  }

  .teacher-bio {
    margin-inline: auto;
    line-height: 1.95;
    text-align: right;
  }

  .teacher-phone {
    width: 100%;
    justify-content: center;
  }

  .teachers-head {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-slide,
  .teacher-slide.is-leaving {
    transform: none;
    transition: none;
  }
  .teacher-slide.is-active .teacher-photo-wrap,
  .teacher-slide.is-active .teacher-info > * {
    animation: none;
  }
  .teachers-progress span {
    animation: none;
  }
}
