/* =========================================================
   TONOMIC Course Archive CSS
   Desktop: 3 columns (balanced width)
   Tablet:  2 columns
   Mobile:  1 column
   ========================================================= */

.tn-course-archive,
.tn-course-archive *{
  box-sizing: border-box;
}

.tn-course-archive__body{
  padding: 10px 0 26px;
}

.tn-course-archive__container{
  width: 100%;
  max-width: 1240px;  /* ✅ کمتر شد (بالانس) */
  margin: 0 auto;
  padding: 0 22px;
}

/* IMPORTANT OVERRIDES: remove external 960px cap */
.tn-course-archive .tn-course-grid{
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 26px !important; /* ✅ کمتر شد */
  direction: rtl !important;
  align-items: stretch;
}

/* Tablet */
@media (max-width: 1100px){
  .tn-course-archive__container{ max-width: 980px; }
  .tn-course-archive .tn-course-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

/* Mobile */
@media (max-width: 720px){
  .tn-course-archive__container{
    max-width: 100%;
    padding: 0 12px;
  }
  .tn-course-archive .tn-course-grid{
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* Card */
.tn-course-card{
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.tn-course-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(0,0,0,.12);
}

.tn-course-card__thumb{
  display: block;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
}

.tn-course-card__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tn-course-card__thumb--placeholder{
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.tn-course-card__content{
  padding: 18px 20px 20px;
}

.tn-course-card__title{
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.8;
  text-align: center;
}

.tn-course-card__title a{
  text-decoration: none;
  color: inherit;
}

/* Meta: RTL + right-aligned */
.tn-course-card__meta{
  direction: rtl;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
  padding-top: 6px;
}

.tn-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  white-space: nowrap;
}

.tn-badge--soft{
  background: #f3f4f6;
  color: #111827;
}

.tn-badge--accent{
  background: #5b21b6;
  color: #fff;
}

/* Load more */
.tn-course-loadmore-wrap{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.tn-course-loadmore{
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  background: #5b21b6;
  color: #fff;
  font-size: 14px;
  min-width: 210px;
}

.tn-course-loadmore.is-loading{
  opacity: .75;
  cursor: wait;
}

.tn-course-loadmore-status{
  font-size: 13px;
  opacity: .75;
}

.tn-course-empty{
  padding: 18px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
