/* Стили страницы «fund-documents». Вынесены из templates/main/fund_documents.html без изменений:
   каскад тот же — <link> стоит там же, где стоял <style>. */
body {
        margin-top: 124px;
    }

    /* Ширина как на остальных страницах раскрытия: main = 1200, боковые поля
       (20px на узких) задаёт .container. */
    main { width: 100%; max-width: 1200px; padding-inline: 0; box-sizing: border-box; }
    .container { width: 100%; max-width: 1200px; box-sizing: border-box; margin: 0 auto; padding: 0; }
    @media (max-width: 1240px) { .container { padding-inline: 20px; } }

    /* Крошки в стиле site2 (как на остальных страницах раскрытия) */
    .doc-crumbs { display: flex; gap: 8px; row-gap: 4px; align-items: center; font-family: 'Montserrat', sans-serif; font-size: 13px; color: #83879a; margin-bottom: 22px; flex-wrap: wrap; }
    /* Пункт крошек не рвём по словам — переносим целиком. */
    .doc-crumbs a { color: #83879a; text-decoration: none; transition: color .2s; }
    .doc-crumbs a:hover { color: #000f9f; }
    .doc-crumbs .sep { opacity: .5; }
    @media (max-width: 560px) { .doc-crumbs { font-size: 12.5px; gap: 6px; } }

    .doc-back { display: inline-flex; align-items: center; gap: 8px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600; color: #000f9f; text-decoration: none; padding: 9px 16px 9px 13px; border-radius: 999px; background: rgba(0,15,159,.06); margin-bottom: 22px; transition: background .18s, gap .18s; }
    .doc-back .ic { display: inline-flex; }
    .doc-back svg { width: 17px; height: 17px; }
    .doc-back:hover { background: rgba(0,15,159,.12); gap: 11px; }

    .documents-container {
        display: flex; 
        gap: 2rem;
        margin-bottom: 30px;
    }
    
    .types-sidebar {
        width: 270px;
        flex-shrink: 0;
        margin: 10px 0 30px 0;
        font-size: 14px;
    }
    
    /* Сайдбар категорий документов — 1:1 из site2 (.disc-side button) */
    .types-list {
        position: sticky;
        top: 120px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .type-item {
        text-align: left;
        padding: 13px 16px;
        border-radius: 8px;
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        color: #474b58;
        border-left: 3px solid transparent;
        line-height: 1.35;
        cursor: pointer;
        transition: .16s;
        display: block;
        text-decoration: none;
    }

    .type-item:hover {
        background: rgba(255,255,255,.55);
        -webkit-backdrop-filter: blur(16px) saturate(1.5);
        backdrop-filter: blur(16px) saturate(1.5);
        box-shadow: 0 2px 10px rgba(20,28,60,.05);
        border-left-color: #000f9f;
    }

    .type-item.active {
        background: rgba(255,255,255,.55);
        -webkit-backdrop-filter: blur(16px) saturate(1.5);
        backdrop-filter: blur(16px) saturate(1.5);
        color: #000f9f;
        border-left-color: #000f9f;
        font-weight: 600;
        box-shadow: 0 2px 10px rgba(20,28,60,.05);
    }
    
    .documents-content {
        flex-grow: 1;
    }
    
    .document-section {
        margin-bottom: 2rem;
        display: none;
    }
    
    .document-section.active {
        display: block;
    }

    /* Вкладка «Общая информация о фонде» — таблица (как реквизиты УК) */
    .gi-table-wrap { background: white; padding: 25px; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,.08); overflow: auto; }
    /* Курсор-«рука» только когда таблица реально шире экрана (класс ставит drag-scroll.js). */
    .gi-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: 'Montserrat', sans-serif; font-size: 14px; line-height: 1.6; }
    .gi-table td { padding: 16px 20px; border-bottom: 1px solid #eaecef; vertical-align: top; color: #474b58; }
    .gi-table tr:last-child td { border-bottom: none; }
    .gi-table td.gi-key { font-weight: 600; color: #14161d; width: 320px; min-width: 220px; border-right: 1px solid #eaecef; }
    .gi-table td.gi-val { white-space: pre-line; }
    .gi-table td.gi-val a { color: #000f9f; text-decoration: none; word-break: break-word; }
    .gi-table td.gi-val a:hover { text-decoration: underline; }
    @media (max-width: 600px) { .gi-table td.gi-key { width: 140px; min-width: 120px; } }

    .document-item {
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .document-info {
        flex: 1;
    }
    
    .document-name {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 0.3rem;
    }
    .document-name:hover {
        color: #000f9f;
    }
    .document-link {
        font-size: 14px;
        font-weight: 500;
        color: #000f9f;
    }
    .document-meta {
        font-size: 14px;
        color: #666;
    }
    
    .document-action a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
    }
    
    .document-action a:hover {
        text-decoration: underline;
    }
    
    .no-documents {
        padding: 2rem;
        text-align: center;
        color: #666;
    }

    /* Частный фонд: текст «информация не раскрывается» */
    .no-disclosure-block {
        margin-top: 8px;
        max-width: 760px;
        font-family: 'Montserrat', sans-serif;
        font-size: 15px;
        line-height: 1.6;
        color: #474b58;
    }
    .no-disclosure-block p { margin: 0 0 12px; }
    .no-disclosure-block p:last-child { margin-bottom: 0; }
    .no-disclosure-block a { color: #000f9f; text-decoration: none; }
    .no-disclosure-block a:hover { text-decoration: underline; }

    /* Таблица «Общая информация»: колонка-ключ шириной 220-320px не давала
       таблице сжаться, и она вылезала за края экрана. На узких — ключ и
       значение друг под другом. */
    @media (max-width: 700px) {
        .gi-table-wrap { padding: 16px; }
        .gi-table, .gi-table tbody, .gi-table tr, .gi-table td { display: block; width: auto; }
        .gi-table tr { border-bottom: 1px solid #eaecef; }
        .gi-table tr:last-child { border-bottom: none; }
        .gi-table td { border-bottom: none; }
        .gi-table td.gi-key { width: auto; min-width: 0; border-right: 0; padding: 14px 0 4px; }
        .gi-table td.gi-val { padding: 0 0 14px; }
    }

    @media (max-width: 1000px) {
        .documents-container {
            flex-direction: column;
        }
        
        .types-sidebar {
            width: 100%;
            margin: 10px 0 0 0;
        }
        
        /* Без nowrap: длинные названия («Отчеты о вознаграждениях и расходах»,
           «Правила доверительного управления») не влезали в строку на узких
           экранах и обрезались — пусть переносятся. */
        .type-item {
            white-space: normal;
        }
    }
    .document-icon {
        font-size: 50px;
        color: #000f9f;
        margin-right: 1rem;
        flex-shrink: 0;
        transition: 0.7s;
    }
    .document-icon:hover {
        color: #e4e4e4;
        transition: 0.7s;
    }
    .section-title {
        font-weight: 500;
    }
    /* Вопросик-подсказка в шапке столбца «Бенчмарк» */
    .bench-q {
        display: inline-flex; align-items: center; justify-content: center;
        width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
        border: 1px solid #dfe3ec; color: #83879a; font-size: 10px; font-weight: 400;
        line-height: 1; cursor: pointer; vertical-align: middle; user-select: none;
        transition: background .15s, color .15s, border-color .15s;
    }
    .bench-q:hover, .bench-q.on { background: #000f9f; border-color: #000f9f; color: #fff; }
    /* Всплывающая подсказка (создаётся в body, position:fixed — не обрезается таблицей) */
    .bench-tip {
        position: fixed; z-index: 9999; max-width: 320px;
        padding: 12px 14px; border-radius: 10px;
        background: #fff; color: #333;
        font-family: 'Montserrat', sans-serif; font-size: 12.5px; line-height: 1.5;
        box-shadow: 0 10px 30px rgba(16,27,77,.18);
        opacity: 0; transform: translateY(4px);
        transition: opacity .12s ease, transform .12s ease;
        pointer-events: none;
    }
    .bench-tip.show { opacity: 1; transform: translateY(0); }
    .bench-tip::after {
        content: ''; position: absolute; left: var(--arrow-x, 50%);
        width: 10px; height: 10px; background: #fff;
        transform: translateX(-50%) rotate(45deg);
    }
    .bench-tip.below::after { top: -5px; }
    .bench-tip.above::after { bottom: -5px; }
    .styled-text {
        padding: 0 7px 20px 0;
    }

    /* Стили для красивой таблицы */
    .table-responsive {
        background: white;
        padding: 25px;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
        margin-bottom: 30px;
        /* Таблица стоимости пая и СЧА шире экрана на телефоне — прокручиваем
           её вбок (мышью — перетаскиванием, см. drag-scroll.js). */
        overflow-x: auto;
    }
    .table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin: 0;
        font-size: 14px;
        line-height: 1.5;
        text-align: center;
    }
    
    .table tr {
        transition: background-color 0.2s ease;
    }
    
    .table tr.table-row:hover {
        background-color: #f8fafc;
    }
    
    .table td, th {
        padding: 16px 20px;
        border-bottom: 1px solid #eaecef;
        vertical-align: top;
    }
    
    .table tr:last-child td {
        border-bottom: none;
    }

    .table a {
        color: #000f9f;
        text-decoration: none;
        font-weight: 500;
    }
    
    .table a:hover {
        text-decoration: underline;
    }


    .table th.text-center {
        vertical-align: middle;
        font-size: 12px;
        font-weight: 500;
    }

    .table td {
        padding: 8px 12px;
    }
    .hidden-value {
        display: none;
    }
    /* Стили для кнопки "Показать еще" */
    .btn-show-more {
        text-align: center;
        display: inline-flex;
        align-items: center;
        gap: 12px;
        padding: 10px 15px;
        background: rgb(248, 249, 250);
        color: #000f9f;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
    }

    .btn-icon {
        font-size: 18px;
        font-weight: 700;
        transition: transform 0.3s ease;
    }

    .btn-show-more:hover .btn-icon {
        transform: translateX(3px);
    }
