/*
 * Текстовые страницы портала: «О проекте» и «Данные и приватность».
 * Один макет на обе: колонка текста, к которой слева прижаты якоря разделов,
 * а справа — карточки с числами и списками. Ширина строки ограничена: длинный
 * текст в 1280 px читать нельзя.
 */

.doc {
    padding: 28px 0 var(--section-gap);
}

.doc__head {
    max-width: 72ch;
    margin-bottom: 28px;
}

.doc__head h1 {
    font-size: var(--fs-h1);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -.02em;
}

.doc__lead {
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: var(--fs-body);
}

.doc__layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}

.doc__toc {
    position: sticky;
    top: 88px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.doc__toc-title {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.doc__toc-list {
    display: grid;
    gap: 6px;
    list-style: none;
}

.doc__toc-list a {
    display: block;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    text-decoration: none;
}

.doc__toc-list a:hover {
    background: var(--bg-soft);
    color: var(--brand-600);
}

.doc__body {
    display: grid;
    gap: var(--gap);
    min-width: 0;
}

.doc__section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    scroll-margin-top: 88px;
}

.doc__section h2 {
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: var(--lh-tight);
}

.doc__section h3 {
    margin-top: 18px;
    font-size: var(--fs-body);
    font-weight: 700;
}

.doc__section p {
    max-width: 78ch;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.doc__section p strong,
.doc__list strong {
    color: var(--text-primary);
    font-weight: 700;
}

.doc__list {
    max-width: 78ch;
    margin-top: 12px;
    display: grid;
    gap: 10px;
    list-style: none;
}

.doc__list li {
    position: relative;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.doc__list li::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.doc__list--no li::before {
    background: var(--text-muted);
}

.doc__facts {
    display: grid;
    /* Три колонки, а не auto-fill: шесть карточек ложатся двумя ровными
       рядами, а не пятёркой и одинокой шестой. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap-sm);
    margin-top: 16px;
    list-style: none;
}

.doc__fact {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}

.doc__fact-title {
    display: block;
    color: var(--text-secondary);
    font-size: var(--fs-xs);
}

.doc__fact-value {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: 1.1;
}

.doc__fact-note {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.doc__sources {
    display: grid;
    gap: var(--gap-sm);
    margin-top: 16px;
    list-style: none;
}

.doc__source {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.doc__source-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.doc__source-title {
    font-weight: 700;
}

.doc__source-url {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    word-break: break-all;
}

.doc__source-text {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
}

.doc__note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
}

.doc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 1023px) {
    .doc__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc__toc {
        position: static;
    }

    .doc__toc-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        grid-auto-flow: row;
        display: grid;
    }
}

@media (max-width: 599px) {
    .doc__section {
        padding: 16px;
    }

    .doc__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
