.teacher-results {
  padding: 34px 0 26px;
}

.teacher-results .teacher-results__layout {
  width: min(1320px, calc(100% - 48px));
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
}

.teacher-list {
  gap: 18px;
}

.teacher-result {
  min-height: 242px;
  padding: 16px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 260px 132px;
  grid-template-rows: 130px 64px;
  grid-template-areas:
    "media main times match"
    "media main stats match";
  column-gap: 18px;
  row-gap: 12px;
  align-items: stretch;
  border: 1px solid #dceaf7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(8, 35, 66, .06);
}

.teacher-result__media {
  grid-area: media;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 210px;
  overflow: hidden;
  border-radius: 18px;
  background: #eef5fb;
}

.teacher-photo-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.teacher-photo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .22s ease;
}

.teacher-photo-link:hover img {
  transform: scale(1.03);
}

.teacher-play {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, .94);
  background: rgba(8, 35, 66, .28);
  box-shadow: 0 14px 26px rgba(8, 35, 66, .18);
}

.teacher-play::before {
  margin-left: 3px;
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 14px;
}

.teacher-result__media.is-online::after {
  top: auto;
  right: 13px;
  bottom: 13px;
  width: 18px;
  height: 18px;
  border-width: 4px;
  z-index: 4;
}

.teacher-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  color: #ff2135;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(8, 35, 66, .12);
}

.teacher-favorite::before {
  content: "\2661";
  font-size: 22px;
  line-height: 1;
}

.teacher-favorite.is-active::before,
.teacher-favorite[aria-pressed="true"]::before {
  content: "\2665";
}

.teacher-result__main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2px 0 0;
}

.teacher-result__name {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #082342;
  font-size: 23px;
  line-height: 1.05;
  font-weight: 800;
  text-decoration: none;
  transition: color .18s ease;
}

.teacher-result__name:hover {
  color: #1687e8;
}

.teacher-result__verified {
  width: 19px;
  height: 19px;
}

.teacher-result__verified::before {
  width: 8px;
  height: 5px;
  border-left-width: 2px;
  border-bottom-width: 2px;
}

.teacher-result__role {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #33465f;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 500;
}

.teacher-result__lang-icon,
.teacher-result__role .flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.country-flag-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  cursor: help;
}

.country-flag-wrap::after {
  content: attr(data-country);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 20;
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.country-flag-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  z-index: 21;
  width: 10px;
  height: 10px;
  background: #111;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity .16s ease;
}

.country-flag-wrap:hover::after,
.country-flag-wrap:hover::before,
.country-flag-wrap:focus-visible::after,
.country-flag-wrap:focus-visible::before,
.country-flag-wrap--open::after,
.country-flag-wrap--open::before {
  opacity: 1;
}

.teacher-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 9px 0 0;
}

.teacher-badges .badge-verified {
  display: none;
}

.teacher-badges span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.teacher-badges .badge-top {
  background: #fff2d5;
  color: #f19000;
  box-shadow: inset 0 0 0 1px #ffc95c;
}

.teacher-badges .badge-top::before {
  content: "\2605";
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ffb11f;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  clip-path: none;
}

.teacher-badges .badge-native {
  background: #e9fbf3;
  color: #20ad72;
  box-shadow: inset 0 0 0 1px #9ee6ca;
}

.teacher-badges .badge-native::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  border-radius: 0;
  background: #20ad72;
  -webkit-mask: url("/assets/icons/tabler-microphone.svg") center / contain no-repeat;
  mask: url("/assets/icons/tabler-microphone.svg") center / contain no-repeat;
  box-shadow: none;
}

.teacher-result__description {
  display: block;
  max-width: 100%;
  margin: 13px 0 0;
  overflow: visible;
  color: #33465f;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.teacher-profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  color: #1687e8;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  vertical-align: -2px;
}

.teacher-highlights {
  width: 100%;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: auto;
  padding: 8px 13px;
  border-radius: 12px;
  background: #eef7ff;
  color: #33465f;
  font-size: 12px;
  line-height: 1.32;
  font-weight: 500;
}

.teacher-highlights span:not(.teacher-highlight-icon)::after {
  content: "\2022";
  margin-left: 10px;
  color: #52677f;
}

.teacher-highlights span:last-child::after {
  display: none;
}

.teacher-highlight-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #1687e8;
  font-size: 18px;
}

.teacher-times {
  grid-area: times;
  align-self: start;
  min-height: 130px;
  padding: 12px 14px;
  border: 1px solid #dceaf7;
  border-radius: 16px;
  background: #fff;
}

.teacher-times strong {
  display: block;
  margin: 0 0 11px;
  color: #082342;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 800;
}

.slot-grid {
  display: grid;
  grid-template-columns: 62px repeat(3, minmax(0, 1fr));
  gap: 8px 7px;
}

.slot-grid span {
  min-height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #dceaf7;
  border-radius: 10px;
  color: #263c59;
  background: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}

.slot-grid .slot-label {
  justify-content: start;
  place-items: center start;
  border: 0;
  color: #49627e;
  font-size: 12px;
  font-weight: 600;
}

.teacher-match {
  grid-area: match;
  display: grid;
  grid-template-rows: 74px 52px 46px;
  align-content: start;
  justify-items: center;
  gap: 10px;
}

.teacher-match .match-ring {
  width: 74px;
  height: 74px;
  margin: 0 auto;
}

.teacher-match .match-ring span {
  font-size: 22px;
  line-height: 1;
}

.teacher-match .match-ring small {
  font-size: 11px;
  font-weight: 700;
}

.teacher-match .btn,
.teacher-message-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.teacher-match .btn {
  min-height: 52px;
  padding: 10px 12px;
  background: #ff6422;
  color: #fff;
  box-shadow: none;
}

.teacher-message-btn {
  min-height: 46px;
  padding: 9px 12px;
  border: 2px solid #1687e8;
  background: #fff;
  color: #1687e8;
}

.teacher-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-self: start;
  align-items: center;
  min-height: 64px;
  color: #33465f;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 500;
}

.teacher-stats > span,
.teacher-result__rating {
  min-height: 64px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border-left: 1px solid #dceaf7;
  text-align: center;
}

.teacher-result__rating {
  grid-template-columns: auto auto;
  justify-content: center;
  border-left: 0;
}

.teacher-result__rating span:last-child {
  grid-column: 1 / -1;
  color: #33465f;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 500;
}

.teacher-result__rating strong,
.teacher-stats strong {
  color: #082342;
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
}

.teacher-result__star {
  color: #ffc107;
  font-size: 19px;
  line-height: 1;
}

@media (max-width: 1280px) {
  .teacher-result {
    grid-template-columns: 210px minmax(0, 1fr) 248px 124px;
    column-gap: 14px;
  }

  .teacher-result__name {
    font-size: 22px;
  }

  .teacher-result__description {
    margin-top: 12px;
    font-size: 14px;
  }

  .teacher-highlights {
    font-size: 12px;
  }
}

@media (max-width: 1180px) {
  .teacher-result {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "media main"
      "media times"
      "stats match";
  }

  .teacher-match {
    grid-template-columns: 88px 1fr 1fr;
    grid-template-rows: auto;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .teacher-results .teacher-results__layout {
    width: min(100% - 24px, 100%);
  }

  .teacher-result {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "media"
      "main"
      "times"
      "stats"
      "match";
    padding: 14px;
    min-height: 0;
  }

  .teacher-result__media {
    min-height: 280px;
  }

  .teacher-match {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .teacher-stats {
    grid-template-columns: 1fr;
  }

  .teacher-stats > span,
  .teacher-result__rating {
    border-left: 0;
    border-top: 1px solid #dceaf7;
  }

  .slot-grid {
    grid-template-columns: 1fr repeat(3, minmax(0, 1fr));
  }
}
