.teachers-content-wrap .swiper-wrapper {
    display: flex;
}
.teachers-content--gap {
    gap: 24px;
}
.teachers-content-wrap {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    height: 370px;
}
.teachers-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.teachers-item-pic {
    height: 245px;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.teachers-item {
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: unset !important;
    cursor: pointer;
}
.teachers-item-wrap {
    background-color: var(--light-grey);
    transition: .5s;
    height: 100%;
}
.teachers-item-content {
    padding: 12px;
    height: calc(100% - 269px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.teachers-item-name {
    padding-bottom: 12px;
    font-weight: bold;
    font-size: 16px;
    color: var(--near-black);
    line-height: var(--line-height);
    font-family: var(--font-roboto);
}
.teachers-item-img {
    width: 100%;
}
.teachers-item-arrow {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: bold;
    color: var(--light-blue);
    transition: .5s;
}
.teachers-item-arrow-pic {
    transition: .5s;
}
.teachers-item-link {
    display: block;
    height: 100%;
    background-color: var(--light-grey);
    transition: .5s;
}
.teachers-swiper-nav-button {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #F5F6FA;
    border-radius: var(--border-radius);
    background-color: #fff;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.04);
    position: absolute;
    z-index: 1;
    cursor: pointer;
    transition: .5s;
}
.teachers-item-link {
    border-bottom: unset;
}
.teachers-swiper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.teachers-swiper-nav-button--prev {
    left: -30px;
}
.teachers-swiper-nav-button--next {
    right: -30px;
}
.teachers-item-description {
    line-height: var(--line-height);
    color: var(--near-black);
}
.teachers-item-text {
     font-size: 14px;
    line-height: 1.4;
    max-height: calc(1.4em * 3);   /* 3 строки — фолбэк */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.teachers-popup, .teachers-overlay {
    z-index: 998;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.teachers-overlay {
    background-color: rgba(0, 0, 0, 0.4);
}
.teachers-popup {
    justify-content: center;
    align-items: center;
}
.teachers-popup__pic {
    grid-area: teacherPic;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 200px;
    margin-bottom: 28px;
}
.teacher-popup-info {
    grid-area:  teacherInfo;
}
.teacher-popup-name {
    grid-area:  teacherName;
    font-family: var(--font-roboto);
    font-weight: bold;
    font-size: 18px;
    color: var(--near-black);
}
.teacher-popup-description {
    grid-area: teacherDescription;
    color: var(--near-black);
}
.teacher-popup-certs {
    grid-area: teacherCerts;
    padding-top: 20px;
}
.teacher-popup-courses {
    grid-area: teacherCourses;
    padding-top: 20px;
}
.teacher-popup-about {
    grid-area: teacherAbout;
    color: var(--near-black);
    font-style: italic;
    padding: 12px;
    border-radius: 10px;
    background-color: var(--light-grey);
}
.teacher-popup-about::before {
    content: "";
    position: absolute;
    transform: translate(18px, -19px) rotate(134deg);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--light-grey);
}
.teacher-popup-certs-title, .teacher-popup-courses-name {
    font-weight: bold;
    color: var(--near-black);
}
.teachers-popup__img {
    width: inherit;
    object-fit: contain;
}
.teachers-popup-dialog {
    width: 100%;
    max-width: 624px;
    background-color: #fff;
    z-index: 998;
    position: relative;
    border-bottom: 28px solid white;
}
.teachers-popup-dialog-top {
    height: 28px;
    background: #fff;
    z-index: 999;
    position: sticky;
    top: -1px;
}
.teachers-popup-content {
    display: grid;
    grid-template-areas: "teacherPic teacherName"
                         "teacherPic teacherDescription"
                         "teacherAbout teacherAbout"
                         "teacherCerts teacherCerts"
                         "teacherCourses teacherCourses";
    grid-template-rows: 1fr 7fr;
    grid-template-columns: 1.2fr 2fr;
    gap: 0 24px;
    padding: 0 28px;
}
.teachers-popup-close {
    position: absolute;
    top: -3px;
    right: 1px;;
    z-index: 999;
    cursor: pointer;
}
.teacher-popup-certs-content ul {
    list-style-type: none;
    margin: 0;
}
.teacher-popup-courses-list-item::marker {
    color: #197DD1;
}
.teacher-popup-courses-list-item__link {
    text-decoration: underline dotted var(--light-blue) 2px !important;
    text-underline-offset: 6px;
    border-bottom: unset;
    color: var(--light-blue) !important;
    line-height: 24px;
}
.teacher-popup-courses-list {
    margin: 0;
    padding-left: 25px;
}
.teachers-item-content-top {
    padding-bottom: 10px;
}
@media screen {
    .teachers-item:hover .teachers-item-arrow-pic {
        transform: translateX(15px);
    }
    .teachers-item-wrap:hover, .teachers-swiper-nav-button:hover, .teachers-item-link:hover {
        background-color: var(--grey-hover);
    }
}
@media screen and (min-width: 550px) {
    .teachers-item:hover {
        background-color: var(--grey-hover);
    }
}
@media (max-width: 1350px) {
    .teachers-item {
        max-width: unset;
    }
}
@media (max-width: 992px) {
    .teachers-swiper-nav-button--prev {
        left: -25px;
    }
    .teachers-swiper-nav-button--next {
        right: -25px;
    }
    
    .teachers-item-pic {
        height: auto;
    }
}
@media (max-width: 920px) {
    .teachers-swiper-nav-button--prev {
        left: -16px;
    }
    .teachers-swiper-nav-button--next {
        right: -16px;
    }
}
@media (max-width: 768px) {
    .teachers-content-wrap {
        height: max-content;
    }
    .teachers-item-content {
        height: calc(100% - 270px);
    }
}
@media (max-width: 645px) {
    .teachers-popup-dialog {
        margin: 10px 10px 0 10px;
        height: 90vh;
        overflow-y: scroll;
    }
    .teachers-popup {
        align-items: start;
    }
}
@media (max-width: 460px) {
    .teachers-popup-content {
        grid-template-rows: 1fr 3fr;
    }
    
    .teachers-item-content {
        height: calc(100% - 230px);
    }
}
@media (max-width: 425px) {
    .teachers-swiper-nav-button {
        position: relative;
    }
    .teachers-swiper-nav-button--next {
        right: unset;
    }
    .teachers-swiper-nav-button--prev {
        left: unset;
    }
    .teachers-swiper {
        display: grid;
        grid-template-areas: "btn-prev btn-next"
                             "slider slider";
        gap: 32px 24px;
    }
    .teachers-swiper, .teachers-swiper .swiper {
        max-width: 100%;
    }
    .teachers-content-wrap {
        grid-area: slider;
    }
    .teachers-swiper-nav-button--prev {
        grid-area: btn-prev;
        justify-self: end;
    }
    .teachers-swiper-nav-button--next {
        grid-area: btn-next;
    }
    .teachers-item-pic { 
		aspect-ratio: 1; 
		height: auto !important; 
		width: 100%;
	}
	.teachers-item-wrap {
		max-width: 100%;
		width: 100%;
		border-radius: var(--border-radius);
	}
	.teachers-item {
		display: flex !important;
		justify-content: center;
	}
	.teachers-content-wrap {
        height: auto;
    }
    .teachers-item-content {
        height: calc(100% - 325px);
    }
    .teachers-item-name {
        font-size: 20px;
    }
    .teachers-item-text {
        font-size: 16px;
    }
}
@media (max-width: 410px) {
    .teachers-popup__pic {
        width: 150px;
    }
}
@media (max-width: 360px) {
    .teachers-popup-content {
        display: flex;
        flex-direction: column;
    }
    .teacher-popup-description {
        padding-bottom: 15px;
    }
    
}