/**
 * Стили только для страницы «О клинике» (шаблоны page-about*).
 * Подключается из functions.php при str_contains( шаблон, 'page-about' ).
 * Включая: таймлайн .main_about_four_flex / .m_a_f_b* (раньше в style.css).
 */

/* Якоря: отступ под фиксированным хедером */
.page-template-page-about .anchor-offset {
    scroll-margin-top: calc(var(--header-height) + var(--h2-margin-top));
}

/* Секция "Наша команда" — десктоп */
#team.anchor-offset .team-section h2 {
    padding-bottom: 30px;
}
#team.anchor-offset .team-content {
    display: grid;
    grid-template-columns: calc(50% - 20px) calc(50% - 20px);
    grid-template-rows: auto auto auto;
    grid-template-areas: "big text" "big photos" "big btn";
    gap: 40px;
    align-items: start;
    padding-bottom: 20px;
}
#team.anchor-offset .team-photo-main {
    grid-area: big;
    margin-bottom: 0;
}
#team.anchor-offset .team-photo-main img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}
#team.anchor-offset .team-text {
    grid-area: text;
    font-family: 'Roboto', 'Arial', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}
#team.anchor-offset .team-text p {
    margin: 0 0 14px 0;
}
#team.anchor-offset .team-text p:last-child {
    margin-bottom: 0;
}
#team.anchor-offset .team-photos {
    grid-area: photos;
    display: flex;
    gap: 12px;
    margin-top: 24px;
    width: 100%;
}
#team.anchor-offset .team-photos img:first-child {
    width: calc((100% - 12px) * 63 / 111);
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
}
#team.anchor-offset .team-photos img:last-child {
    width: calc((100% - 12px) * 48 / 111);
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
}
#team.anchor-offset .team-btn-wrap {
    grid-area: btn;
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 0;
}


@media only screen and (max-width: 1024px) {
    #team.anchor-offset .team-content {
        grid-template-columns: calc(55% - 14px) calc(45% - 14px);
        grid-template-rows: auto auto;
        grid-template-areas: "big text" "photos btn";
        row-gap: 10px;
        column-gap: 28px;
    }
    #team.anchor-offset .team-photo-main {
        margin-bottom: 0;
    }
    #team.anchor-offset .team-photo-main img {
        width: 100%;
        height: auto;
        display: block;
    }
    #team.anchor-offset .team-text {
        font-size: 15px;
    }
    #team.anchor-offset .team-photos {
        margin-top: 0;
        gap: 10px;
    }
    #team.anchor-offset .team-photos img:first-child {
        width: calc((100% - 10px) * 63 / 111);
    }
    #team.anchor-offset .team-photos img:last-child {
        width: calc((100% - 10px) * 48 / 111);
    }
    #team.anchor-offset .team-btn-wrap {
        margin-top: 30px;
        text-align: center;
        grid-column: auto;
    }
}

@media only screen and (max-width: 768px) {
    #team.anchor-offset .team-section h2 {
        padding-bottom: 24px;
    }
    #team.anchor-offset .team-content {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    #team.anchor-offset .team-photo-main {
        order: 0;
    }
    #team.anchor-offset .team-photo-main img {
        width: 100%;
        height: auto;
        display: block;
    }
    #team.anchor-offset .team-photos {
        order: 1;
        margin-top: 0;
        margin-bottom: 0;
        display: flex;
        gap: 10px;
        width: 100%;
    }
    #team.anchor-offset .team-photos img:first-child {
        width: calc((100% - 10px) * 63 / 111);
        height: auto;
        display: block;
        object-fit: contain;
    }
    #team.anchor-offset .team-photos img:last-child {
        width: calc((100% - 10px) * 48 / 111);
        height: auto;
        display: block;
        object-fit: contain;
    }
    #team.anchor-offset .team-text {
        order: 2;
        font-size: 15px;
    }
    #team.anchor-offset .team-btn-wrap {
        order: 3;
        margin-top: 0;
        display: flex;
        justify-content: center;
        text-align: center;
        width: 100%;
    }
}

@media only screen and (max-width: 475px) {
    #team.anchor-offset .team-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* Блок обратной связи на странице О клинике */
.page-template-page-about .home_callback_main img {
    left: auto;
    right: 0;
}
.page-template-page-about .home_callback_main {
    padding: 40px 0 8px 0;
}
.page-template-page-about .owl-carousel {
    z-index: 0;
}
.page-template-page-about .home_callback_main .wpcf7-form .flex_call,
.page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
    display: flex;
    padding-left: 0;
}

/* Размер изображения в форме на странице О клинике */
.page-template-page-about #scroll_to_form .home_callback_main img {
    width: 270px;
}

@media only screen and (max-width: 768px) {
    .page-template-page-about #scroll_to_form .home_callback_main img {
        width: 185px;
    }
}

@media only screen and (max-width: 1024px) {
    .page-template-page-about .home_callback_main_text {
        margin: 0 0 40px 0;
        max-width: 67%;
    }
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
        /*width: 36%;*/
    }
    .page-template-page-about .home_callback_main_text,
    .page-template-page-about .home_callback_main_title,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
        text-align: left;
    }
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
        margin: 0;
    }
    .page-template-page-about .home_callback_main .wpcf7 .wpcf7-acceptance .wpcf7-list-item {
        padding-left: 0;
    }
}

@media only screen and (max-width: 768px) {
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
        flex-wrap: wrap;
    }
}

@media only screen and (max-width: 475px) {
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call,
    .page-template-page-about .home_callback_main .wpcf7-form .flex_call p {
        display: block;
    }
}

/* ---------------------------------------------------------------------------
 * Таймлайн истории клиники — page-about-minsk / page-about-svetlogorsk
 * (раньше в style.css)
 * --------------------------------------------------------------------------- */

.main_about_four_text {
    font-family: 'Roboto', 'Arial', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #605C5C;
}

.main_about_four_text p {
    margin-bottom: 10px;
}

.main_about_four_flex {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 100px;
}

.m_a_f_b {
    border: 1px solid transparent;
    height: 250px;
}

.m_a_f_b1 {
    order: 1;
    border-top-color: var(--color-text);
    width: 40%;
    border-top-left-radius: 5px;
    padding-right: 120px;
}

.m_a_f_b2 {
    order: 2;
    width: 60%;
    border-top-color: var(--color-text);
    border-right-color: var(--color-text);
    border-bottom-color: var(--color-text);
    border-radius: 0 500px 500px 0;
    padding-right: 320px;
}

.m_a_f_b3 {
    order: 4;
    width: 43%;
    margin-right: 10%;
    text-align: right;
    padding-left: 140px;
}

.m_a_f_b4 {
    order: 3;
    width: 47%;
    text-align: right;
    border-top-color: var(--color-text);
    border-left-color: var(--color-text);
    border-bottom-color: var(--color-text);
    border-radius: 500px 0 0 500px;
    margin-top: -1px;
    padding-left: 150px;
}

.m_a_f_b5 {
    order: 5;
    width: 37%;
    margin-left: 10%;
    padding-right: 80px;
}

.m_a_f_b6 {
    order: 6;
    width: 53%;
    border-top-color: var(--color-text);
    border-right-color: var(--color-text);
    border-bottom-color: var(--color-text);
    border-radius: 0 500px 500px 0;
    margin-top: -2px;
    padding-left: 25px;
    padding-right: 230px;
}

.m_a_f_b7 {
    order: 8;
    width: 42%;
    margin-right: 10%;
    text-align: right;
    padding-left: 140px;
}

.m_a_f_b8 {
    order: 7;
    width: 47%;
    text-align: right;
    border-top-color: var(--color-text);
    border-left-color: var(--color-text);
    border-bottom-color: var(--color-text);
    border-radius: 500px 0 0 500px;
    margin-top: -1px;
    padding-left: 150px;
}

.m_a_f_b9 {
    order: 9;
    width: 37%;
    margin-left: 10%;
    padding-right: 80px;
}

.m_a_f_b_date {
    font-weight: 400;
    font-size: 28px;
    color: var(--color-text);
    margin-top: -58px;
}

.m_a_f_b_date:after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 100%;
    display: block;
    margin-top: 5px;
}

.m_a_f_b_title {
    font-weight: 600;
    font-size: 20px;
    color: var(--color-text);
    margin: 15px 0 10px 0;
    line-height: 25px;
}

.m_a_f_b_text {
    font-family: 'Roboto', 'Arial', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #605C5C;
}

.m_a_f_b.m_a_f_b3 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b4 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b7 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b8 .m_a_f_b_date:after {
    float: right;
    margin: 5px 0 0 95%;
}

.m_a_f_b.m_a_f_b3 .m_a_f_b_title, .m_a_f_b.m_a_f_b4 .m_a_f_b_title, .m_a_f_b.m_a_f_b7 .m_a_f_b_title, .m_a_f_b.m_a_f_b8 .m_a_f_b_title {
    padding-top: 20px;
}

.m_a_f_b.m_a_f_b7 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b8 .m_a_f_b_date:after {
    float: right;
    margin: 2px 0 0 95%;
}

@media only screen and (max-width: 1260px) {
    .m_a_f_b_date {
        font-size: 24px;
        margin-top: -53px;
    }

    .m_a_f_b_title {
        font-size: 18px;
    }

    .m_a_f_b1 {
        padding-right: 60px;
    }

    .m_a_f_b2 {
        padding-left: 150px;
        padding-right: 80px;
    }

    .m_a_f_b4 {
        padding-left: 95px;
    }

    .m_a_f_b3 {
        padding-left: 90px;
    }

    .m_a_f_b5 {
        padding-right: 15px;
    }

    .m_a_f_b9 {
        padding-right: 15px;
    }

    .m_a_f_b6 {
        padding-left: 80px;
        padding-right: 80px;
    }

    .m_a_f_b7 {
        padding-left: 40px;
    }

    .m_a_f_b8 {
        padding-left: 110px;
    }

    .m_a_f_b.m_a_f_b3 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b4 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b7 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b8 .m_a_f_b_date:after {
        margin: 6px 0 0 95%;
    }

    .m_a_f_b.m_a_f_b7 .m_a_f_b_date:after, .m_a_f_b.m_a_f_b8 .m_a_f_b_date:after {
        margin: 3px 0 0 95%;
    }
}

@media only screen and (max-width: 1024px) {
    .m_a_f_b4 {
        padding-left: 20px;
        padding-right: 20px;
    }

    .m_a_f_b2 {
        padding-left: 60px;
        padding-right: 80px;
    }

    .m_a_f_b1 {
        padding-right: 0;
    }

    .m_a_f_b3 {
        padding-left: 0;
        padding-right: 30px;
    }

    .m_a_f_b5 {
        padding-right: 0;
        padding-left: 40px;
        width: 38%;
        margin-left: 9%;
    }

    .m_a_f_b9 {
        padding-right: 0;
        padding-left: 40px;
        width: 38%;
        margin-left: 9%;
    }

    .m_a_f_b6 {
        padding-left: 60px;
        padding-right: 40px;
    }

    .m_a_f_b7 {
        padding-left: 20px;
        width: 38%;
        margin-right: 14%;
    }

    .m_a_f_b8 {
        padding-left: 85px;
    }
}

@media only screen and (max-width: 768px) {
    .m_a_f_b1 {
        width: 86%;
        margin-left: 14%;
        border-right-color: var(--color-text);
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
        border-bottom-color: var(--color-text);
        height: 165px;
    }

    .m_a_f_b2 {
        width: 85%;
        margin-right: 15%;
        border-left-color: var(--color-text);
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
        border-bottom-color: var(--color-text);
        padding-right: 0;
        padding-left: 20px;
        text-align: right;
        border-right-color: transparent;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        margin-top: -1px;
        height: 220px;
    }

    .m_a_f_b2 .m_a_f_b_date:after {
        margin-left: 95%;
    }

    .m_a_f_b3 {
        width: 100%;
        order: 3;
    }

    .m_a_f_b4 {
        width: 100%;
    }

    .m_a_f_b5 {
        width: 100%;
    }

    .m_a_f_b9 {
        width: 100%;
    }

    .m_a_f_b6 {
        width: 100%;
    }

    .m_a_f_b7 {
        width: 100%;
        order: 7;
    }

    .m_a_f_b8 {
        width: 100%;
    }

    .m_a_f_b_title {
        font-size: 16px;
        margin: 5px 0 10px 0;
    }

    .m_a_f_b_date {
        font-size: 20px;
        margin-top: -46px;
    }

    .m_a_f_b_text {
        font-size: 14px;
    }

    .m_a_f_b3 {
        width: 85%;
        margin-left: 14%;
        border-right-color: var(--color-text);
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
        border-bottom-color: var(--color-text);
        margin-top: -1px;
        border-top-color: var(--color-text);
        margin-right: 0;
        text-align: left;
        height: 200px;
    }

    .m_a_f_b3 .m_a_f_b_date:after {
        margin-right: 93% !important;
    }

    .m_a_f_b.m_a_f_b3 .m_a_f_b_title, .m_a_f_b.m_a_f_b4 .m_a_f_b_title, .m_a_f_b.m_a_f_b7 .m_a_f_b_title, .m_a_f_b.m_a_f_b8 .m_a_f_b_title {
        padding-top: 26px;
    }

    .m_a_f_b4 {
        width: 85%;
        margin-right: 15%;
        border-left-color: var(--color-text);
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
        border-bottom-color: var(--color-text);
        padding-right: 0;
        padding-left: 20px;
        text-align: right;
        border-right-color: transparent;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        margin-top: -1px;
        height: 215px;
    }

    .m_a_f_b4 .m_a_f_b_date:after {
        margin-left: 95%;
    }

    .m_a_f_b5 {
        width: 85%;
        margin-left: 14%;
        border-right-color: var(--color-text);
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
        border-bottom-color: var(--color-text);
        margin-top: -1px;
        border-top-color: var(--color-text);
        margin-right: 0;
        text-align: left;
        padding-left: 0;
        padding-right: 10px;
        height: 215px;
    }

    .m_a_f_b5 .m_a_f_b_date:after {
        margin-right: 93% !important;
    }

    .m_a_f_b6 {
        width: 85%;
        margin-right: 15%;
        border-left-color: var(--color-text);
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
        border-bottom-color: var(--color-text);
        padding-right: 0;
        padding-left: 12px;
        text-align: right;
        border-right-color: transparent;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        margin-top: -1px;
        height: 200px;
    }

    .m_a_f_b6 .m_a_f_b_date:after {
        margin-left: 95%;
    }

    .m_a_f_b7 {
        width: 85%;
        margin-left: 14%;
        border-right-color: var(--color-text);
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
        margin-top: -1px;
        border-top-color: var(--color-text);
        margin-right: 0;
        text-align: left;
        padding-left: 0;
        padding-right: 20px;
        height: 220px;
    }

    .m_a_f_b7 .m_a_f_b_date:after {
        margin-right: 93% !important;
    }

    .m_a_f_b8 {
        width: 97%;
        margin-right: 0;
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
        padding-right: 0;
        padding-left: 34px;
        text-align: right;
        border-right-color: transparent;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        margin-top: -12px;
    }

    .m_a_f_b8 .m_a_f_b_date:after {
        margin-left: 95%;
    }
}


