/* ============================================================
   Анкета репетитора: раскладка «рельса + одна колонка» (25.08.2026).
   Разметка — theme/dist-tutor/tpl/page/user/profile.tpl (.dt-pf).

   До этого тело анкеты делилось на две колонки, и человек не понимал,
   где что искать. Теперь как на «Профи»: слева навигация по разделам
   (о специалисте / документы / цены / отзывы), справа — разделы подряд.

   Файл подключается после refresh.css и aside.css и гасит их floats
   внутри новой сетки. У портала html{font-size:62.5%} → только пиксели,
   в index.tpl глобальный * { margin: 0 auto } → поля задаём явно.
   ============================================================ */

.dt-profile--rail .dt-pf {
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr) auto;
    gap: 0 24px;
    align-items: start;
    margin: 0;
}

/* ---------- рельса ---------- */

.dt-profile--rail .dt-pf-rail {
    position: sticky;
    /* шапка портала зафиксирована и высотой 68px — липкие блоки встают под неё */
    top: 84px;
    margin: 0;
    padding: 0;
}

.dt-profile--rail .dt-pf-rail__back {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dt-ink, #0f172a);
    text-decoration: none;
}
.dt-profile--rail .dt-pf-rail__back:hover { color: var(--dt-accent, #2563eb); text-decoration: none; }
.dt-profile--rail .dt-pf-rail__arrow { margin: 0; font-size: 17px; line-height: 1; }
.dt-profile--rail .dt-pf-rail__back,
.dt-profile--rail .dt-pf-nav__link > * { margin-left: 0; margin-right: 0; }

.dt-profile--rail .dt-pf-nav {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}
.dt-profile--rail .dt-pf-nav li { margin: 0 0 2px; }

.dt-profile--rail .dt-pf-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--dt-text, #475569);
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease;
}
.dt-profile--rail .dt-pf-nav__link:hover {
    background: #f1f5f9;
    color: var(--dt-ink, #0f172a);
    text-decoration: none;
}
.dt-profile--rail .dt-pf-nav__link.is-active {
    background: #eef2f8;
    color: var(--dt-ink, #0f172a);
}
.dt-profile--rail .dt-pf-nav__ico { flex: none; color: #94a3b8; }
.dt-profile--rail .dt-pf-nav__link.is-active .dt-pf-nav__ico { color: var(--dt-accent, #2563eb); }
.dt-profile--rail .dt-pf-nav__count {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: #94a3b8;
}

/* блок владельца/менеджера (рейтинг, управление анкетой) живёт под навигацией */
.dt-profile--rail .dt-pf-rail .sideBlocks {
    float: none;
    width: auto;
    margin: 0;
}

/* ---------- колонка с разделами ---------- */

.dt-profile--rail .dt-pf-main { min-width: 0; }

.dt-profile--rail .dt-pf-main .profile_body {
    float: none;
    width: auto;
    margin: 0;
}

/* якорь не должен уезжать под шапку */
.dt-profile--rail .dt-pf-sec { scroll-margin-top: 88px; }

/* внутри разделов бутстраповские спаны больше не колонки */
.dt-profile--rail .dt-pf-sec > .span6,
.dt-profile--rail .dt-pf-sec > .span12,
.dt-profile--rail .dt-pf-sec .block-education,
.dt-profile--rail .dt-pf-sec .block-about-tutor,
.dt-profile--rail .dt-pf-sec .block-prices,
.dt-profile--rail .dt-pf-sec .dt-profile-albums,
.dt-profile--rail .dt-pf-sec .dt-profile-reviews {
    float: none;
    width: auto;
    margin: 0;
}

/* ---------- правая колонка ---------- */

.dt-profile--rail .dt-pf > .dt-aside {
    float: none;
    width: 300px;
    margin: 0;
    position: sticky;
    top: 84px;
}
/* aside.css ужимал тело анкеты под старые floats — в сетке это лишнее */
.dt-profile--rail .dt-pf-main .profile_body,
body:has(.dt-aside) .dt-profile--rail .dt-pf-main .profile_body { width: auto; }

/* ---------- узкие экраны ---------- */

@media (max-width: 1180px) {
    .dt-profile--rail .dt-pf { grid-template-columns: 196px minmax(0, 1fr); }
    .dt-profile--rail .dt-pf > .dt-aside {
        grid-column: 2;
        position: static;
        width: 100%;
        max-width: 420px;
        margin: 16px 0 0;
    }
}

@media (max-width: 900px) {
    .dt-profile--rail .dt-pf { display: block; }
    .dt-profile--rail .dt-pf-rail {
        position: sticky;
        top: 68px;
        z-index: 20;
        margin: 0 0 14px;
        padding: 6px 0;
        background: var(--dt-bg, #f6f8fb);
    }
    .dt-profile--rail .dt-pf-rail__back { margin-bottom: 8px; padding: 0; }
    .dt-profile--rail .dt-pf-nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        margin: 0;
        padding: 0 0 4px;
        -webkit-overflow-scrolling: touch;
    }
    .dt-profile--rail .dt-pf-nav::-webkit-scrollbar { display: none; }
    .dt-profile--rail .dt-pf-nav li { margin: 0; }
    .dt-profile--rail .dt-pf-nav__link {
        white-space: nowrap;
        border: 1px solid var(--dt-border, #e2e8f0);
        background: #fff;
        font-size: 13.5px;
        padding: 8px 12px;
    }
    .dt-profile--rail .dt-pf-nav__ico { display: none; }
    .dt-profile--rail .dt-pf-rail .sideBlocks { margin: 12px 0 0; }
    .dt-profile--rail .dt-pf > .dt-aside { max-width: none; margin: 16px 0 0; }
    .dt-profile--rail .dt-pf-sec { scroll-margin-top: 132px; }
}

/* На телефоне документы остаются в своём разделе: старый style.css прячет
   .album и показывает верхнюю ленту .album-mobile — иначе пункт «Документы»
   вёл бы в пустоту. */
@media (max-width: 767px) {
    .dt-profile--rail .album-mobile { display: none; }
    .dt-profile--rail #docs .album { display: block; }
    .dt-profile--rail #docs .album_line { height: 150px; }
    .dt-profile--rail #docs .album_line img { height: 150px; }
}

/* Кнопка записи не должна дублироваться: на широком экране её держит
   липкая карточка справа, в шапке она лишняя. */
@media (min-width: 1181px) {
    .dt-profile--rail .dt-pf:has(.dt-aside__cta) .dt-hero__cta { display: none; }
}

/* На узком экране наоборот: карточка справа уезжает вниз, и кнопка в ней
   становится третьей подряд — оставляем шапку и кнопку под анкетой. */
@media (max-width: 1180px) {
    .dt-profile--rail .dt-pf > .dt-aside .dt-aside__card:first-child { display: none; }
}

/* Образование и опыт старый responsive.css прятал на телефоне целиком —
   в разделе «О специалисте» это была дыра. */
@media (max-width: 767px) {
    .dt-profile--rail #about .block-education { display: block; }
}

/* Крошка сверху дублирует «Все репетиторы» в рельсе. */
.dt-profile--rail .breadcrumbs { display: none; }

/* «В сети сегодня в 15:30» — под именем, как на «Профи». */
.dt-profile--rail .dt-hero__seen {
    margin: 2px 0 8px;
    font-size: 13px;
    color: var(--dt-muted, #64748b);
}

/* Документы: ровная лента превью вместо строки фиксированной высоты. */
.dt-profile--rail #docs .album_line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    height: auto;
    margin: 0;
}
.dt-profile--rail #docs .album_line > a,
.dt-profile--rail #docs .album_line > img { flex: none; }
.dt-profile--rail #docs .album_line img {
    height: 104px;
    width: auto;
    border-radius: 8px;
}
.dt-profile--rail .dt-docs__count {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

@media (max-width: 767px) {
    /* на телефоне лента прокручивается вбок, а не режется по высоте */
    .dt-profile--rail #docs .album_line {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .dt-profile--rail #docs .album_line img { height: 132px; }
}

/* Глобальный * { margin: 0 auto } из index.tpl центрировал содержимое
   карточек справа — в сетке возвращаем выравнивание по левому краю. */
.dt-profile--rail .dt-aside__name,
.dt-profile--rail .dt-aside__price,
.dt-profile--rail .dt-aside__free,
.dt-profile--rail .dt-aside__more,
.dt-profile--rail .dt-aside__note {
    justify-self: start;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

/* ---------- анкета на вкладке рабочего стола ----------
   Там уже есть своя рельса слева и колонка уже: вторая вертикальная
   навигация рядом лишняя — сворачиваем её в строку вкладок сверху. */
body.dt-dashboard .dt-profile--rail .dt-pf { display: block; }
body.dt-dashboard .dt-profile--rail .dt-pf-rail {
    position: sticky;
    top: 68px;
    z-index: 20;
    margin: 0 0 14px;
    padding: 6px 0;
    background: var(--dt-bg, #f6f8fb);
}
body.dt-dashboard .dt-profile--rail .dt-pf-rail__back { display: none; }
body.dt-dashboard .dt-profile--rail .dt-pf-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 0;
    padding: 0 0 4px;
}
body.dt-dashboard .dt-profile--rail .dt-pf-nav li { margin: 0; }
body.dt-dashboard .dt-profile--rail .dt-pf-nav__link {
    white-space: nowrap;
    border: 1px solid var(--dt-border, #e2e8f0);
    background: #fff;
    padding: 8px 12px;
    font-size: 13.5px;
}
body.dt-dashboard .dt-profile--rail .dt-pf-rail .sideBlocks { margin: 12px 0 0; }
body.dt-dashboard .dt-profile--rail .dt-pf > .dt-aside {
    width: 100%;
    max-width: 420px;
    margin: 16px 0 0;
    position: static;
}
body.dt-dashboard .dt-profile--rail .dt-pf-sec { scroll-margin-top: 132px; }

/* ---------- разворачивание длинных текстов ----------
   Вместо кнопки-коробки поверх выцветающего текста — родной <details>:
   тизер виден всегда, остальное открывается по «Читать полностью».
   Тем же способом (и тем же обликом) работает «Посмотреть ещё отзывы». */

.dt-profile--rail .block-about-tutor p { margin: 0 0 12px; }
.dt-profile--rail .block-about-tutor p:last-child { margin-bottom: 0; }

.dt-profile--rail .dt-more { margin: 12px 0 0; }
.dt-profile--rail .dt-more > summary,
.dt-profile--rail .btn.btn-morereviews {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    list-style: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--dt-accent, #2563eb);
    text-shadow: none;
    cursor: pointer;
}
.dt-profile--rail .dt-more > summary::-webkit-details-marker { display: none; }
.dt-profile--rail .dt-more > summary::after,
.dt-profile--rail .btn.btn-morereviews::after {
    content: '';
    width: 7px;
    height: 7px;
    margin: 0 0 0 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .18s ease;
}
.dt-profile--rail .dt-more[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.dt-profile--rail .dt-more > summary:hover,
.dt-profile--rail .btn.btn-morereviews:hover {
    background: none;
    color: #1d4ed8;
    text-decoration: underline;
}
.dt-profile--rail .dt-more__close { display: none; }
.dt-profile--rail .dt-more[open] .dt-more__open { display: none; }
.dt-profile--rail .dt-more[open] .dt-more__close { display: inline; }
.dt-profile--rail .dt-more__body { margin: 12px 0 0; }
