/*
 * EGE-School course cards .es-course-card and their grid .es-course-cards
 * (template-parts/courses/course-card.php): archives of subjects, directions and formats,
 * the school page, the course page and the course catalogue /kursy/. The logo plate of the
 * school row (span.es-logo) comes from schools.css. Values from
 * docs/design/b/B-subject-*.dc.html and B-course-*.dc.html; colours only from base.css
 * tokens.
 */

/* ---------- course cards ---------- */
.es-course-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--es-s-4);
}

.es-course-card {
  display: flex;
  flex-direction: column;
  gap: var(--es-s-3);
  min-width: 0;
  padding: var(--es-s-6);
  border-radius: var(--es-r-lg);
  background: var(--es-white);
  color: var(--es-ink);
}

.es-course-card:hover {
  color: var(--es-ink);
}

.es-course-card:hover .es-course-card__title {
  color: var(--es-link-h);
}

/* school row: logo 40×40, name · rating (B-course «Похожие курсы») */
.es-course-card__school {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.es-course-card__school span.es-logo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--es-r-sm);
  font-size: 12px;
}

.es-course-card__school .es-logo--text {
  background: var(--es-subj-profilnaya-matematika);
}

.es-course-card__school-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* «subject · level»: in the subject colour (--chip) or the default mini */
.es-course-card__tag {
  align-self: flex-start;
  max-width: 100%;
  height: auto;
  min-height: 28px;
  padding-block: 6px;
  background: var(--chip, var(--es-ground));
  line-height: 1.25;
}

.es-course-card__title {
  margin: 0;
  font-family: var(--es-font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.es-course-card__meta {
  color: var(--es-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.es-course-card__price {
  margin-top: auto;
  font-family: var(--es-font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .es-course-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .es-course-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .es-course-card {
    padding: 20px;
  }

  .es-course-card__title {
    font-size: 16px;
  }
}
