/* ===========================================
   ТехСоветник — Warm Teal Theme (Premium v2)
   Based on site1_tv structure with teal palette
   =========================================== */

/* --- Переменные (легко менять тему) --- */
:root {
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --bg: #f5f5f4;
    --bg-card: #ffffff;
    --bg-surface: #fafaf9;
    --text: #1c1917;
    --text-muted: #78716c;
    --text-secondary: #57534e;
    --accent: #d97706;
    --border: #e7e5e4;
    --gold: #d97706;
    --font-heading: 'Inter', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --max-width: 1140px;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(28,25,23,0.06);
    --shadow-md: 0 4px 16px rgba(28,25,23,0.06);
    --shadow-lg: 0 8px 32px rgba(28,25,23,0.08);
}

/* --- Сброс --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===========================================
   ПРОГРЕСС-БАР ЧТЕНИЯ
   =========================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 1000;
    transition: width 0.15s;
}

/* ===========================================
   ШАПКА
   =========================================== */
.site-header {
    background: rgba(250,250,249,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(28,25,23,0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.logo-icon { font-size: 1.5rem; }

/* --- Sidebar Search --- */
.sidebar-search {
    margin-bottom: 16px;
}
.sidebar-search-box {
    position: relative;
}
.sidebar-search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    background: #fff;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}
.sidebar-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.08);
}
.sidebar-search-box input::placeholder { color: #a8a29e; }
.sidebar-search-box .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
    margin-top: 4px;
}
.sidebar-search-box .sd-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; text-decoration: none; color: var(--text);
    transition: background 0.15s; border-bottom: 1px solid #f5f5f4;
    font-size: 0.84rem;
}
.sidebar-search-box .sd-item:last-child { border-bottom: none; }
.sidebar-search-box .sd-item:hover,
.sidebar-search-box .sd-item.sd-active { background: #f0fdfa; }
.sidebar-search-box .sd-item:hover .sd-title { color: var(--primary); }
.sidebar-search-box .sd-icon {
    width: 28px; height: 28px; border-radius: 6px; background: #f0fdfa;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-search-box .sd-title {
    font-size: 0.82rem; font-weight: 500; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-search-box .sd-empty {
    padding: 14px; text-align: center; color: #a8a29e; font-size: 0.84rem;
}

.main-nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--bg-surface); }
.nav-link.active { color: var(--primary); background: #f0fdfa; font-weight: 600; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.4rem;
    padding: 4px 10px;
    cursor: pointer;
    color: var(--text);
}

/* ===========================================
   ХЛЕБНЫЕ КРОШКИ
   =========================================== */
.breadcrumbs {
    padding: 14px 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.breadcrumbs a { color: var(--primary); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumb-sep { margin: 0 6px; opacity: 0.4; }
.breadcrumb-current { color: var(--text-secondary); }

/* ===========================================
   ОСНОВНОЙ КОНТЕНТ — 2 КОЛОНКИ
   =========================================== */
.site-main { padding: 32px 0 60px; min-height: 60vh; }

.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    align-items: start;
}

/* --- Карточка статьи --- */
.article-main {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 40px 44px 48px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* --- Заголовок + share --- */
.article-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.article-main h1 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
}

/* Подпись "Проверено: ..." */
.article-updated {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* --- Контент --- */
.article-body h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    letter-spacing: -0.01em;
    position: relative;
}

.article-body h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 28px 0 12px;
    padding-left: 14px;
    border-left: 3px solid var(--primary-light);
}

.article-body p { margin-bottom: 1em; color: var(--text-secondary); }
.article-body ul, .article-body ol { margin: 0 0 1em 0; }
.article-body li { margin-bottom: 0.5em; color: var(--text-secondary); }

/* ===========================================
   ВИЗУАЛЬНОЕ РАЗНООБРАЗИЕ КОНТЕНТА
   =========================================== */

/* Lead paragraph — первый абзац крупнее */
.article-body > p:first-of-type {
    font-size: 1.08em;
    color: var(--text);
    line-height: 1.8;
}

/* Drop Cap — большая первая буква */
.article-body > p:first-of-type::first-letter {
    font-size: 3em;
    font-weight: 800;
    float: left;
    line-height: 0.85;
    margin-right: 8px;
    margin-top: 6px;
    color: var(--primary);
}

/* Первый абзац после H2 */
.article-body h2 + p {
    font-size: 1.02em;
    color: var(--text-secondary);
}

/* Выделение ключевых слов — мягкий акцент */
.article-body strong {
    color: var(--text);
    font-weight: 700;
}

/* Акцентное выделение */
.article-body em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Маркер критически важной информации */
.article-body mark {
    background: linear-gradient(120deg, #fef08a 0%, #fde68a 100%);
    padding: 2px 6px;
    border-radius: 3px;
    color: #92400e;
    font-weight: 500;
}

/* Красивые ordered-list с кастомным счётчиком */
.article-body ol {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
    margin-left: 0;
}
.article-body ol > li {
    counter-increment: step-counter;
    padding-left: 42px;
    position: relative;
    margin-bottom: 12px;
}
.article-body ol > li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(13,148,136,0.25);
}

/* Unordered list — ромбические маркеры */
.article-body ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}
.article-body ul > li {
    padding-left: 24px;
    position: relative;
}
.article-body ul > li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 2px;
    transform: rotate(45deg);
    opacity: 0.5;
}

/* Цитаты — элегантная полоска с янтарным акцентом */
.article-body blockquote {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, #fffbeb, #fef9ee);
    margin: 24px 0;
    padding: 18px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.97em;
    line-height: 1.7;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.article-body blockquote::before {
    content: '\201C';
    position: absolute;
    top: -4px;
    left: 12px;
    font-size: 2.8em;
    color: var(--accent);
    opacity: 0.2;
    font-family: Georgia, serif;
}

/* Ключевой вывод */
.key-point {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border: 1px solid #99f6e4;
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 0.95em;
}
.key-point strong { background: none; }
.key-point::before {
    content: '📌 Ключевой момент';
    display: block;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85em;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inline code */
.article-body code {
    background: #f5f5f4;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.86em;
    border: 1px solid var(--border);
}

/* Блок кода — тёмный терминал */
.article-body pre {
    background: #1c1917;
    color: #e7e5e4;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    overflow-x: auto;
    position: relative;
    border: 1px solid #292524;
    box-shadow: var(--shadow-md);
}
.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.88em;
    line-height: 1.6;
}
.article-body pre::before {
    content: '📋';
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 0.8rem;
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s;
}
.article-body pre:hover::before { opacity: 0.7; }

/* ===========================================
   ТАБЛИЦЫ — Premium
   =========================================== */
.article-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    margin: 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.article-body th, .article-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.article-body th {
    background: linear-gradient(135deg, #1c1917, #292524);
    color: #fafaf9;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td {
    background: #fafaf9;
}
.article-body tr:hover td {
    background: #f0fdfa;
    transition: background 0.2s;
}

/* ============================================
   ATTENTION-BOX (контент из AI-генерации)
   ============================================ */

/* Общий контейнер */
.attention-box {
    border-radius: 12px;
    padding: 20px 24px;
    margin: 28px 0;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

/* Info-вариант — опросы, чеклисты */
.attention-box.attention-info {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border: 1px solid #99f6e4;
    padding: 16px 20px;
}
.attention-box.attention-info > div > strong {
    display: block;
    color: var(--primary);
    font-size: 0.95em;
    margin-bottom: 8px;
}
/* Pill-кнопки */
.attention-box.attention-info ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none !important;
    padding: 0 !important;
    margin: 4px 0 0 !important;
}
.attention-box.attention-info ul li {
    background: #fff;
    border: 1.5px solid #99f6e4;
    border-radius: 8px;
    padding: 6px 16px !important;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.attention-box.attention-info ul li:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,148,136,0.25);
}
/* Убираем дефолтные буллиты внутри attention-box */
.attention-box ul > li::before {
    display: none !important;
}
.attention-box ul > li {
    padding-left: 0;
    position: static;
}
.attention-box strong {
    background: none !important;
}

/* Warning-вариант */
.attention-box.attention-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-left: 4px solid var(--accent);
}

/* Tip-вариант — подсказки */
.attention-box.attention-tip {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border: 1px solid #99f6e4;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.attention-box.attention-tip .attention-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    line-height: 1;
}
.attention-box.attention-tip p {
    margin: 0;
    color: var(--text-secondary);
}

/* Danger-вариант */
.attention-box.attention-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
}

/* ===========================================
   FAQ — Premium interactive
   =========================================== */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg-card);
    overflow: hidden;
    transition: all 0.25s ease;
}
.faq-item:hover {
    border-color: #99f6e4;
    box-shadow: 0 2px 8px rgba(13,148,136,0.08);
}
.faq-item summary {
    padding: 16px 44px 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    color: var(--text);
    transition: color 0.2s;
}
.faq-item summary:hover { color: var(--primary); }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 300;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0fdfa;
    transition: all 0.25s;
}
.faq-item[open] summary::after {
    content: '−';
    background: var(--primary);
    color: #fff;
}
.faq-item[open] {
    border-color: var(--primary-light);
    box-shadow: 0 2px 12px rgba(13,148,136,0.1);
}
.faq-item .faq-answer { padding: 0 20px 16px; }
.faq-item .faq-answer p { color: var(--text-secondary); }

/* FAQ — general details */
.article-body details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg-card);
    overflow: hidden;
    transition: all 0.25s ease;
}
.article-body details:hover {
    border-color: #99f6e4;
}
.article-body summary {
    padding: 16px 44px 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    color: var(--text);
    transition: color 0.2s;
}
.article-body summary:hover { color: var(--primary); }
.article-body summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 300;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0fdfa;
    transition: all 0.25s;
}
.article-body details[open] summary::after {
    content: '−';
    background: var(--primary);
    color: #fff;
}
.article-body details[open] {
    border-color: var(--primary-light);
    box-shadow: 0 2px 12px rgba(13,148,136,0.1);
}
.article-body details > p { padding: 0 20px 16px; color: var(--text-secondary); }

/* Mobile TOC — only visible on mobile */
.mobile-toc {
    margin-bottom: 24px;
    display: none;
}
.mobile-toc details {
    background: linear-gradient(135deg, #fafaf9, #f5f5f4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.mobile-toc summary {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    padding: 14px 18px;
}
.mobile-toc ul {
    padding: 0 18px 14px !important;
    margin: 0 !important;
    list-style: none !important;
}
.mobile-toc ul li {
    padding-left: 0 !important;
    margin-bottom: 4px;
}
.mobile-toc ul li::before {
    display: none !important;
}
.mobile-toc ul li a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: all 0.2s;
}
.mobile-toc ul li a:hover {
    color: var(--primary);
    background: #f0fdfa;
}

/* ===========================================
   ВИДЖЕТЫ
   =========================================== */

/* Опрос */
.poll-block {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}
.poll-block h4 { color: var(--primary); margin-bottom: 14px; }
.poll-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.poll-btn {
    background: #fff;
    border: 2px solid #99f6e4;
    border-radius: var(--radius);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.25s;
}
.poll-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.poll-btn.voted { background: var(--primary); color: #fff; border-color: var(--primary); }
.poll-result p { color: var(--accent); font-weight: 600; margin-top: 10px; }

/* Чеклист */
.checklist-block {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}
.checklist-block h4 { color: var(--primary); margin-bottom: 12px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}
.check-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-progress { margin-top: 10px; font-size: 0.85em; color: var(--text-muted); }

/* Спойлер */
.spoiler-block {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: var(--radius);
    margin: 20px 0;
    overflow: hidden;
}
.spoiler-block summary { color: var(--primary-dark); padding: 14px 18px; }
.spoiler-block p { padding: 0 18px 14px; }

/* Совет */
.tip-block {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border: 1px solid #99f6e4;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.tip-icon { font-size: 1.5em; flex-shrink: 0; }
.tip-block p { margin: 0; }

/* ===========================================
   РЕЙТИНГ
   =========================================== */
.rating-block {
    text-align: center;
    padding: 24px;
    margin: 32px 0 20px;
    background: var(--bg-surface);
    border-radius: 12px;
}
.rating-block > p { color: var(--text-muted); margin-bottom: 10px; }
.star { font-size: 2em; cursor: pointer; transition: transform 0.15s; }
.star:hover { transform: scale(1.2); }
.rating-thanks { color: var(--primary); font-weight: 600; margin-top: 8px; }

/* ===========================================
   SHARE WIDGET
   =========================================== */
.share-widget { position: relative; }
.share-trigger {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.share-trigger:hover { background: var(--bg); border-color: var(--primary); }

.share-popup {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    gap: 4px;
    z-index: 50;
    flex-direction: column;
}
.share-popup.visible { display: flex; }

.share-link {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.share-link:hover { background: var(--bg-surface); }

/* Шаринг внизу */
.share-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.share-bottom-links { display: flex; gap: 8px; }
.share-bottom-links a {
    padding: 6px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.share-bottom-links a:hover { background: var(--primary); color: #fff; }

/* ===========================================
   САЙДБАР
   =========================================== */
.article-sidebar {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d6d3d1 transparent;
}
.article-sidebar::-webkit-scrollbar {
    width: 4px;
}
.article-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.article-sidebar::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 4px;
}
.article-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a29e;
}

.sidebar-toc,
.sidebar-related {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-toc h3,
.sidebar-related h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-toc ul { list-style: none; }
.sidebar-toc li { margin-bottom: 2px; }
.sidebar-toc a {
    font-size: 0.83rem;
    color: var(--text-muted);
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    line-height: 1.4;
}
.sidebar-toc a:hover {
    color: var(--primary);
    background: #f0fdfa;
    border-left-color: var(--primary);
}
.sidebar-toc a.active {
    color: var(--primary);
    background: #f0fdfa;
    font-weight: 600;
    border-left-color: var(--primary);
}

.sidebar-related ul { list-style: none; }
.sidebar-related li { margin-bottom: 8px; }
.related-card {
    display: block;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    transition: all 0.2s;
}
.related-card:hover { background: var(--bg-surface); color: var(--primary); }

/* ===========================================
   ПОХОЖИЕ СТАТЬИ — НИЖНИЙ БЛОК
   =========================================== */
.related-bottom {
    padding: 40px 0 48px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.related-bottom-heading {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    text-align: center;
}
.related-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-bottom-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.related-bottom-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.related-bottom-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text);
}
.related-bottom-card:hover .related-bottom-title {
    color: var(--primary);
}
.related-bottom-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .related-bottom-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .related-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   ПОДВАЛ
   =========================================== */
.site-footer {
    margin-top: 60px;
    padding: 24px 0;
    background: #1c1917;
    color: #a8a29e;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer a { color: #5eead4; }

/* ===========================================
   АДАПТИВНОСТЬ
   =========================================== */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .article-main {
        padding: 28px 24px 32px;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .mobile-toc {
        display: block;
    }
}

@media (max-width: 640px) {
    body { font-size: 16px; }

    .mobile-menu-btn { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 20px;
        box-shadow: 0 4px 12px rgba(28,25,23,0.06);
    }
    .main-nav.open { display: flex; }
    .nav-link { padding: 10px 0; }

    .article-main {
        padding: 20px 16px 24px;
    }
    .article-main h1 { font-size: 1.4rem; }
    .article-body h2 { font-size: 1.15rem; }

    .article-sidebar { grid-template-columns: 1fr; }
    .article-title-row { flex-direction: column; }

    .poll-opts { flex-direction: column; }
    
    .attention-box.attention-info ul { flex-direction: column; }
    .attention-box.attention-info ul li { white-space: normal; }
}

/* ===========================================
   FOOTER PREMIUM (moved from inline)
   =========================================== */
.site-footer-premium {
    margin-top: 60px; padding: 40px 0 0; background: #1c1917; color: #a8a29e;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
    padding-bottom: 32px; border-bottom: 1px solid #44403c;
}
.footer-brand { font-size: 1.2rem; font-weight: 700; color: #fafaf9; margin-bottom: 12px; }
.footer-about { font-size: 0.9rem; line-height: 1.6; margin-bottom: 8px; }
.footer-updated { font-size: 0.8rem; color: #78716c; }
.footer-col h4 { color: #fafaf9; font-size: 0.95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #a8a29e; font-size: 0.9rem; transition: color 0.2s; }
.footer-col a:hover { color: #5eead4; }
.footer-bottom { padding: 20px 0; text-align: center; font-size: 0.85rem; }

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===========================================
   COOKIE POPUP (moved from inline)
   =========================================== */
.cookie-popup {
    position: fixed; bottom: -100px; left: 0; right: 0; background: #1c1917; color: #fff;
    padding: 16px; transition: bottom 0.5s ease; z-index: 9999; border-top: 2px solid #0d9488;
}
.cookie-popup.visible { bottom: 0; }
.cookie-inner {
    max-width: 1200px; margin: 0 auto; display: flex;
    justify-content: space-between; align-items: center; gap: 16px; font-size: 0.9rem;
}
.cookie-btn {
    background: #0d9488; color: #fff; border: none; padding: 8px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cookie-btn:hover { background: #0f766e; }

@media (max-width: 640px) {
    .cookie-inner { flex-direction: column; text-align: center; }
}
