.tainstvo-page {
    --tainstvo-section-gap: 4.5rem;
    background: #fff;
    color: #000;
}

.tainstvo-page .container > *,
.tainstvo-page .service__grid > *,
.tainstvo-page .contacts-page__form > * {
    min-width: 0;
}

/* Фото остается фоном блока: заголовок всегда поверх него. */
.tainstvo-hero {
    position: relative;
    isolation: isolate;
    min-height: 36rem;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem 0 14rem;
    color: #fff;
}

.tainstvo-hero > img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tainstvo-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .05));
}

.tainstvo-hero .breadcrumbs li {
    color: #fff;
    opacity: 1;
}

.tainstvo-page .tainstvo-hero__title {
    margin: 0;
    padding-top: 0;
    max-width: 100%;
    color: #fff;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.2;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* Текстовый блок использует исходное оформление статьи. */
.tainstvo-page .detail__header {
    background: #fff;
    color: #000;
}

.tainstvo-page > .service {
    margin: 0;
    padding: 0 0 var(--tainstvo-section-gap);
}

.tainstvo-page .service__title {
    margin: 0 0 2.5rem;
    line-height: 1.2;
}

.tainstvo-page .service__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.tainstvo-page .service-item {
    min-height: 0;
    padding: 2.5rem;
}

.tainstvo-page .service-item::before {
    display: none;
}

.tainstvo-page .service-item__title {
    margin: 0 0 1.5rem;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.tainstvo-card__text {
    margin: 0;
    font-family: "Suisse Intl", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

.tainstvo-page > .tainstvo-contacts {
    margin: 0;
    padding: 0 0 var(--tainstvo-section-gap);
    scroll-margin-top: 2rem;
}

.tainstvo-contacts .contacts-page__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 2.5rem;
    padding: 3.5rem 0;
    border-top: 1px solid #d9d9d9;
    border-bottom: 1px solid #d9d9d9;
}

.tainstvo-contacts .contacts-page__form-img {
    display: block;
    width: 100%;
    height: auto;
}

.tainstvo-contacts .contacts-page__green-title {
    margin: 0 0 1.5rem;
    line-height: 1.3;
}

.tainstvo-contacts .contacts-page__form-descr p {
    margin: 0;
}

.tainstvo-contacts .contacts-page__form-descr {
    line-height: 1.6;
}

.tainstvo-contacts .contacts-page__form-phone {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.tainstvo-contacts .contacts-page__line-wrap {
    gap: 1.5rem;
    line-height: 1.5;
}

.tainstvo-contacts .contacts-page__line-wrap::before {
    flex-shrink: 0;
}

.tainstvo-contacts .contacts-page__form-bottom {
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
}

.tainstvo-contacts .contacts-page__form-bottom .btn {
    flex-shrink: 0;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.tainstvo-contacts .contacts-page__form-bottom-descr {
    flex: 1 1 14rem;
    margin: 0;
    line-height: 1.6;
}

.tainstvo-page > .questions-page {
    margin: 0;
    padding: 0 0 var(--tainstvo-section-gap);
    scroll-margin-top: 2rem;
}

.tainstvo-page .long-page__section-title {
    margin: 0 0 2.5rem;
    line-height: 1.2;
}

.tainstvo-page .q-item__open-section {
    align-items: center;
}

.tainstvo-page .q-item__plus {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .tainstvo-page .service-item {
        padding: 2rem 1.5rem;
    }

    .tainstvo-contacts .contacts-page__form {
        gap: 2rem;
    }

    .tainstvo-contacts .contacts-page__form-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .tainstvo-contacts .contacts-page__form-bottom-descr {
        flex: initial;
    }
}

@media (max-width: 998px) {
    .tainstvo-page {
        --tainstvo-section-gap: 3rem;
    }

    .tainstvo-hero {
        min-height: 24rem;
        padding: 3rem 0;
    }

    .tainstvo-page .tainstvo-hero__title {
        padding-top: 0;
    }

    .tainstvo-page .service__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .tainstvo-page .service-item__title {
        margin-bottom: 1rem;
    }

    .tainstvo-contacts .contacts-page__form {
        grid-template-columns: minmax(0, 1fr);
        padding: 2.5rem 0;
    }

    .tainstvo-contacts .contacts-page__form-img {
        max-height: 28rem;
        object-fit: cover;
    }

    .tainstvo-page .service__title,
    .tainstvo-page .long-page__section-title {
        margin-bottom: 1.75rem;
    }
}

@media (max-width: 600px) {
    .tainstvo-page {
        --tainstvo-section-gap: 2.5rem;
    }

    .tainstvo-hero {
        min-height: 20rem;
        margin-top: 1.5rem;
    }

    .tainstvo-page .tainstvo-hero__title {
        padding-top: 0;
    }

    .tainstvo-page .service__title {
        font-size: 1.75rem;
    }

    .tainstvo-page .service-item {
        padding: 1.5rem;
    }

    .tainstvo-contacts .contacts-page__form {
        padding: 2rem 0;
        gap: 1.5rem;
    }

    .tainstvo-contacts .contacts-page__form-phone {
        font-size: 1.5rem;
    }

    .tainstvo-contacts .contacts-page__line-wrap {
        gap: 1rem;
    }

    .tainstvo-contacts .contacts-page__form-bottom,
    .tainstvo-contacts .contacts-page__form-bottom .btn {
        width: 100%;
    }
}

.tainstvo-page > .tainstvo-gallery {
    margin: 0;
    padding: 0 0 var(--tainstvo-section-gap);
    overflow: hidden;
}

.tainstvo-gallery::before {
    display: none;
}

.tainstvo-gallery .c-gallery__title {
    text-align: left;
    margin: 0 0 2.5rem;
    font-size: 3rem;
    line-height: 1.2;
}

.tainstvo-gallery .swiper {
    width: 100%;
    max-width: 70rem;
    margin-inline: auto;
    overflow: hidden;
    border-radius: .625rem;
}

.tainstvo-gallery .gallery-item__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 38rem;
    object-fit: cover;
}

.tainstvo-gallery .slider-btn_prev {
    left: 1rem;
    transform: translateY(-50%);
}

.tainstvo-gallery .slider-btn_next {
    right: 1rem;
    transform: translateY(-50%);
}

@media (max-width: 998px) {
    .tainstvo-page .tainstvo-hero__title {
        padding-top: 0;
    }

    .tainstvo-gallery .c-gallery__title {
        font-size: 2rem;
        margin-bottom: 1.75rem;
    }
}

@media (max-width: 600px) {
    .tainstvo-page .tainstvo-hero__title {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
        padding-top: 0;
    }

    .tainstvo-hero > img {
        object-position: center 65%;
    }

    .tainstvo-gallery .gallery-item__img {
        aspect-ratio: 4 / 3;
    }

    .tainstvo-gallery .slider-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .tainstvo-gallery .slider-btn_prev {
        left: .5rem;
    }

    .tainstvo-gallery .slider-btn_next {
        right: .5rem;
    }
}

.tainstvo-page > .tainstvo-route {
    margin: 0;
    padding: 0 0 var(--tainstvo-section-gap);
}

.tainstvo-route .block-title {
    margin: 0 0 2rem;
    line-height: 1.2;
}

.tainstvo-route__address {
    display: grid;
    gap: .75rem;
    margin-bottom: 2rem;
    font-family: "Suisse Intl", sans-serif;
    line-height: 1.5;
}

.tainstvo-route__address h3,
.tainstvo-route__address p {
    margin: 0;
}

.tainstvo-route__address h3 {
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: none;
}

.tainstvo-route__address a {
    justify-self: start;
    color: #105c2e;
    text-decoration: underline;
}

/* Карта и плашка времени используют общие стили страницы контактов. */
@media (max-width: 600px) {
    .tainstvo-route .block-title { font-size: 1.75rem; margin-bottom: 1.5rem; }
    .tainstvo-route__address { margin-bottom: 1.5rem; }
    .tainstvo-route__address h3 { font-size: 1.25rem; }
}
