/* ============================================= */
/* БАЗОВЫЕ СТИЛИ                                 */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #faf8f5;
    color: #2c2c2c;
    line-height: 1.8;
    padding: 20px;
    padding-top: 70px;
    user-select: text;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
/* ============================================= */
/* ФИКСИРОВАННАЯ НАВИГАЦИЯ ПО РАЗДЕЛАМ           */
/* ============================================= */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #faf8f5;
    border-bottom: 2px solid #d4c5a9;
    padding: 8px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.top-nav .nav-center {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.top-nav .nav-left {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.top-nav .nav-left a {
    color: #5d4037;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    padding: 4px 0;
}

.top-nav .nav-left a:hover {
    border-bottom-color: #8d6e63;
}

.top-nav .nav-left a.active {
    border-bottom-color: #8d6e63;
    font-weight: bold;
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #7a6a5a;
}

.top-nav .nav-right .share-label {
    font-size: 0.8rem;
    color: #7a6a5a;
    margin-right: 4px;
}

.top-nav .nav-right a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #5d4037;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 16px;
    background: #f4efe8;
    transition: background 0.2s;
    font-size: 0.8rem;
}

.top-nav .nav-right a:hover {
    background: #e0d6c8;
}

.top-nav .nav-right a svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================= */
/* ПЛАВАЮЩЕЕ МЕНЮ ПРИ ВЫДЕЛЕНИИ ТЕКСТА           */
/* ============================================= */
.selection-toolbar {
    position: fixed;
    display: none;
    background: #3d2b1f;
    border-radius: 10px;
    padding: 6px 10px;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 1500;
    align-items: center;
    pointer-events: auto;
    white-space: nowrap;
}

.selection-toolbar.show {
    display: flex;
}

.selection-toolbar a,
.selection-toolbar button {
    color: #faf8f5;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.selection-toolbar a:hover,
.selection-toolbar button:hover {
    background: rgba(255,255,255,0.15);
}

.selection-toolbar .divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
}

.selection-toolbar a svg,
.selection-toolbar button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ============================================= */
/* ЛЕВАЯ КОЛОНКА (НАВИГАЦИЯ)                    */
/* ============================================= */
.nav-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 10px;
}

.nav-sidebar::-webkit-scrollbar {
    width: 4px;
}
.nav-sidebar::-webkit-scrollbar-thumb {
    background: #d4c5a9;
    border-radius: 4px;
}

.nav-block {
    background: #f4efe8;
    border-radius: 8px;
    padding: 18px 20px 14px;
    margin-bottom: 20px;
    border-left: 4px solid #b8a99a;
}

.nav-block h3 {
    font-size: 1rem;
    font-weight: normal;
    color: #3d2b1f;
    border-bottom: 1px solid #d4c5a9;
    padding-bottom: 6px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.nav-block h3:hover {
    color: #2c2c2c;
}

.nav-block h3 .arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
    display: inline-block;
}

.nav-block h3 .arrow.open {
    transform: rotate(180deg);
}

.nav-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-block .nav-content {
    display: none;
}

.nav-block .nav-content.open {
    display: block;
}

.nav-toggle {
    display: none;
}

.nav-toggle-all {
    display: block;
    width: 100%;
    padding: 6px 12px;
    margin-bottom: 12px;
    background: #e8dfd4;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    color: #3d2b1f;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.nav-toggle-all:hover {
    background: #d4c5a9;
}

.nav-block li {
    padding: 3px 0;
    border-bottom: 1px dashed #e0d6c8;
    font-size: 0.85rem;
}

.nav-block li a {
    color: #5d4037;
    text-decoration: none;
    display: block;
    transition: padding-left 0.15s, color 0.15s;
    cursor: pointer;
}

.nav-block li a:hover {
    padding-left: 6px;
    text-decoration: underline;
    color: #3d2b1f;
}

.nav-block li a.active {
    color: #8d1f1f;
    font-weight: bold;
    padding-left: 6px;
}

.nav-block .tag-group {
    margin-bottom: 8px;
}

.nav-block .tag-group .tag-name {
    font-weight: bold;
    color: #5d4037;
    font-size: 0.85rem;
    padding: 2px 8px;
    background: #e8dfd4;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-block .tag-group .tag-name:hover {
    background: #d4c5a9;
}

.nav-block .tag-group .tag-name.active-tag {
    background: #8d6e63;
    color: #fff;
}

.nav-block .tag-group ul {
    padding-left: 16px;
    display: none;
}

.nav-block .tag-group ul.open {
    display: block;
}

.nav-block .tag-group ul li {
    border-bottom: none;
    font-size: 0.8rem;
    padding: 1px 0;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-controls .filter-btn {
    background: #e8dfd4;
    border: none;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-family: inherit;
    color: #5d4037;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-controls .filter-btn:hover {
    background: #d4c5a9;
}

.filter-controls .filter-btn.active {
    background: #8d6e63;
    color: #fff;
}

.filter-controls .filter-btn.reset-btn {
    background: #e0d6c8;
    color: #3d2b1f;
}

.filter-controls .filter-btn.reset-btn:hover {
    background: #d4c5a9;
}

/* ============================================= */
/* ПРАВАЯ КОЛОНКА (ОСНОВНОЙ КОНТЕНТ)            */
/* ============================================= */
.main-content {
    flex: 1;
    min-width: 0;
}

/* ШАПКА */
.site-header {
    text-align: center;
    padding: 30px 0 20px;
    border-bottom: 2px solid #d4c5a9;
    margin-bottom: 30px;
}

.site-header h1 {
    font-size: 2.2rem;
    font-weight: normal;
    letter-spacing: 2px;
    color: #3d2b1f;
}

.site-header .subtitle {
    font-size: 1rem;
    color: #7a6a5a;
    margin-top: 4px;
    font-style: italic;
}

/* БИОГРАФИЧЕСКАЯ КАРТОЧКА */
.bio-card {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #f4efe8;
    border-radius: 8px;
    padding: 25px 30px;
    margin-bottom: 40px;
    align-items: center;
}

.bio-card .photo {
    flex: 0 0 200px;
    text-align: center;
}

.bio-card .photo img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bio-card .bio-text {
    flex: 1;
}

.bio-card .bio-text h2 {
    font-size: 1.5rem;
    font-weight: normal;
    color: #3d2b1f;
    margin-bottom: 6px;
}

.bio-card .bio-text .years {
    font-size: 1rem;
    color: #7a6a5a;
    margin-bottom: 12px;
}

.bio-card .bio-text p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.bio-card .bio-text .awards {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #5d4037;
    border-top: 1px dashed #d4c5a9;
    padding-top: 12px;
}

/* БЛОКИ ТЕКСТА */
.content-block {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0d6c8;
    transition: opacity 0.3s, transform 0.3s;
}

.content-block.hidden {
    display: none;
}

.content-block:last-of-type {
    border-bottom: none;
}

.content-block h1 {
    font-size: 2rem;
    font-weight: normal;
    color: #3d2b1f;
    margin-bottom: 10px;
}

.content-block h2 {
    font-size: 1.6rem;
    font-weight: normal;
    color: #3d2b1f;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0d6c8;
    padding-bottom: 6px;
}

.content-block h3 {
    font-size: 1.3rem;
    font-weight: normal;
    color: #5d4037;
    margin-bottom: 6px;
}

.content-block .meta-tags {
    font-size: 0.8rem;
    color: #8d7a6a;
    margin-bottom: 12px;
}

.content-block .meta-tags .tag {
    display: inline-block;
    background: #e0d6c8;
    padding: 1px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 4px;
    color: #3d2b1f;
    cursor: pointer;
    transition: background 0.2s;
}

.content-block .meta-tags .tag:hover {
    background: #d4c5a9;
}

.content-block p {
    margin-bottom: 12px;
    text-indent: 2em;
}

.content-block p.no-indent {
    text-indent: 0;
}

.content-block ul,
.content-block ol {
    margin-left: 30px;
    margin-bottom: 12px;
}

.content-block table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9rem;
}

.content-block table th,
.content-block table td {
    border: 1px solid #d4c5a9;
    padding: 6px 12px;
    text-align: center;
}

.content-block table th {
    background: #f4efe8;
}

.content-block blockquote {
    margin: 15px 0 15px 30px;
    padding-left: 20px;
    border-left: 3px solid #b8a99a;
    font-style: italic;
    color: #5d4037;
}

.content-block blockquote p {
    text-indent: 0;
}

.content-block .year-badge {
    display: inline-block;
    background: #3d2b1f;
    color: #faf8f5;
    padding: 2px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* ============================================= */
/* ПОДВАЛ                                        */
/* ============================================= */
.site-footer {
    margin-top: 60px;
    padding: 30px 0 20px;
    border-top: 2px solid #d4c5a9;
    text-align: center;
    color: #7a6a5a;
    font-size: 0.9rem;
}

.site-footer .contacts {
    margin-top: 8px;
    font-size: 0.95rem;
}

.site-footer .contacts a {
    color: #5d4037;
    text-decoration: none;
    border-bottom: 1px dotted #d4c5a9;
}

.site-footer .contacts a:hover {
    border-bottom-color: #5d4037;
}

/* ============================================= */
/* АДАПТИВНОСТЬ                                   */
/* ============================================= */
@media (max-width: 992px) {
    body {
        padding-top: 60px;
    }

    .top-nav {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .top-nav .nav-left {
        justify-content: center;
        gap: 16px;
    }

    .top-nav .nav-left a {
        font-size: 0.9rem;
    }

    .top-nav .nav-right {
        justify-content: center;
        font-size: 0.75rem;
    }

    .top-nav .nav-right a {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .page {
        flex-direction: column;
    }

    .nav-sidebar {
        flex: 1 1 auto;
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        padding-right: 0;
        order: 3;
    }

    .main-content {
        order: 1;
    }

    #bioCard {
        order: 2;
    }

    .nav-sidebar .nav-block {
        flex: 1 1 200px;
        margin-bottom: 0;
    }

    .nav-toggle {
        display: block;
        background: #f4efe8;
        border: 1px solid #d4c5a9;
        border-radius: 6px;
        padding: 8px 16px;
        font-family: inherit;
        font-size: 0.9rem;
        color: #3d2b1f;
        cursor: pointer;
        margin-bottom: 12px;
        width: 100%;
        text-align: center;
    }

    .nav-toggle:hover {
        background: #e8dfd4;
    }

    .nav-sidebar.collapsed .nav-block {
        display: none;
    }

    .nav-sidebar.collapsed .nav-toggle {
        display: block;
    }

    .bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .bio-card .photo {
        flex: 0 0 auto;
    }

    .selection-toolbar {
        padding: 4px 8px;
        gap: 2px;
    }

    .selection-toolbar a,
    .selection-toolbar button {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
        padding-top: 55px;
    }

    .top-nav {
        padding: 6px 10px;
    }

    .top-nav .nav-left {
        gap: 12px;
    }

    .top-nav .nav-left a {
        font-size: 0.8rem;
    }

    .top-nav .nav-right {
        gap: 4px;
    }

    .top-nav .nav-right a {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .top-nav .nav-right .share-label {
        font-size: 0.7rem;
    }

    .site-header h1 {
        font-size: 1.6rem;
    }

    .bio-card {
        padding: 16px;
    }

    .bio-card .bio-text h2 {
        font-size: 1.2rem;
    }

    .content-block h1 {
        font-size: 1.4rem;
    }
    .content-block h2 {
        font-size: 1.2rem;
    }
    .content-block h3 {
        font-size: 1.05rem;
    }

    .content-block table {
        font-size: 0.75rem;
    }
    .content-block table th,
    .content-block table td {
        padding: 4px 6px;
    }

    .nav-sidebar .nav-block {
        flex: 1 1 100%;
    }

    .selection-toolbar {
        padding: 4px 6px;
        gap: 2px;
        border-radius: 6px;
    }

    .selection-toolbar a,
    .selection-toolbar button {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .selection-toolbar .divider {
        margin: 0 2px;
        height: 14px;
    }
}
/* ============================================= */
/* ПЛАВАЮЩЕЕ МЕНЮ ПРИ ВЫДЕЛЕНИИ — УСИЛЕННАЯ ВЕРСИЯ */
/* ============================================= */
.selection-toolbar {
    position: fixed !important;
    display: none !important;
    background: #3d2b1f !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    gap: 4px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
    z-index: 99999 !important;
    align-items: center !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    font-family: 'Georgia', 'Times New Roman', serif !important;
}

.selection-toolbar.show {
    display: flex !important;
}

.selection-toolbar a,
.selection-toolbar button {
    color: #faf8f5 !important;
    text-decoration: none !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    font-family: inherit !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.selection-toolbar a:hover,
.selection-toolbar button:hover {
    background: rgba(255,255,255,0.15) !important;
}

.selection-toolbar .divider {
    width: 1px !important;
    height: 20px !important;
    background: rgba(255,255,255,0.2) !important;
    margin: 0 4px !important;
}

.selection-toolbar a svg,
.selection-toolbar button svg {
    width: 14px !important;
    height: 14px !important;
    fill: currentColor !important;
}