/*
 * /teachers/ — перенос страницы Tilda «Педагогический состав».
 * Специфичные стили раздела хранятся рядом со страницей.
 *
 * Основные исходные параметры Zero Block:
 * card desktop: 1160×503, background #f3f5f8, radius 6;
 * photo desktop: 150×164;
 * name: 20px;
 * body/stat: 16px;
 * education/specialization text: 14px;
 * filters: 20px, inactive #e7eaf1, active #537294;
 * popup backdrop: rgba(83,114,148,.40) + blur(6px).
 */

.teachers-page {
    color: #101e31;
    background: #fff;
}

.teachers-heading {
    padding-top: 150px;
}

.teachers-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    color: #a7acba;
    font-size: 14px;
    line-height: 1.4;
    opacity: .6;
}

.teachers-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.teachers-heading h1 {
    margin: 28px 0 0;
    color: #101e31;
    font-size: 42px;
    font-weight: 400;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Leadership table */

.teachers-management {
    padding-top: 120px;
}

.teachers-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.teachers-management__table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
    color: #101e31;
    font-size: 16px;
    line-height: 1.4;
}

.teachers-management__table th,
.teachers-management__table td {
    width: 25%;
    padding: 16px 18px;
    vertical-align: top;
    text-align: left;
    border: 1px solid #d9d9d9;
}

.teachers-management__table th {
    font-weight: 500;
    border-color: #3f5064;
}

.teachers-management__table a {
    color: inherit;
    text-decoration: none;
}

/* Filters */

.teachers-catalog {
    padding-top: 150px;
}

.teachers-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1160px;
    padding-bottom: 30px;
}

.teachers-filter {
    min-height: 37px;
    padding: 3px 20px;
    color: #101e31;
    font: inherit;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.55;
    text-transform: uppercase;
    white-space: nowrap;
    background: #e7eaf1;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

.teachers-filter:hover,
.teachers-filter:focus-visible,
.teachers-filter.is-active {
    color: #fff;
    background: #537294;
    outline: none;
}

/* Teacher cards */

.teachers-list {
    display: grid;
    gap: 30px;
}

.teacher-card {
    min-height: 503px;
    display: grid;
    grid-template-columns: 480px 280px 280px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "left education specialization"
        "left results results";
    column-gap: 30px;
    row-gap: 20px;
    padding: 30px;
    background: #f3f5f8;
    border-radius: 6px;
    box-sizing: border-box;
}

.teacher-card[hidden] {
    display: none !important;
}

.teacher-card__left {
    grid-area: left;
    min-width: 0;
}

.teacher-card__identity {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.teacher-card__photo {
    width: 150px;
    height: 164px;
    display: block;
    object-fit: cover;
    border-radius: 6px;
    background: #ccd1d7;
}

.teacher-card__identity-text h2 {
    margin: 2px 0 10px;
    color: #101e31;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
}

.teacher-card__subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.teacher-card__subjects span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 2px 14px;
    color: #101e31;
    font-size: 16px;
    line-height: 1.4;
    background: #e7eaf1;
    border-radius: 6px;
}

.teacher-card__identity-text > p,
.teacher-card__stat {
    margin: 4px 0 0;
    color: #3f5064;
    font-size: 16px;
    line-height: 1.4;
}

.teacher-card__summary {
    margin-top: 38px;
}

.teacher-card__description {
    max-width: 420px;
    margin: 14px 0 0 30px;
    color: #3f5064;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

.teacher-card__column {
    min-width: 0;
}

.teacher-card__column:nth-of-type(2) {
    grid-area: education;
}

.teacher-card__column:nth-of-type(3) {
    grid-area: specialization;
}

.teacher-card__column h3,
.teacher-card__results h3 {
    margin: 0;
    color: #101e31;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
}

.teacher-card__rule {
    height: 1px;
    margin: 14px 0 14px;
    background: #aeb8c2;
}

.teacher-card__column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.teacher-card__column li {
    margin: 0 0 10px;
    color: #3f5064;
    font-size: 14px;
    line-height: 1.4;
}

.teacher-card__results {
    grid-area: results;
    min-width: 0;
}

.teacher-card__result-list {
    display: grid;
    gap: 8px;
}

.teacher-card__result-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    color: #3f5064;
    font-size: 12px;
    line-height: 1.4;
}

.teacher-card__result-row strong {
    color: #3f5064;
    font-weight: 500;
}

.teacher-card__more {
    display: inline-flex;
    margin-top: 16px;
    padding: 0;
    color: #3f5064;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.55;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.teacher-card__more:hover,
.teacher-card__more:focus-visible {
    color: #101e31;
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}

/* Results popup, equivalent to the Tilda popup records */

.teacher-results-modal {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.teacher-results-modal.is-open {
    display: flex;
}

.teacher-results-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(83, 114, 148, .40);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.teacher-results-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 650px);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 34px 40px 40px;
    background: #fff;
    border-radius: 6px;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(16, 30, 49, .18);
    outline: none;
}

.teacher-results-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #101e31;
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.teacher-results-template h2 {
    margin: 0;
    padding-right: 42px;
    color: #101e31;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3;
}

.teacher-results-template h3 {
    margin: 24px 0 0;
    color: #101e31;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
}

.teacher-results-template__rows {
    margin-top: 18px;
    border-top: 1px solid #aeb8c2;
}

.teacher-results-template__row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    color: #3f5064;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #e0e4e8;
}

.teacher-results-template__row strong {
    color: #101e31;
    font-weight: 500;
}

body.teachers-modal-open {
    overflow: hidden;
}

/* Callback block — same Tilda concept, same common backend */

.teachers-callback {
    padding-top: 120px;
}

.teachers-callback__card {
    min-height: 464px;
    display: grid;
    grid-template-columns: minmax(0, 638px) minmax(0, 522px);
    overflow: hidden;
    background: #476382;
    border-radius: 6px;
}

.teachers-callback__content {
    padding: 34px 38px 36px 40px;
    color: #fff;
}

.teachers-callback__content h2 {
    margin: 0;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.4;
}

.teachers-callback__content > p {
    max-width: 560px;
    margin: 16px 0 0;
    font-size: 20px;
    line-height: 1.55;
}

.teachers-form {
    max-width: 560px;
    margin-top: 34px;
}

.teachers-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.teachers-form__field {
    display: block;
    margin: 0 0 14px;
}

.teachers-form__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.teachers-form input[type="text"],
.teachers-form input[type="tel"],
.teachers-form input[type="email"] {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    background: #5b7490;
    border: 1px solid #8d9cad;
    border-radius: 4px;
    box-sizing: border-box;
    outline: none;
}

.teachers-form input::placeholder {
    color: #b7c5d3;
    opacity: 1;
}

.teachers-form input:focus {
    border-color: #fff;
}

.teachers-form__honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
}

.teachers-form__consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 3px;
    color: #b7c5d3;
    font-size: 12px;
    line-height: 1.35;
}

.teachers-form__consent input {
    margin-top: 2px;
    accent-color: #a9162e;
}

.teachers-form__consent a {
    color: #b1c1d3;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.teachers-form__submit {
    width: 372px;
    height: 50px;
    margin-top: 18px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    background: #a9162e;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.teachers-form__submit:disabled {
    opacity: .65;
    cursor: default;
}

.teachers-form__message {
    min-height: 22px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.teachers-form__message.is-success {
    color: #d6f1df;
}

.teachers-form__message.is-error {
    color: #ffe0e0;
}

.teachers-callback__visual {
    min-width: 0;
    height: 464px;
}

.teachers-callback__visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

/* 960–1199: Tilda card width 940px, photo 107×153 */

@media (max-width: 1199px) {
    .teacher-card {
        min-height: 506px;
        grid-template-columns: 420px minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 20px;
        padding: 30px;
    }

    .teacher-card__identity {
        grid-template-columns: 107px minmax(0, 1fr);
        gap: 18px;
    }

    .teacher-card__photo {
        width: 107px;
        height: 153px;
    }

    .teacher-card__description {
        margin-left: 0;
    }

    .teachers-callback__card {
        min-height: 502px;
        grid-template-columns: 1fr 1.08fr;
    }

    .teachers-callback__visual {
        height: 502px;
    }

    .teachers-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .teachers-form__submit {
        width: 100%;
    }
}

/* Mobile: Tilda card width 300px, height around 871px */

@media (max-width: 959px) {
    .teachers-heading {
        padding-top: 90px;
    }

    .teachers-breadcrumb {
        font-size: 10px;
    }

    .teachers-heading h1 {
        margin-top: 20px;
        font-size: 30px;
    }

    .teachers-management {
        padding-top: 60px;
    }

    .teachers-management__table {
        min-width: 700px;
        font-size: 13px;
    }

    .teachers-management__table th,
    .teachers-management__table td {
        padding: 12px;
    }

    .teachers-catalog {
        padding-top: 90px;
    }

    .teachers-filters {
        gap: 4px 10px;
        padding-bottom: 30px;
    }

    .teachers-filter {
        min-height: 25px;
        padding: 2px 10px;
        font-size: 12px;
        border-radius: 4px;
    }

    .teachers-list {
        gap: 20px;
    }

    .teacher-card {
        width: min(300px, 100%);
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "left"
            "education"
            "specialization"
            "results";
        row-gap: 24px;
        margin: 0 auto;
        padding: 20px;
    }

    .teacher-card__identity {
        grid-template-columns: 79px minmax(0, 1fr);
        gap: 12px;
    }

    .teacher-card__photo {
        width: 79px;
        height: 87px;
        border-radius: 4px;
    }

    .teacher-card__identity-text h2 {
        margin-top: 0;
        font-size: 14px;
        line-height: 1.3;
    }

    .teacher-card__subjects {
        gap: 4px;
        margin-bottom: 6px;
    }

    .teacher-card__subjects span {
        min-height: 20px;
        padding: 1px 8px;
        font-size: 11px;
        border-radius: 4px;
    }

    .teacher-card__identity-text > p,
    .teacher-card__stat,
    .teacher-card__description {
        font-size: 11px;
        line-height: 1.4;
    }

    .teacher-card__identity-text > p {
        margin-top: 2px;
    }

    .teacher-card__summary {
        margin-top: 18px;
    }

    .teacher-card__description {
        max-width: none;
        margin: 10px 0 0;
    }

    .teacher-card__column h3,
    .teacher-card__results h3 {
        font-size: 12px;
    }

    .teacher-card__rule {
        margin: 9px 0 10px;
    }

    .teacher-card__column li {
        margin-bottom: 8px;
        font-size: 10px;
        line-height: 1.4;
    }

    .teacher-card__result-row {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 7px;
        font-size: 9px;
    }

    .teacher-card__more {
        margin-top: 12px;
        font-size: 11px;
    }

    .teacher-results-modal {
        padding: 10px;
    }

    .teacher-results-modal__dialog {
        max-height: calc(100vh - 20px);
        padding: 26px 18px 24px;
    }

    .teacher-results-template h2 {
        font-size: 18px;
    }

    .teacher-results-template h3 {
        font-size: 15px;
    }

    .teacher-results-template__row {
        grid-template-columns: 72px minmax(0, 1fr);
        font-size: 11px;
    }

    .teachers-callback {
        padding-top: 120px;
    }

    .teachers-callback__card {
        width: min(300px, 100%);
        min-height: 357px;
        display: block;
        margin: 0 auto;
    }

    .teachers-callback__content {
        padding: 16px 16px 20px;
    }

    .teachers-callback__content h2 {
        font-size: 18px;
        line-height: 1.4;
    }

    .teachers-callback__content > p {
        width: 246px;
        max-width: 100%;
        margin-top: 14px;
        font-size: 12px;
    }

    .teachers-form {
        margin-top: 16px;
    }

    .teachers-form__field {
        margin-bottom: 10px;
    }

    .teachers-form input[type="text"],
    .teachers-form input[type="tel"],
    .teachers-form input[type="email"] {
        height: 40px;
        font-size: 12px;
    }

    .teachers-form__consent {
        font-size: 8px;
    }

    .teachers-form__submit {
        height: 40px;
        margin-top: 12px;
        font-size: 12px;
    }

    .teachers-callback__visual {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .teachers-filter {
        transition: none;
    }
}
