.teachers {
  text-align: center;
  padding: 5rem 5.6%;
  padding-top: 17rem; /* Замените на реальное значение */
  margin-top: -12rem; /* Такое же значение, но с отрицательным знаком */
}

.teachers h2 {
  font-family: "Exo 2", sans-serif;
  color: black;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 8.5rem;
}

.teachers-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
  gap: 3rem;
  overflow: hidden;
  max-height: 94rem;
  transition: max-height 0.5s ease-in-out; /* Плавный переход высоты */
}

.teacher {
  background: transparent;
  padding: 0;
  /* height: auto; */
}

.teacher-photo {
  width: 54%;
  height: auto;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.teacher h3 {
  font-family: "Exo 2", sans-serif;
  color: #ff9bab;
  font-size: 2.2rem;
  margin-bottom: 2rem;
}

.teacher p {
  border-top: 1px solid #a3b6ba;
  padding-top: 1rem;
  font-size: 1.6rem;
  font-weight: 400;
  text-align: left;
  line-height: 1.33;
}

.teachers .show-more {
  width: 100%;
  height: 5rem;
  background-color: #ff9bab;
  border: none;
  border-radius: 5px;
  font-size: 1.8rem;
  margin-top: 3rem;
}

.teachers .show-more:hover {
  background-color: #f4667d;
}

.teachers .youtube-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.teachers .icon-play {
  width: 20px;
  height: 20px;
  vertical-align: text-bottom; /* Выравнивание по нижней части текста */
}

.modal-video {
  display: none; /* Скрыто по умолчанию */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4); /* Черный фон с прозрачностью */
  overflow: hidden; /* Убираем прокрутку */
}

.teachers .modal-content {
  position: relative;
  margin: 10% auto;
  padding: 0;
  width: 80%;
  max-width: 1000px;
  height: 70%;
  background-color: black;
}

.teachers .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.teachers .close:hover,
.teachers .close:focus {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.teachers iframe {
  width: 100%;
  height: 100%;
}

@media screen and (max-width: 480px) {
  .teachers {
    padding-top: 10rem; /* Замените на реальное значение */
    margin-top: -6rem; /* Такое же значение, но с отрицательным знаком */
  }

  .teachers h2 {
    font-size: 2.2rem;
    margin-bottom: 3rem;
  }

  .teacher h3 {
    font-size: 1.6rem;
  }

  .teacher p {
    font-size: 1.4rem;
    line-height: 1.5;
  }
}
