/* Teachers section */

#teachers {
    background: #F5F5F6;
    padding: 72px 0 80px;
}

#teachers h2 {
    text-align: center;
    font-size: 34px;
    line-height: 1.2;
    font-weight: var(--font-black);
    color: var(--color-dark);
    margin-bottom: 12px;
}

#teachers h2::after {
    content: "";
    display: block;
    width: 78px;
    height: 5px;
    margin: 18px auto 0;
    border-radius: 999px;
    background: var(--color-humanitarian);
}

.teachers-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 42px;
}

.teacher-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: var(--color-white);
    box-shadow: 0 14px 34px rgba(27, 31, 38, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(27, 31, 38, 0.18);
}

.teacher-card .card__image {
    width: 100%;
    height: 330px;
    background: var(--color-gray-light);
    overflow: hidden;
}

.teacher-card .card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.25s ease;
}

.teacher-card:hover .card__image img {
    transform: scale(1.035);
}

.teacher-card .card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 22px 22px 18px;
    background: var(--color-white);
    border-top: 5px solid var(--color-humanitarian);
}

.teacher-card .card__body h3 {
    min-height: 46px;
    margin: 0 0 10px;
    color: var(--color-dark);
    font-size: 20px;
    line-height: 1.18;
    font-weight: var(--font-extra-bold);
}

.teacher-card .card__body > p:first-of-type {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(170, 0, 65, 0.1);
    color: var(--color-humanitarian);
    font-size: 14px;
    line-height: 1.2;
    font-weight: var(--font-bold);
}

.teacher-short {
    color: var(--color-gray);
    font-size: 15px;
    line-height: 1.5;
    font-weight: var(--font-regular);
}

.teacher-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px 20px;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-light);
}

.teacher-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(170, 0, 65, 0.25);
    border-radius: 999px;
    background: rgba(170, 0, 65, 0.06);
    color: var(--color-humanitarian);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.teacher-more:hover {
    background: var(--color-humanitarian);
    color: var(--color-white);
    border-color: var(--color-humanitarian);
    text-decoration: none;
}

.teacher-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 64px;
    height: 38px;
    padding: 0 13px;
    border: 1px solid var(--color-gray-light);
    border-radius: 999px;
    background: #F5F5F6;
    color: var(--color-gray);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.teacher-like:hover {
    transform: translateY(-1px);
    background: rgba(170, 0, 65, 0.08);
    color: var(--color-humanitarian);
    border-color: rgba(170, 0, 65, 0.35);
}

.teacher-like.liked {
    background: rgba(170, 0, 65, 0.12);
    color: var(--color-humanitarian);
    border-color: rgba(170, 0, 65, 0.42);
}

.teacher-like:disabled {
    cursor: default;
    opacity: 0.75;
    transform: none;
}

.teacher-like__heart {
    font-size: 22px;
    line-height: 1;
}

.teacher-like__count {
    line-height: 1;
}

/* Popup */

.teacher-modal__link {
    margin-top: 24px;
}

/* Adaptive */

@media (max-width: 1024px) {
    .teachers-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px;
    }

    .teacher-card .card__image {
        height: 280px;
    }

    .teacher-card .card__body {
        padding: 18px;
    }

    .teacher-card .card__body h3 {
        font-size: 18px;
    }

    .teacher-card__bottom {
        padding: 14px 18px 18px;
    }
}

@media (max-width: 860px) {
    .teachers-grid-3 {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }

    .teacher-card .card__image {
        height: 430px;
    }

    .teacher-card .card__body h3 {
        min-height: auto;
    }
}

@media (max-width: 520px) {
    #teachers {
        padding: 52px 0 60px;
    }

    #teachers h2 {
        font-size: 28px;
    }

    .teachers-grid-3 {
        margin-top: 34px;
    }

    .teacher-card {
        border-radius: 14px;
    }

    .teacher-card .card__image {
        height: 340px;
    }

    .teacher-card .card__body {
        min-height: auto;
        padding: 18px 16px 16px;
    }

    .teacher-card__bottom {
        padding: 14px 16px 18px;
    }

    .teacher-more {
        padding: 0 13px;
        font-size: 14px;
    }

    .teacher-like {
        min-width: 58px;
        padding: 0 11px;
    }
}


/* Стили для кнопки "Перейти на страницу преподавателя" */
.teacher-modal__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 12px 20px;
    background: var(--color-humanitarian);
    color: var(--color-white);
    border-radius: 6px;
    font-size: 16px;
    font-weight: var(--font-bold);
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.teacher-modal__link:hover {
    background-color: var(--color-dark);
}

.teacher-modal__link:focus {
    outline: none;
    background-color: var(--color-blue);
}