/* ===========================================
   Orange Energy — Warm Amber Theme
   Generated from teal-warm base
   =========================================== */

/* --- Переменные (легко менять тему) --- */
:root {
    --primary: #ea580c;
    --primary-light: #f97316;
    --primary-dark: #c2410c;
    --bg: #f0fdfa;
    --bg-card: #ffffff;
    --bg-surface: #ccfbf1;
    --text: #431407;
    --text-muted: #78716c;
    --text-secondary: #57534e;
    --accent: #ea580c;
    --border: #fed7aa;
    --gold: #f59e0b;
    --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: 8px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    max-width: 240px;
    flex-shrink: 0;
}
.logo span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-icon { font-size: 1.4rem; flex-shrink: 0; }

/* --- 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(234,88,12,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 #fff7ed;
    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: #fff7ed; }
.sidebar-search-box .sd-item:hover .sd-title { color: var(--primary); }
.sidebar-search-box .sd-icon {
    width: 28px; height: 28px; border-radius: 6px; background: #fff7ed;
    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: #fff7ed; 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%, #99f6e4 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(234,88,12,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, #f0fdfa, #ecfdf5);
    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, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    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: #fff7ed;
    color: #9a3412;
    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: #431407;
    color: #fed7aa;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    overflow-x: auto;
    position: relative;
    border: 1px solid #7c2d12;
    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, #431407, #7c2d12);
    color: #fffbeb;
    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: #fffbeb;
}
.article-body tr:hover td {
    background: #fff7ed;
    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, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    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 #fdba74;
    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(234,88,12,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, #f0fdfa, #ccfbf1);
    border: 1px solid #99f6e4;
    border-left: 4px solid var(--accent);
}

/* Tip-вариант — подсказки */
.attention-box.attention-tip {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    border: 1px solid #fdba74;
    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: #fdba74;
    box-shadow: 0 2px 8px rgba(234,88,12,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: #fff7ed;
    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(234,88,12,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: #fdba74;
}
.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: #fff7ed;
    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(234,88,12,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, #fffbeb, #fff7ed);
    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: #fff7ed;
}

/* ===========================================
   ВИДЖЕТЫ
   =========================================== */

/* Опрос */
.poll-block {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    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 #fdba74;
    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, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    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: #fff7ed;
    border: 1px solid #fdba74;
    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, #fff7ed, #fed7aa);
    border: 1px solid #fdba74;
    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: #fff7ed;
    border-left-color: var(--primary);
}
.sidebar-toc a.active {
    color: var(--primary);
    background: #fff7ed;
    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: #431407;
    color: #a8a29e;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer a { color: #fb923c; }

/* ===========================================
   АДАПТИВНОСТЬ
   =========================================== */
@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; }
    .logo { font-size: 1rem; max-width: 200px; gap: 6px; }
    .logo-icon { font-size: 1.2rem; }
    .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: #431407; color: #a8a29e;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
    padding-bottom: 32px; border-bottom: 1px solid #9a3412;
}
.footer-brand { font-size: 1.2rem; font-weight: 700; color: #fffbeb; 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: #fffbeb; 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: #fb923c; }
.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: #431407; color: #fff;
    padding: 16px; transition: bottom 0.5s ease; z-index: 9999; border-top: 2px solid #ea580c;
}
.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: #ea580c; color: #fff; border: none; padding: 8px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cookie-btn:hover { background: #c2410c; }

@media (max-width: 640px) {
    .cookie-inner { flex-direction: column; text-align: center; }
}

/* ===========================================
   СТАТИЧЕСКИЕ СТРАНИЦЫ (About, Contact, Privacy)
   =========================================== */
.page-hero {
    background: linear-gradient(135deg, #431407 0%, #7c2d12 100%);
    color: #fffbeb;
    padding: 60px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(234,88,12,0.15) 0%, transparent 60%),
                radial-gradient(circle at 70% 80%, rgba(217,119,6,0.1) 0%, transparent 50%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem; font-weight: 800;
    margin-bottom: 16px; letter-spacing: -0.02em;
}
.page-hero h1 span { color: var(--primary-light); }
.page-hero p {
    font-size: 1.1rem; color: #a8a29e;
    max-width: 700px; margin: 0 auto; line-height: 1.7;
}
.about-content, .contact-content, .privacy-content {
    max-width: 900px; margin: 0 auto; padding: 48px 20px 60px;
}
.about-block { margin-bottom: 48px; }
.about-block h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700; color: var(--text);
    margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.about-block h2 span { font-size: 1.4em; }
.about-block p { color: var(--text-secondary); line-height: 1.8; font-size: 1.02em; }
.values-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.value-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 24px;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease;
}
.value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #fdba74; }
.value-card h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.value-card p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.team-section { margin-top: 48px; }
.team-section h2 {
    font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
    color: var(--text); display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.team-section h2 span { font-size: 1.4em; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.team-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 28px; text-align: center;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease;
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #fdba74; }
.member-avatar {
    width: 64px; height: 64px; margin: 0 auto 14px;
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 4px 12px rgba(234,88,12,0.1);
}
.team-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.team-card .role {
    display: inline-block; font-size: 0.82rem; font-weight: 600;
    color: var(--primary); background: #fff7ed;
    padding: 3px 12px; border-radius: 20px; margin-bottom: 12px;
}
.team-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.contact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px; margin: 24px 0;
}
.contact-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 28px; text-align: center;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #fdba74; }
.contact-card .contact-icon { font-size: 2.2rem; margin-bottom: 12px; display: block; }
.contact-card h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.contact-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.contact-card a { color: var(--primary); font-weight: 500; }
.privacy-content h2 {
    font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700;
    color: var(--text); margin: 36px 0 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
.privacy-content p, .privacy-content li { color: var(--text-secondary); line-height: 1.8; }
.privacy-content ul { padding-left: 24px; margin: 12px 0; }

@media (max-width: 768px) {
    .page-hero { padding: 40px 0 32px; }
    .page-hero h1 { font-size: 1.6rem; }
    .page-hero p { font-size: 0.95rem; }
    .values-grid, .team-grid { grid-template-columns: 1fr; }
    .about-content, .contact-content, .privacy-content { padding: 32px 16px 40px; }
}

/* ===========================================
   ФУТЕР (Premium)
   =========================================== */
.site-footer-premium {
    margin-top: 60px; padding: 40px 0 0; background: #431407; color: #a8a29e;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
    padding-bottom: 32px; border-bottom: 1px solid #9a3412;
}
.footer-brand { font-size: 1.2rem; font-weight: 700; color: #fffbeb; 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: #fffbeb; font-size: 0.95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #a8a29e; font-size: 0.9rem; transition: color 0.2s; }
.footer-col a:hover { color: #fb923c; }
.footer-bottom { padding: 20px 0; text-align: center; font-size: 0.85rem; }

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===========================================
   СТРАНИЦА "О ПРОЕКТЕ"
   =========================================== */
.page-hero {
    background: linear-gradient(135deg, #431407 0%, #7c2d12 50%, #431407 100%);
    padding: 48px 0 40px;
    text-align: center;
    color: #fffbeb;
}
.page-hero h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.page-hero h1 span { color: var(--primary-light); }
.page-hero p {
    font-size: 1.05rem;
    color: #a8a29e;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.about-block {
    margin-bottom: 48px;
}
.about-block h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}
.about-block h2 span { margin-right: 8px; }
.about-block p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s;
}
.value-card:hover {
    border-color: #fdba74;
    box-shadow: 0 4px 16px rgba(234,88,12,0.08);
    transform: translateY(-2px);
}
.value-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.value-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===========================================
   КОМАНДА
   =========================================== */
.team-section {
    margin-bottom: 48px;
}
.team-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}
.team-section h2 span { margin-right: 8px; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.3s;
}
.team-card:hover {
    border-color: #fdba74;
    box-shadow: 0 6px 24px rgba(234,88,12,0.1);
    transform: translateY(-3px);
}

.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 14px;
    border: 3px solid #fff7ed;
    box-shadow: 0 2px 8px rgba(234,88,12,0.15);
}

.team-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.team-card .role {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.team-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Trust block */
.trust-block {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .values-grid { grid-template-columns: 1fr; }
    .page-hero h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; }
}

/* ===========================================
   MOBILE RESPONSIVE — Prevent horizontal overflow
   =========================================== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    /* Header */
    .header-inner { flex-wrap: wrap; }
    .main-nav { display: none; flex-direction: column; width: 100%; gap: 2px; padding-top: 8px; }
    .main-nav.open { display: flex; }
    .mobile-menu-btn { display: block; }
    .logo span:last-child { max-width: 200px; }

    /* Article layout: single column */
    .article-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Hide sidebar on mobile */
    .article-sidebar { display: none; }

    /* Article card: reduce padding */
    .article-main {
        padding: 20px 16px 24px;
        border-radius: 10px;
    }
    .article-main h1 {
        font-size: 1.35rem;
        margin-bottom: 16px;
    }

    /* Container padding */
    .container { padding: 0 12px; }
    .site-main { padding: 16px 0 32px; }

    /* Table: scrollable */
    .article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Code blocks: scroll horizontally */
    .article-body pre {
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        padding: 14px;
        font-size: 0.82rem;
    }

    /* Blockquotes */
    .article-body blockquote {
        margin-left: 0;
        margin-right: 0;
        padding: 12px 14px;
    }

    /* Images */
    .article-body img {
        max-width: 100%;
        height: auto;
    }

    /* Headings */
    .article-body h2 { font-size: 1.15rem; }
    .article-body h3 { font-size: 1.05rem; }

    /* FAQ */
    .faq-item summary { font-size: 0.92rem; padding: 12px 14px; }
    .faq-answer { padding: 10px 14px; }

    /* Attention boxes */
    .attention-box { padding: 12px 14px; }

    /* Breadcrumbs */
    .breadcrumbs { font-size: 0.78rem; padding: 10px 0; }

    /* Related bottom */
    .related-bottom-grid {
        grid-template-columns: 1fr !important;
    }

    /* Mobile TOC */
    .mobile-toc { margin-bottom: 16px; }
    .mobile-toc details { padding: 10px; }
}

/* Extra small screens */
@media (max-width: 400px) {
    .article-main {
        padding: 14px 12px 20px;
    }
    .article-main h1 {
        font-size: 1.2rem;
    }
    .container { padding: 0 8px; }
}

/* Word-break for any long text (always active) */
.article-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}
.article-body a {
    word-break: break-all;
}

/* ============================================
   Cookie Consent Popup
   ============================================ */
.cookie-popup {
    position: fixed; bottom: -100px; left: 0; right: 0;
    background: var(--bg-card, #fff); color: var(--text, #333);
    padding: 16px; transition: bottom 0.5s ease; z-index: 9999;
    border-top: 2px solid var(--primary, #ea580c);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
.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: var(--primary, #ea580c); color: #fff;
    border: none; padding: 8px 20px; border-radius: var(--radius, 8px);
    font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: opacity 0.2s;
}
.cookie-btn:hover { opacity: 0.85; }
@media (max-width: 640px) {
    .cookie-inner { flex-direction: column; text-align: center; }
}