/* =========================================================================
   HILTE — Правовая информация (/legal-information/, page-legal.php)
   Стиль правового раздела HILTE Real Estate на токенах hilte-dna.css.
   Без JS: все документы подряд. С JS (.hl.is-js): виден один документ.
   ========================================================================= */

.hl {
    --hl-gap: clamp(40px, 6vw, 110px);
    --hl-side: 264px;
    --hl-offset: calc(var(--hx-h) + 28px);
    background: var(--hx-paper);
    color: var(--hx-ink);
    font-family: var(--hx-font);
    font-size: 15px;
    line-height: 1.8;
    padding: calc(var(--hx-h) + clamp(40px, 6vw, 84px)) 0 clamp(70px, 9vw, 130px);
    overflow-wrap: break-word;
}

.hl h1,
.hl h2,
.hl h3 {
    font-family: var(--hx-font);
    color: var(--hx-wine);
    text-align: left;
    text-transform: none;
    margin: 0;
}

.hl p,
.hl ul,
.hl ol,
.hl dl {
    margin: 0;
}

.hl a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.hl a:hover {
    color: var(--hx-wine-soft);
    text-decoration-color: currentColor;
}

.hl code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .86em;
    padding: 1px 5px;
    background: var(--hx-cream);
    border: 1px solid var(--hx-line);
    white-space: nowrap;
}

/* ---------- Шапка страницы ---------- */
.hl-head {
    max-width: 1000px;
    margin-bottom: clamp(44px, 6vw, 76px);
}

.hl-head .hx-eyebrow {
    color: var(--hx-wine);
}

.hl-head h1 {
    margin: 24px 0 18px;
    font-size: clamp(38px, 4.8vw, 64px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.hl-head__edition {
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--hx-muted);
}

.hl-notice {
    max-width: 840px;
    margin-top: 34px;
    padding: 26px 0 0;
    border-top: 1px solid var(--hx-line);
    font-size: 14px;
    line-height: 1.85;
    color: var(--hx-ink);
}

.hl-notice__title {
    margin-bottom: 10px !important;
    font-size: clamp(17px, 1.6vw, 20px);
    font-weight: 300;
    line-height: 1.55;
    letter-spacing: -.01em;
    color: var(--hx-wine);
}

/* ---------- Сетка ---------- */
.hl-layout {
    display: grid;
    grid-template-columns: var(--hl-side) minmax(0, 760px);
    gap: var(--hl-gap);
    align-items: start;
}

/* ---------- Навигация слева ---------- */
.hl-side {
    position: sticky;
    top: var(--hl-offset);
    max-height: calc(100vh - var(--hl-offset) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-width: thin;
}

.hl-side__group + .hl-side__group {
    margin-top: 28px;
}

.hl-side__label {
    margin-bottom: 10px !important;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hx-muted);
}

.hl-side ul,
.hl-jump ul,
.hl-side__sections {
    list-style: none;
    padding: 0;
}

.hl-side li + li {
    margin-top: 6px;
}

.hl-side__doc,
.hl-jump__list a {
    display: inline-block;
    font-size: 13px;
    line-height: 1.55;
    text-decoration: none !important;
    color: var(--hx-ink);
}

.hl-side__doc:hover,
.hl-jump__list a:hover {
    color: var(--hx-wine-soft);
}

.hl-side__doc[aria-current="true"],
.hl-jump__list a[aria-current="true"] {
    color: var(--hx-wine);
    text-decoration: underline !important;
    text-decoration-color: currentColor !important;
    text-underline-offset: 5px;
}

/* Разделы текущего документа: показываются только при включённом JS */
.hl-side__sections {
    display: none;
    margin: 10px 0 12px;
    padding-left: 12px !important;
    border-left: 1px solid var(--hx-line);
}

.hl.is-js .hl-side li.is-open > .hl-side__sections {
    display: block;
}

.hl-side__sections li + li {
    margin-top: 2px;
}

.hl-side__sections a {
    display: block;
    padding: 3px 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--hx-muted);
    text-decoration: none;
}

.hl-side__sections a.is-current {
    color: var(--hx-wine);
}

/* ---------- Мобильный список документов ---------- */
.hl-jump {
    display: none;
}

/* ---------- Документ ---------- */
.hl-docs {
    min-width: 0;
}

.hl-doc,
.hl-sec,
.hl-alias {
    scroll-margin-top: var(--hl-offset);
}

.hl-alias {
    display: block;
    height: 0;
}

.hl-doc + .hl-doc {
    margin-top: clamp(64px, 8vw, 110px);
    padding-top: clamp(48px, 6vw, 72px);
    border-top: 1px solid var(--hx-line);
}

.hl.is-js .hl-doc {
    display: none;
}

.hl.is-js .hl-doc.is-active {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.hl-doc__group {
    margin-bottom: 16px !important;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hx-muted);
}

.hl-doc__head h2 {
    font-size: clamp(30px, 3.3vw, 44px);
    font-weight: 300;
    line-height: 1.16;
    letter-spacing: -.035em;
}

.hl-doc__lead {
    margin-top: 20px !important;
    font-size: 16px;
    line-height: 1.75;
    color: var(--hx-ink);
}

.hl-doc__meta {
    margin-top: 14px !important;
    font-size: 11px;
    line-height: 1.8;
    color: var(--hx-muted);
}

.hl-toc {
    margin-top: 34px;
    padding: 22px 0;
    border-top: 1px solid var(--hx-line);
    border-bottom: 1px solid var(--hx-line);
}

.hl-toc__title {
    margin-bottom: 12px !important;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hx-muted);
}

.hl-toc ol {
    list-style: none;
    padding: 0;
    columns: 2;
    column-gap: 36px;
}

.hl-toc li {
    break-inside: avoid;
    padding: 2px 0;
    font-size: 12.5px;
    line-height: 1.55;
}

.hl-toc a {
    text-decoration: none;
    color: var(--hx-ink);
}

.hl-toc a:hover {
    color: var(--hx-wine-soft);
}

/* С JS на десктопе содержание дублирует левую навигацию */
@media (min-width: 1025px) {
    .hl.is-js .hl-toc {
        display: none;
    }
}

.hl-sec {
    margin-top: 44px;
}

.hl-doc__head + .hl-sec {
    margin-top: 40px;
}

.hl-sec h3 {
    margin-bottom: 16px;
    font-size: clamp(19px, 1.7vw, 22px);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -.02em;
}

.hl-sec p + p,
.hl-sec p + .hl-list,
.hl-sec .hl-list + p,
.hl-sec p + .hl-table,
.hl-sec .hl-table + p,
.hl-sec p + .hl-terms,
.hl-sec p + p > .hl-btn {
    margin-top: 14px;
}

.hl-sec b {
    font-weight: 500;
}

.hl-list {
    padding-left: 22px !important;
}

.hl-list li {
    padding-left: 4px;
}

.hl-list li + li {
    margin-top: 8px;
}

ul.hl-list li::marker {
    color: var(--hx-wine);
}

ol.hl-list li::marker {
    font-size: .9em;
    color: var(--hx-wine);
}

/* Термины */
.hl-terms {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
    border-top: 1px solid var(--hx-line);
}

.hl-terms dt,
.hl-terms dd {
    margin: 0;
    padding: 13px 0;
    border-bottom: 1px solid var(--hx-line);
}

.hl-terms dt {
    padding-right: 22px;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--hx-wine);
}

.hl-terms dd {
    font-size: 14px;
}

/* Таблицы */
.hl-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 0;
}

.hl-table table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.65;
}

.hl-table th,
.hl-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--hx-line);
}

.hl-table thead th {
    background: var(--hx-cream);
    font-weight: 500;
    color: var(--hx-wine);
}

.hl-table--plain table {
    min-width: 0;
    font-size: 14px;
}

.hl-table--plain th,
.hl-table--plain td {
    border-width: 0 0 1px;
    padding: 12px 18px 12px 0;
}

.hl-table--plain tr:first-child th,
.hl-table--plain tr:first-child td {
    border-top-width: 1px;
}

.hl-table--plain th {
    width: 38%;
    font-weight: 400;
    color: var(--hx-muted);
}

/* Кнопка «Изменить настройки cookie» */
.hl-btn {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 22px;
    border: 1px solid var(--hx-wine);
    background: var(--hx-wine);
    color: #FFFFFF;
    font-family: var(--hx-font);
    font-size: 12px;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.hl-btn:hover,
.hl-btn:focus-visible {
    background: transparent;
    color: var(--hx-wine);
}

.hl-doc__next {
    margin-top: 56px !important;
    padding-top: 22px;
    border-top: 1px solid var(--hx-line);
    font-size: 13px;
}

.hl-doc__next a {
    text-decoration: none;
    color: var(--hx-wine);
}

.hl-doc__next span {
    display: block;
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hx-muted);
}

/* Без JS «следующий документ» уже идёт ниже — ссылка не нужна */
.hl:not(.is-js) .hl-doc__next {
    display: none;
}

.hl a:focus-visible,
.hl summary:focus-visible,
.hl-btn:focus-visible {
    outline: 1px solid var(--hx-wine);
    outline-offset: 3px;
}

/* ---------- Планшет и мобильный ---------- */
@media (max-width: 1024px) {
    .hl {
        --hl-offset: calc(var(--hx-h) + 74px);
    }

    .hl-layout {
        display: block;
    }

    .hl-side {
        display: none;
    }

    .hl-jump {
        display: block;
        position: sticky;
        top: var(--hx-h);
        z-index: 20;
        margin: 0 0 36px;
        background: var(--hx-paper);
        border-top: 1px solid var(--hx-line);
        border-bottom: 1px solid var(--hx-line);
        transition: top .25s ease;
    }

    body:has(.hx.is-hidden) .hl-jump {
        top: 0;
    }

    .hl-jump summary {
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 52px;
        padding: 8px 30px 8px 0;
        list-style: none;
        cursor: pointer;
        position: relative;
    }

    .hl-jump summary::-webkit-details-marker {
        display: none;
    }

    .hl-jump summary::after {
        content: '';
        position: absolute;
        right: 6px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 1px solid var(--hx-wine);
        border-bottom: 1px solid var(--hx-wine);
        transform: translateY(-70%) rotate(45deg);
        transition: transform .2s ease;
    }

    .hl-jump[open] summary::after {
        transform: translateY(-30%) rotate(225deg);
    }

    .hl-jump__label {
        flex-shrink: 0;
        font-size: 10px;
        font-weight: 500;
        letter-spacing: .16em;
        text-transform: uppercase;
        color: var(--hx-muted);
    }

    .hl-jump__current {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        color: var(--hx-wine);
    }

    .hl-jump__list {
        max-height: min(62vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 6px 0 20px;
    }

    .hl-jump__list .hl-side__label {
        margin: 16px 0 6px !important;
    }

    .hl-jump__list li a {
        display: block;
        padding: 7px 0;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .hl {
        font-size: 14px;
        line-height: 1.8;
    }

    .hl-head h1 {
        font-size: 36px;
        margin-top: 18px;
    }

    .hl-notice {
        margin-top: 26px;
        padding-top: 20px;
        font-size: 13px;
    }

    .hl-doc__lead {
        font-size: 14.5px;
    }

    .hl-toc ol {
        columns: 1;
    }

    .hl-sec {
        margin-top: 36px;
    }

    .hl-terms {
        display: block;
    }

    .hl-terms dt {
        padding: 13px 0 2px;
        border-bottom: 0;
    }

    .hl-terms dd {
        padding: 0 0 13px;
    }

    .hl-table table {
        min-width: 480px;
        font-size: 12px;
    }

    .hl-table--plain table {
        min-width: 0;
        font-size: 13px;
    }

    /* Таблицы с заголовком — карточками: подпись колонки над значением */
    .hl-table table.hl-cards {
        min-width: 0;
        border-top: 1px solid var(--hx-line);
    }

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

    .hl-cards tbody,
    .hl-cards tr,
    .hl-cards td {
        display: block;
    }

    .hl-cards tr {
        padding: 12px 0 14px;
        border-bottom: 1px solid var(--hx-line);
    }

    .hl-cards td {
        padding: 3px 0;
        border: 0;
        font-size: 13px;
    }

    .hl-cards td::before {
        content: attr(data-label);
        display: block;
        font-size: 9.5px;
        font-weight: 500;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--hx-muted);
    }

    .hl-cards td:first-child {
        font-weight: 500;
        color: var(--hx-wine);
    }

    .hl-cards td:first-child::before {
        display: none;
    }

    .hl-table--plain th {
        width: 42%;
    }

    .hl code {
        white-space: normal;
        word-break: break-all;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hl *,
    .hl-jump {
        transition: none !important;
    }
}

/* ---------- Печать: все документы подряд ---------- */
@media print {
    .hl {
        padding-top: 0;
    }

    .hl-side,
    .hl-jump,
    .hl-toc,
    .hl-doc__next,
    .hl-btn {
        display: none !important;
    }

    .hl-layout {
        display: block;
    }

    .hl.is-js .hl-doc {
        display: block;
    }
}
