:root {
    --bg: #e8dab3;
    --surface: #f2e7c8;
    --surface-2: #e0cf9c;
    --surface-3: #d3bd80;
    --border: #a6864c;
    --border-soft: #c7ae7a;
    --text: #2a2011;
    --text-soft: #5f4e2e;
    --accent: #79430f;
    --accent-hover: #5a310a;
    --accent-soft: rgba(121,67,15,.12);
    --accent-contrast: #f7edd2;
    --link: #17458c;
    --link-hover: #0d2c5c;
    --success: #3c6e2c;
    --danger: #9c3018;
    --radius: 0;
    --sidebar-width: 270px;
    --header-height: 108px;
    --header-height-mobile: 128px;
}
* { box-sizing: border-box; }
svg { stroke-linecap: round; stroke-linejoin: round; }
html { background: var(--bg); overflow-x: hidden; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: var(--bg);
}
h1, h2, h3, .brand { font-family: 'Playfair Display', serif; }
a { color: inherit; }

/* Классическая кликабельная ссылка — просто подчёркнутый синий текст,
   без "кнопочных" эффектов, как на старых архивных/библиотечных сайтах. */
a.doc-link, .post-title, .card-title a, .about-article a, .auth-switch a,
.crumb-link, .source-line a, .researcher-contact a, .filter-reset {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}
a.doc-link:hover, .post-title:hover, .card-title a:hover, .about-article a:hover,
.auth-switch a:hover, .crumb-link:hover, .source-line a:hover,
.researcher-contact a:hover, .filter-reset:hover {
    color: var(--link-hover);
    text-decoration-color: var(--link-hover);
}
.crumb-current { color: var(--text); font-weight: 600; }
.crumb-sep { opacity: .6; }

/* ---------- Мобильная кнопка меню (плавающая, шапки больше нет) ---------- */
/* ---------- Верхняя шапка (лого + поиск + нав.) ---------- */
.site-header {
    position: relative;
    z-index: 60;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header-top {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
}
.site-emblem {
    flex: 0 0 78px !important;
    width: 78px !important;
    height: 78px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    display: block !important;
}
.site-emblem img {
    display: block !important;
    width: 78px !important;
    height: 78px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}
.site-header-title {
    flex: 1;
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -.3px;
}
.site-header-search { display: flex; flex: 0 0 auto; }
.site-header-search input {
    width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-right: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}
.site-header-search button {
    padding: 0 12px;
    border: 1px solid var(--border);
    background: var(--accent);
    color: var(--accent-contrast);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.site-header-search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.site-header-nav {
    display: flex;
    justify-content: center;
    gap: 26px;
    background: var(--surface-2);
    border-top: 1px solid var(--border-soft);
    padding: 9px 16px;
}
.site-header-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.site-header-nav a:hover { color: var(--accent-hover); text-decoration: underline; }

@media (max-width: 700px) {
    .site-header-top { flex-wrap: wrap; padding: 12px 16px; }
    .site-header-search { flex: 1 1 100%; order: 3; }
    .site-header-search input { width: 100%; }
    .site-emblem { width: 58px !important; height: 58px !important; flex: 0 0 58px !important; }
    .site-emblem img { width: 58px !important; height: 58px !important; }
    .site-header-title { font-size: 20px; }
    .site-header-nav { gap: 16px; flex-wrap: wrap; }
}

.mobile-menu-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 90;
    width: 42px;
    height: 42px;
    padding: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.mobile-menu-toggle span { width: 18px; height: 2px; background: currentColor; display: block; }

.verified-badge {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-contrast);
    background: var(--accent);
    border-radius: 50%;
}
.verified-badge svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; display: block; }

.header-avatar, .header-avatar-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-3);
    flex: 0 0 26px;
}
.header-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-family: 'Playfair Display', serif;
    font-size: 12px;
}

/* ---------- Сайдбар: всегда открыт на ПК, выезжающий на телефоне ---------- */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(20,15,5,.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    max-width: 85vw;
    z-index: 80;
    padding: 22px 16px;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .25s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop.open { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s linear 0s; }
.sidebar-close { position: absolute; right: 12px; top: 12px; background: transparent; border: 0; color: var(--text-soft); font-size: 24px; cursor: pointer; }

.brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: var(--text);
    padding: 4px 8px 14px;
}
.brand-accent { font-style: italic; font-weight: 600; color: var(--accent); }

.site-search {
    display: flex;
    align-items: center;
    margin: 0 0 8px;
    padding: 0 4px 0 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.site-search input {
    flex: 1;
    width: auto;
    min-width: 0;
    margin-bottom: 0;
    padding: 9px 0;
    background: transparent;
    border: 0;
    font-size: 13px;
}
.site-search input:focus { box-shadow: none; }
.site-search button { background: transparent; padding: 8px; color: var(--text-soft); }
.site-search button:hover { background: transparent; color: var(--text); }
.site-search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    margin: 1px 0;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}
.side-link:hover { background: var(--surface-2); }
.side-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
button.side-logout-btn { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.sidebar-divider { height: 1px; background: var(--border-soft); margin: 14px 4px; }

.language-switcher form { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0 4px; }
.language-switcher button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-soft);
    padding: 5px 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.language-switcher button:hover { border-color: var(--border); color: var(--text); }
.language-switcher button.active { color: var(--accent-contrast); background: var(--accent); }
.language-switcher .separator { color: var(--text-soft); opacity: .6; font-size: 11px; }

.section-label {
    margin: 0 0 8px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-soft);
}

/* ---------- Основной контент: со сдвигом под сайдбар на ПК ---------- */
.main-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1000px; margin: 0 auto; padding: 30px 24px 60px; width: 100%; }

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px 18px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}
.card:hover { border-color: var(--accent); background: var(--surface-2); }
a.card-link { display: block; color: inherit; text-decoration: none; }

.document-image {
    display: block;
    max-width: 100%;
    max-height: 520px;
    width: auto;
    margin: 16px auto;
    border: 1px solid var(--border);
    background: var(--surface-2);
    object-fit: contain;
}
.inline-doc-image {
    display: block;
    max-width: 100%;
    max-height: 480px;
    width: auto;
    margin: 14px auto;
    border: 1px solid var(--border);
    background: var(--surface-2);
    object-fit: contain;
}

/* ---------- Переключатель сканов (один скан + стрелки) ---------- */
.scan-viewer { margin: 16px 0; outline: none; }
.scan-viewer-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 460px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    overflow: hidden;
}
.scan-slide {
    display: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.scan-slide.is-active { display: block; }
.scan-slide-file {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.scan-slide-file.is-active { display: flex; }
.scan-slide-file svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.scan-slide-file:hover { color: var(--text); }

.scan-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 18, 16, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    -webkit-tap-highlight-color: transparent;
}
.scan-nav:hover { background: var(--accent); }
.scan-nav:active { background: var(--accent); transform: translateY(-50%) scale(0.94); }
.scan-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.scan-prev { left: 12px; }
.scan-next { right: 12px; }

.scan-viewer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-soft);
}
.scan-counter { font-weight: 600; }
.scan-download { color: var(--link); text-decoration: none; font-weight: 600; }
.scan-download:hover { color: var(--link-hover); text-decoration: underline; }

.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-top {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 12px;
}
.card-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.card-desc { margin: 0; color: var(--text-soft); font-size: 13.5px; line-height: 1.55; }
.card-views { display: inline-flex; align-items: center; gap: 4px; }
.card-views svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.card-stats { position: relative; z-index: 2; display: flex; gap: 14px; margin-top: 10px; color: var(--text-soft); font-size: 12px; }
.card-stat { display: inline-flex; align-items: center; gap: 4px; }
.card-stat svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.page-heading { margin: 0 0 10px; font-size: 27px; letter-spacing: -.3px; overflow-wrap: anywhere; }
.page-subtitle { margin: 0 0 26px; color: var(--text-soft); font-size: 14px; }
.meta { color: var(--text-soft); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.post-author { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; text-decoration: none; color: var(--text-soft); }
.post-author:hover { color: var(--text); }
.mini-avatar { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.mini-avatar-fallback { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-soft); font-size: 10px; font-weight: 700; }

.post-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

input, textarea, select {
    width: 100%;
    max-width: 100%;
    padding: 10px 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    margin-bottom: 12px;
    font: inherit;
    font-size: 14px;
}
input[type="file"] { padding: 9px 10px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
button, .btn {
    background: var(--accent);
    color: var(--accent-contrast);
    border: 1px solid var(--accent);
    padding: 9px 16px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active, .btn:active { transform: translateY(1px); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-like { background: transparent; border: 1px solid var(--border); color: var(--text-soft); }
.btn-like:hover { background: var(--surface-2); color: var(--text); }
.btn-like svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn-like.liked { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-like.liked svg { fill: currentColor; stroke: currentColor; }

.comments-block { margin-top: 12px; }
.comments-heading { margin: 0 0 14px; font-size: 17px; }
.comment-form { margin-bottom: 18px; }
.comment-form textarea { margin-bottom: 8px; }
.comment { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.comment-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.comment-text { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.comment-delete-form { margin-top: 6px; }
.btn-comment-delete { background: none; border: none; padding: 0; color: var(--text-soft); font-size: 12px; font-weight: 500; cursor: pointer; }
.btn-comment-delete:hover { color: var(--danger); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -8px 0 20px; font-size: 13px; color: var(--text-soft); }

.guide-list { margin: 0 0 30px; background: var(--surface); border: 1px solid var(--border); }
.guide-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 13px 16px;
    text-decoration: none;
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-color: var(--border);
    font-family: 'Playfair Display', serif;
    font-size: 15.5px;
    border-bottom: 1px solid var(--border-soft);
}
.guide-list .guide-row:last-child { border-bottom: 0; }
.guide-row::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; margin-top: 5px; background: var(--accent); }
.guide-row:hover { background: var(--surface-2); color: var(--link-hover); }
.guide-row-name { flex: 1; overflow-wrap: anywhere; }
.guide-row-count { flex: 0 0 auto; font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-soft); white-space: nowrap; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    padding: 14px 16px;
    margin: 0 0 20px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; width: 100%; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 128px; }
.filter-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.filter-field select { margin-bottom: 0; padding: 8px 10px; font-size: 13px; background: var(--surface-2); }
.filter-reset { align-self: center; padding-bottom: 9px; font-size: 12.5px; white-space: nowrap; }
.view-toggle { display: flex; gap: 2px; margin-left: auto; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.view-btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text-soft); border: 0; }
.view-btn:hover { background: var(--surface-3); color: var(--text); }
.view-btn.active { background: var(--accent); color: var(--accent-contrast); }
.view-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.archive-items.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: stretch; }
.archive-items.is-grid .card { margin-bottom: 0; height: 100%; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; }
.pagination-status { font-size: 12.5px; color: var(--text-soft); white-space: nowrap; }
.pagination-disabled { opacity: .4; pointer-events: none; }

.archive-meta { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 3px; margin: 8px 0 16px; font-size: 12.5px; color: var(--text-soft); }

.archive-text { color: var(--text); font-size: 15px; line-height: 1.7; }
.archive-text p { margin: 0 0 14px; }
.archive-text p:last-child { margin-bottom: 0; }
.archive-text strong { color: var(--text); font-weight: 700; }
.archive-text em { color: var(--text-soft); }
.archive-text blockquote {
    margin: 16px 0;
    padding: 6px 0 6px 18px;
    border-left: 2px solid var(--accent);
    color: var(--text-soft);
    font-family: 'Playfair Display', serif;
    font-style: italic;
}
.archive-text blockquote p { margin: 0; }

.about-page { max-width: 720px; margin: 0 auto; padding: 8px 4px 40px; }
.about-article { color: var(--text); font-size: 15.5px; line-height: 1.75; }
.about-title { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; margin: 0 0 18px; }
.about-article h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; margin: 30px 0 10px; color: var(--text); }
.about-article p { margin: 0 0 14px; color: var(--text); }
.about-article ul { margin: 0 0 14px; padding-left: 22px; }
.about-article li { margin-bottom: 6px; color: var(--text); }
.about-tagline { margin-top: 26px; font-family: 'Playfair Display', serif; font-style: italic; color: var(--text-soft); }
.about-cta { display: inline-block; margin-top: 12px; text-decoration: none; }

.news-feed { margin-top: 6px; }
.news-item { padding: 22px 0; border-bottom: 1px solid var(--border-soft); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: 0; }
.news-item-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.team-group { margin: 0 0 34px; }
.team-group:last-child { margin-bottom: 0; }
.team-entry {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding: 26px 0;
    border-bottom: 1px solid var(--border-soft);
}
.team-group .team-entry:first-of-type { padding-top: 6px; }
.team-group .team-entry:last-child { border-bottom: 0; }
.team-entry.has-photo:nth-of-type(even) { flex-direction: row-reverse; }
.team-entry-photo { flex: 0 0 160px; }
.team-entry-photo img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
}
.team-entry-body { flex: 1; min-width: 0; }
.team-entry-name {
    margin: 0 0 4px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    overflow-wrap: anywhere;
}
.team-entry-role { margin: 0 0 10px; color: var(--text-soft); font-size: 13px; }
.team-entry-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; }
.team-entry-links a { color: var(--accent); text-decoration: none; }
.team-entry-links a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .team-entry, .team-entry.has-photo:nth-of-type(even) { flex-direction: column; }
    .team-entry-photo, .team-entry-photo img { width: 100%; max-width: 220px; }
}

.errorlist { list-style: none; padding: 0; margin: -7px 0 12px; }
.errorlist li { color: var(--danger); font-size: 12px; }
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); padding: 10px 13px; font-size: 13px; }

/* Авторизация */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 390px; background: var(--surface); border: 1px solid var(--border); padding: 34px 32px; }
.auth-icon { width: 48px; height: 48px; border: 1px solid var(--border); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.auth-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; }
.auth-card h2 { text-align: center; margin: 0 0 5px; font-size: 26px; }
.auth-subtitle, .auth-switch { text-align: center; color: var(--text-soft); font-size: 13px; }
.auth-subtitle { margin: 0 0 24px; }
.auth-switch { margin-top: 20px; }
.auth-card label { font-size: 12px; color: var(--text-soft); display: block; margin-bottom: 4px; }
.auth-card .helptext { font-size: 11px; color: var(--text-soft); display: block; margin: -8px 0 12px; }
.auth-card button[type=submit] { width: 100%; margin-top: 7px; }
.researcher-contact { line-height: 1.7; }

.researcher-gate { text-align: center; padding: 40px 24px; }
.researcher-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.researcher-badge svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.researcher-gate .researcher-badge { margin-bottom: 14px; }
.researcher-gate .page-heading { margin-bottom: 10px; }
.researcher-gate p { color: var(--text-soft); max-width: 520px; margin: 0 auto 22px; }
.researcher-gate .btn { display: inline-block; }

.hero-banner-wrap { position: relative; width: 100%; margin-bottom: 30px; overflow: hidden; border: 1px solid var(--border); }
.hero-banner { position: relative; display: block; width: 100%; height: clamp(260px, 34vw, 460px); }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.hero-banner-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 78%, var(--bg) 100%);
}
@media (max-width: 700px) {
    .hero-banner { height: clamp(200px, 60vw, 340px); }
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 22px 20px 30px;
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
}
.footer-brand { font-family: 'Playfair Display', serif; font-size: 14px; color: var(--text-soft); }
.footer-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}
.footer-link { color: var(--text-soft); font-size: 13px; text-decoration: none; }
.footer-link:hover { color: var(--accent); text-decoration: underline; }
.footer-copyright { color: var(--text-soft); font-size: 12.5px; }
.footer-social { display: flex; gap: 10px; }
.footer-social-link {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
}
.footer-social-link:hover { color: var(--accent); }
.footer-social-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* Строка источника ('Джерело: ...') внизу карточки архивного материала */
.source-line {
    margin: 22px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-soft);
}
.source-line a { font-style: normal; }

/* ---------- Раскладка: ПК — сайдбар всегда открыт и сдвигает контент ---------- */
@media (min-width: 901px) {
    .mobile-menu-toggle, .sidebar-backdrop, .sidebar-close { display: none; }
    .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 65; }
    .sidebar { transform: translateX(0); top: var(--header-height); }
    .main-wrap { margin-left: var(--sidebar-width); padding-top: var(--header-height); }
}

/* ---------- Раскладка: телефон/планшет — сайдбар выезжает по кнопке ---------- */
@media (max-width: 900px) {
    .mobile-menu-toggle { display: flex; top: calc(var(--header-height-mobile) + 10px); }
    .container { padding: 70px 16px 50px; }
    .about-page { padding-top: 60px; }
}

@media (max-width: 700px) {
    .filter-bar { padding: 12px; gap: 10px 12px; }
    .filter-field { min-width: 110px; flex: 1 1 140px; }
    .view-toggle { margin-left: 0; }
    .pagination { flex-wrap: wrap; row-gap: 8px; }
}

@media (max-width: 480px) {
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-field { min-width: 0; width: 100%; flex: 0 0 auto; }
    .filter-reset { align-self: flex-start; padding-bottom: 0; }
    .view-toggle { align-self: flex-start; }
    .pagination { justify-content: center; }
    .pagination-status { flex-basis: 100%; order: 3; text-align: center; }
    .guide-row { padding: 12px 14px; font-size: 14.5px; }
    .scan-viewer-frame { height: 300px; }
    .scan-nav { width: 44px; height: 44px; }
}