/*
 * EGE-School archives of subjects, directions and formats (design B-subject): hero with
 * the subject chip, exam tabs and «Промокод недели», compact school rows .es-srow,
 * section titles and «Все курсы →». Loaded after page.css and schools.css (filters, sort,
 * logo plate, «Как выбрать» and FAQ come from there); the course cards are in
 * course-cards.css.
 * Colours only from base.css tokens.
 */

.es-term {
  padding-bottom: clamp(48px, 6vw, 88px);
}

/* ---------- hero ---------- */
.es-term-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 3vw, 40px);
}

@media (min-width: 901px) {
  .es-term-hero__inner--promo {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.es-term-hero__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.es-term-hero__chip {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
}

.es-term-hero__title {
  font-size: clamp(28px, 3.8vw, 50px);
  overflow-wrap: anywhere;
}

.es-term-hero__sub {
  margin: 0;
  color: var(--es-on-dark);
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 600;
  line-height: 1.5;
}

.es-term-hero__lead {
  font-size: 16px;
}

.es-exam-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--es-s-2);
}

.es-exam-tabs .es-tag {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

/* ---------- «Промокод недели» ---------- */
.es-week-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: clamp(22px, 2.4vw, 28px);
  border-radius: var(--es-r-xl);
  background: var(--es-acc);
  color: var(--es-ink);
}

.es-week-promo p {
  margin: 0;
}

.es-week-promo__label {
  font-weight: 800;
}

.es-week-promo__school {
  color: var(--es-muted-2);
  font-size: 14px;
  font-weight: 700;
}

.es-week-promo__title {
  font-family: var(--es-font-display);
  font-size: clamp(20px, 1.1rem + 0.8vw, 28px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.es-week-promo__btn {
  margin-top: 6px;
}

/* ---------- school rows ---------- */
.es-term-list {
  padding-top: var(--es-s-4);
}

.es-srows {
  display: flex;
  flex-direction: column;
  gap: var(--es-s-3);
}

.es-srow {
  display: grid;
  grid-template-columns: 48px 64px minmax(0, 1fr) 150px 160px 230px;
  grid-template-areas:
    'place logo title rating price act'
    'place logo chips rating price act'
    'place logo ad rating price act';
  grid-template-rows: auto auto 1fr;
  align-items: center;
  column-gap: 20px;
  row-gap: 6px;
  padding: 22px 26px;
  border-radius: var(--es-r-lg);
  background: var(--es-white);
  color: var(--es-ink);
}

.es-srow__place {
  grid-area: place;
  font-family: var(--es-font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.es-srow .es-logo {
  grid-area: logo;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 17px;
}

.es-srow__title {
  grid-area: title;
  align-self: end;
  margin: 0;
  font-family: var(--es-font-display);
  font-size: clamp(18px, 1rem + 0.5vw, 22px);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.es-srow__title a {
  color: var(--es-ink);
}

.es-srow__title a:hover {
  color: var(--es-link-h);
}

.es-srow__chips {
  grid-area: chips;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.es-srow__ad {
  grid-area: ad;
  align-self: start;
  margin: 0;
  color: var(--es-muted);
  font-size: 12px;
  line-height: 1.4;
}

.es-srow__rating {
  grid-area: rating;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.es-srow__score {
  font-family: var(--es-font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.es-srow__reviews {
  color: var(--es-muted-2);
  font-size: 13px;
  font-weight: 700;
}

.es-srow__reviews:hover {
  color: var(--es-link-h);
}

.es-srow__price {
  grid-area: price;
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.es-srow__act {
  grid-area: act;
  display: flex;
  gap: var(--es-s-2);
}

.es-srow__act .es-btn {
  flex: 1 1 auto;
  padding-inline: 18px;
}

@media (max-width: 1100px) {
  .es-srow {
    grid-template-columns: 40px 56px minmax(0, 1fr) auto;
    grid-template-areas:
      'place logo title rating'
      'place logo chips rating'
      'place logo ad rating'
      'price price price price'
      'act act act act';
    grid-template-rows: auto auto auto;
    padding: 20px;
  }

  .es-srow .es-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 15px;
  }

  .es-srow__place {
    font-size: 22px;
  }

  .es-srow__rating {
    align-items: flex-end;
    text-align: right;
  }

  .es-srow__score {
    font-size: 24px;
  }

  .es-srow__act {
    flex-wrap: wrap;
  }

  .es-srow__act .es-btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 640px) {
  .es-srow {
    grid-template-columns: 28px 56px minmax(0, 1fr);
    grid-template-areas:
      'place logo title'
      'place logo rating'
      'chips chips chips'
      'price price price'
      'act act act'
      'ad ad ad';
    column-gap: 12px;
    row-gap: 10px;
    padding: 18px;
  }

  .es-srow__place {
    font-size: 18px;
  }

  .es-srow__title {
    align-self: end;
  }

  .es-srow__rating {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    align-self: start;
    gap: 4px 10px;
    text-align: left;
  }

  .es-srow__score {
    font-size: 20px;
  }
}

/* ---------- sections ---------- */
.es-term-section__title {
  margin: 0 0 var(--es-s-4);
  color: var(--es-ink);
  font-family: var(--es-font-display);
  font-size: clamp(22px, 1.2rem + 1.2vw, 34px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.es-term-more .es-term-section__title {
  font-size: clamp(20px, 1.1rem + 0.6vw, 26px);
  line-height: 1.1;
}

.es-term-courses {
  padding-top: clamp(48px, 6vw, 80px);
}

.es-term-courses .es-term-section__title {
  margin-bottom: var(--es-s-6);
}

/* «Курсы по …» + «Все курсы →» (the catalogue /kursy/ with the term filter, D40) */
.es-term-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--es-s-3) 20px;
  margin-bottom: var(--es-s-6);
}

.es-term-courses .es-term-section__head .es-term-section__title {
  margin: 0;
}

.es-term-section__more {
  font-weight: 800;
}

.es-term-empty p {
  color: var(--es-ink);
}
