﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
    color: #1a1a1a;
    font-size: 17px;
    line-height: 1.8;
    padding: 20px;
}

.container {
    max-width: 1150px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 50px 80px;
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    border-bottom: 3px solid #3498db;
    padding-bottom: 30px;
    margin-bottom: 24px;
}

h1 {
    font-size: 2.2em;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.tag {
    display: inline-block;
    background: #ddf4ff;
    color: #0969da;
    border: 1px solid #54aeff;
    padding: 3.6px 10.8px;
    border-radius: 4px;
    font-size: 0.76em;
    font-weight: 500;
    margin-top: 10px;
    margin-right: 8px;
}

/* Кнопка "К списку" */
.back-btn {
    display: inline-block;
    padding: 9px 16px;
    background: #f3f5f7;
    color: #44505c;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    margin: 0 0 24px 0;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #e7ebef;
    color: #1f2933;
}

.back-btn-bottom {
    margin-top: 0;
    margin-bottom: 0;
}

.lumberjack-return-block {
    display: block;
    margin-top: 28px;
    margin-left: -80px;
    margin-right: -80px;
}

.lumberjack-return-block .back-btn-bottom {
    margin: 0 0 44px 80px;
}

.lumberjack-game-band {
    padding: 26px 80px;
    background: #eef7f9;
    border-top: 1px solid #d3e9ee;
    border-bottom: 1px solid #d3e9ee;
}

h2 {
    font-size: 1.76em;
    color: #1a1a1a;
    margin: 35px 0 20px 0;
    padding-left: 15px;
    border-left: 4px solid #3498db;
}

h3 {
    font-size: 1.43em;
    color: #2a2a2a;
    margin: 25px 0 15px 0;
}

p {
    margin-bottom: 15px;
    color: #2a2a2a;
}

strong {
    color: #1a1a1a;
    font-weight: 600;
}

ul, ol {
    margin: 20px 0 20px 40px;
    color: #2a2a2a;
}

li {
    margin-bottom: 12px;
    padding-left: 5px;
}

/* ===== Инлайн код внутри текста ===== */
code {
    background: #f4f4f4;
    color: blue;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95em;
    font-weight: 460;
    border: 1px solid #e1e4e8;
}

/* ===== Контейнер для блоков кода ===== */
.code-container {
    position: relative;
    margin: 20px 0;
    max-width: 100%;
}

/* ===== Кнопка копирования кода ===== */
.copy-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px 5px 35px;
    background-color: #007bff;
    color: white;
    font-size: 14px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 5px;
    background-image: url('data:image/svg+xml;charset=UTF8,<svg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22><path%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M7%205C7%203.34315%208.34315%202%2010%202H19C20.6569%202%2022%203.34315%2022%205V14C22%2015.6569%2020.6569%2017%2019%2017H17V19C17%2020.6569%2015.6569%2022%2014%2022H5C3.34315%2022%202%2020.6569%202%2019V10C2%208.34315%203.34315%207%205%207H7V5ZM9%207H14C15.6569%207%2017%208.34315%2017%2010V15H19C19.5523%2015%2020%2014.5523%2020%2014V5C20%204.44772%2019.5523%204%2019%204H10C9.44772%204%209%204.44772%209%205V7ZM5%209C4.44772%209%204%209.44772%204%2010V19C4%2019.5523%204.44772%2020%205%2020H14C14.5523%2020%2015%2019.5523%2015%2019V10C15%209.44772%2014.5523%209%2014%209H5Z%22%20fill%3D%22white%22/></svg>');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 20px 20px;
}

.copy-button.copied {
    background-image: url('data:image/svg+xml;charset=UTF8,<svg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22><path%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.0633%205.67387C18.5196%205.98499%2018.6374%206.60712%2018.3262%207.06343L10.8262%2018.0634C10.6585%2018.3095%2010.3898%2018.4679%2010.0934%2018.4957C9.79688%2018.5235%209.50345%2018.4178%209.29289%2018.2072L4.79289%2013.7072C4.40237%2013.3167%204.40237%2012.6835%204.79289%2012.293C5.18342%2011.9025%205.81658%2011.9025%206.20711%2012.293L9.85368%2015.9396L16.6738%205.93676C16.9849%205.48045%2017.607%205.36275%2018.0633%205.67387Z%22%20fill%3D%22white%22/></svg>');
}

.copy-button:hover {
    background-color: #0056b3;
}

/* ===== Блоки кода с раскраской ===== */
pre {
    margin: 0;
    padding: 0;
    line-height: 1.5;
    border: none;
    display: block;
    white-space: pre;
    overflow-x: auto;
    word-wrap: normal;
}

/* ===== Заголовок блока кода для сворачивания ===== */
.code-header {
    padding: 8px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-radius: 3px 3px 0 0;
}

.code-header:hover {
    background: #d0d0d0;
}

/* ===== Кнопка сворачивания/разворачивания ===== */
.collapse-btn {
    font-size: 1.2em;
    font-weight: bold;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    color: #2e6df5;
    margin-right: 8px;
}

.collapse-btn::before {
    content: "-";
}

.collapse-btn.collapsed {
    color: #dc3545;
}

.collapse-btn.collapsed::before {
    content: "+";
}

.code-block {
    margin: 0;
    padding: 15px 20px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    transition: max-height 0.3s ease-out;
    position: relative;
    white-space: nowrap;
    tab-size: 4;
}

/* Если есть заголовок - убираем верхние скругления */
.code-header + .code-block {
    border-radius: 0 0 8px 8px;
}

/* ===== Свернутое состояние блока кода ===== */
.code-block.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

/* ===== Автосворачивание для больших блоков (>20 строк) ===== */
.code-block.auto-collapsed {
    max-height: 400px;
    overflow: hidden;
    position: relative;
    border-radius: 0 0 8px 8px;
}

/* Для auto-collapsed блоков кнопка expand имеет верхние скругления */
.code-block.auto-collapsed + .expand-button {
    margin-top: 0;
}

.code-block.auto-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(244,244,244,0) 0%, rgba(244,244,244,0.9) 50%, rgba(244,244,244,1) 100%);
    pointer-events: none;
}

.expand-button {
    display: none;
    width: 100%;
    padding: 10px;
    background-color: #b8c9d9;
    color: #3d4a52;
    border: none;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    margin-top: -1px;
    position: relative;
}

.expand-button.visible {
    display: block;
}

.expand-button::before {
    content: '▼';
    margin-right: 8px;
    font-size: 12px;
}

.expand-button.expanded::before {
    content: '▲';
}

.expand-button:hover {
    background-color: #a0b3c5;
}

.code-block code {
    display: inline-block;
    color: blue;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15.4px;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    white-space: pre;
}

/* ===== Раскраска синтаксиса 1С ===== */
.red {
    color: red;
}

.green {
    color: green;
}

.black {
    color: black;
}

.brown {
    color: brown;
}

.standart {
    color: blue;
}

.space {
    color: black;
}

.line {
    white-space: pre;
}

.footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
    color: #95a5a6;
    font-size: 0.95em;
}

/* ========== СТИЛИ ГЛАВНОЙ СТРАНИЦЫ (INDEX) ========== */

/* Ссылка "Для предложений" в шапке */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.contact-link {
    display: inline-block;
    background: #e8f4fc;
    color: #3498db;
    text-decoration: none;
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 12px;
    transition: all 0.2s;
}

.contact-link:hover {
    background: #3498db;
    color: white;
}

/* Футер с контактами */
.footer-contact {
    margin-bottom: 10px;
    color: #95a5a6;
}

.footer-contact a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.footer-copy {
    color: #95a5a6;
}
.footer-legal {
    margin-top: 8px;
    font-size: 13px;
}

.footer-legal a {
    color: inherit;
    opacity: 0.7;
    text-decoration: underline;
}

.footer-legal a:hover {
    opacity: 1;
}

/* Body для главной страницы */
body.index-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
    padding: 20px;
    min-height: 100vh;
}

body.index-page .container {
    max-width: 1150px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 40px 60px;
}

/* Шапка главной страницы */
body.index-page .header {
    text-align: left;
    border-bottom: 3px solid #3498db;
}

.header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.index-page .header h1 {
    font-size: 1.8em;
    margin: 0;
}

.results-count {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Фильтры */
.filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.filters-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    font-size: 0.65em;
    color: #888;
    margin-bottom: 3px;
    font-weight: 500;
}

.filter-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.75em;
    background: white;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-self: flex-end;
    padding-bottom: 1px;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Список статей */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.article-item {
    padding: 15px 20px;
    border-left: none;
    transition: all 0.2s;
    position: relative;
}

.article-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 90%;
    width: 3px;
    background: linear-gradient(to bottom,
        #e8e8e8 0%,
        #e8e8e8 40%,
        #3498db 40%,
        #3498db 60%,
        #e8e8e8 60%,
        #e8e8e8 100%);
    transition: all 0.2s;
}

.article-item:hover {
    background: #f8f9fa;
}

.article-item:hover::before {
    background: #3498db;
}

.article-meta {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 3px;
}

.article-title {
    font-size: 1.09em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.article-title a:hover {
    color: #3498db;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Главная страница учебных материалов */
.learning-index-page .learning-nav {
    margin-top: 4px;
}

.learning-index-page .learning-article-item {
    padding: 18px 20px;
}

.learning-index-page .article-description {
    margin: -2px 0 11px;
    color: #606975;
    font-size: 0.94em;
    line-height: 1.5;
}

.learning-index-page .learning-empty {
    margin: 0;
    padding: 18px 20px;
    color: #606975;
}

/* Теги на главной странице (серые) */
body.index-page .tag {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 2px 7px;
    font-size: 0.665em;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 15px 0;
}

/* Ссылки в пагинации */
.pagination a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* Троеточия как текст (не кнопка) */
.page-dots {
    color: #999;
    font-size: 0.85em;
    padding: 0 4px;
    user-select: none;
}


.pagination-top {
    margin-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.pagination-bottom {
    margin-top: 30px;
    border-top: 1px solid #e8e8e8;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.page-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: none;
    box-shadow: none;
}

.page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.page-btn.disabled:hover {
    border-color: #ddd;
    color: #ccc;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Адаптивность для страницы статьи */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.3em;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    .header {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .tag {
        padding: 3px 8px;
        font-size: 0.75em;
    }

    .back-btn {
        padding: 9px 16px;
        font-size: 14px;
    }

    .back-btn-bottom {
        margin-top: 0;
    }

    .lumberjack-return-block {
        margin-left: -15px;
        margin-right: -15px;
    }

    .lumberjack-return-block .back-btn-bottom {
        margin-left: 15px;
    }

    .lumberjack-game-band {
        padding: 22px 15px;
    }

    p, li {
        font-size: 0.95em;
    }

    .code-block {
        padding: 10px;
        font-size: 0.85em;
    }

    .code-block code {
        font-size: 13px;
    }

    .copy-button {
        padding: 4px 8px 4px 28px;
        font-size: 12px;
        background-size: 16px 16px;
    }

    ul, ol {
        margin-left: 20px;
    }

    /* Адаптивность для главной страницы */
    body.index-page .container {
        padding: 15px;
    }

    .header-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    body.index-page .header h1 {
        font-size: 1.3em;
    }

    .filters-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .filter-group {
        min-width: auto;
    }

    .filter-buttons {
        align-self: end;
        justify-content: flex-end;
    }

    .article-meta {
        font-size: 0.75em;
    }

    .article-title {
        font-size: 1em;
    }

    .pagination .page-btn {
        padding: 5px 9px;
        font-size: 0.75em;
    }

    /* Уменьшаем стрелки на мобильном */
    .pagination .page-btn.nav-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    /* Скрываем первую страницу и троеточия на мобильном */
    .pagination .page-first,
    .pagination a:has(.page-first),
    .pagination .page-dots {
        display: none;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
        border-radius: 10px;
    }

    body.index-page .container {
        padding: 10px;
    }

    /* Кнопка сброса рядом с отраслью */
    .filter-buttons {
        justify-content: flex-end;
    }

    /* Уменьшаем пагинацию */
    .pagination {
        gap: 5px;
        padding: 10px 0;
    }

    .pagination .page-btn {
        padding: 4px 8px;
        font-size: 0.7em;
    }

    .pagination .page-btn.nav-btn {
        padding: 5px 9px;
        font-size: 0.75em;
    }
}

/* ========== НОВАЯ ГЛАВНАЯ: ТОП-ВИТРИНА + ПОИСК ========== */

/* Резервируем место под скроллбар, чтобы страница не прыгала вбок
   при переключении на короткие отборы */
html {
    scrollbar-gutter: stable;
}

.top-subtitle {
    font-size: 0.95em;
    color: #666;
    margin-top: 6px;
}

/* --- Заголовок секции (меняется под вкладку) --- */
.section-intro {
    margin: 22px 0 26px;
}
.section-intro h1 {
    font-size: 1.8em;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.25;
}
.section-intro .top-subtitle {
    margin-top: 8px;
}

@media (max-width: 480px) {
    .section-intro h1 { font-size: 1.3em; }
}

/* --- Главные вкладки: слайдер Популярное / Поиск + контакт --- */
.tabs-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.slider-track {
    position: relative;
    display: inline-flex;
    background: #eef0f4;
    border-radius: 18px;
    padding: 6px;
}
.slider-pill {
    position: absolute;
    top: 6px;
    left: 0;
    height: calc(100% - 12px);
    background: #1870cb;
    border-radius: 13px;
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1),
                width 0.25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 10px rgba(24, 112, 203, 0.35);
    z-index: 0;
}
.slider-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #444;
    cursor: pointer;
    transition: color 0.22s;
    border-radius: 13px;
    white-space: nowrap;
    font-family: inherit;
}
.slider-btn.active { color: #fff; }
.slider-btn:hover:not(.active) { color: #111; }

@media (max-width: 480px) {
    .slider-btn { padding: 10px 16px; font-size: 14px; }
}

/* Заголовок секции (Самое читаемое / Поиск) */
.section-head {
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px 0;
    padding-left: 12px;
    border-left: 4px solid #3498db;
}

.home-section {
    margin-bottom: 40px;
}

/* --- Вкладки аудитории --- */
.audience-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e8edf2;
}
.aud-tab {
    padding: 9px 18px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.18s;
    font-family: inherit;
}
.aud-tab:hover { color: #3498db; }
.aud-tab.active { color: #3498db; border-bottom-color: #3498db; }
.aud-tab .cnt { font-size: 0.8em; color: #aaa; font-weight: 500; margin-left: 4px; }
.aud-tab.active .cnt { color: #7fbce8; }

/* Значок-подиум для вкладки ТОП */
.tab-top-icon {
    vertical-align: -3px;
    margin-right: 6px;
}
.aud-tab.tab-top { color: #f43f5e; }
.aud-tab.tab-top.active { color: #e11d48; border-bottom-color: #f43f5e; }
.aud-tab.tab-top:hover { color: #e11d48; }

/* --- Чипы программы --- */
.program-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    min-height: 30px;
}
.prog-chip {
    padding: 5px 14px;
    border: 1px solid #d8dee4;
    background: #fff;
    color: #57606a;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}
.prog-chip:hover { border-color: #3498db; color: #3498db; }
.prog-chip.active { background: #3498db; border-color: #3498db; color: #fff; }
.chips-label { font-size: 0.78em; color: #999; align-self: center; margin-right: 2px; }

/* --- Карточка статьи с рангом и просмотрами --- */
.article-item.ranked { display: flex; align-items: flex-start; gap: 14px; }
.art-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    flex-shrink: 0;
    padding-top: 1px;
}
.rank-num {
    font-size: 1.2em;
    font-weight: 700;
    color: #c5ccd3;
    line-height: 1;
}
.art-body { flex: 1; min-width: 0; }

/* Просмотры тегом-квадратиком (в синеву), в строке тегов */
.views-inline {
    display: inline-block;
    color: #5f7894;
    font-size: 0.665em;
    font-weight: 500;
    background: #eaf1fa;
    border: 1px solid #d4e2f2;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: inherit;
}
.article-tags { align-items: center; }
/* gap уже задаёт расстояние — убираем унаследованные margin у элементов строки,
   иначе они сдвигают бейджи по вертикали друг относительно друга */
.article-tags .tag,
.article-tags .views-inline {
    margin: 0;
}
.empty-msg { text-align: center; color: #999; padding: 40px 20px; font-size: 0.95em; }

.top-list { min-height: 320px; }

/* --- Блок 2: поиск --- */
.search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.search-input {
    flex: 1;
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
}
.search-input:focus { outline: none; border-color: #3498db; }
.search-select {
    padding: 9px 10px;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    font-size: 0.85em;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}
.search-select:focus { outline: none; border-color: #3498db; }
.search-count { font-size: 0.82em; color: #888; margin-bottom: 10px; }

/* Кнопка "Показать ещё" в поиске */
.search-more { text-align: center; margin-top: 18px; }
.show-more-btn {
    padding: 10px 28px;
    border: 1px solid #d8dee4;
    background: #fff;
    color: #3498db;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}
.show-more-btn:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* ===== Мобильная адаптация новой главной ===== */
@media (max-width: 600px) {
    /* Вкладки аудитории — аккуратный перенос таблетками (без подчёркивания) */
    .audience-tabs {
        border-bottom: none;
        gap: 6px;
    }
    .aud-tab {
        padding: 7px 13px;
        font-size: 0.83em;
        border: 1px solid #e0e4e9;
        border-radius: 16px;
        margin-bottom: 0;
    }
    .aud-tab.active {
        background: #3498db;
        color: #fff;
        border-color: #3498db;
    }
    .aud-tab.active .cnt { color: rgba(255, 255, 255, 0.75); }
    /* ТОП-вкладка активна — розовая рамка без заливки, чтобы значок-подиум был виден */
    .aud-tab.tab-top.active {
        background: #fff5f6;
        color: #e11d48;
        border-color: #f43f5e;
    }

    /* Чипы программы — перенос (без скролла) */
    .program-chips { flex-wrap: wrap; }

    /* Поиск — поле на всю ширину, селекты в ряд под ним */
    .search-input { min-width: 100%; flex: 1 1 100%; }
    .search-select { flex: 1; min-width: 0; }

    /* Карточки — компактнее левая колонка */
    .art-rank { min-width: 24px; }
    .rank-num { font-size: 1.05em; }

    /* Пагинация — перенос и компактные кнопки, чтобы не вываливалась */
    .pagination { flex-wrap: wrap; gap: 5px; }
    .pagination .page-btn { padding: 5px 9px; font-size: 0.78em; }
}

/* ========== БЛОК «ЧИТАЙТЕ ТАКЖЕ» (перелинковка, стиль Editorial) ========== */
.related-articles {
    margin-top: 45px;
    border-top: 2px solid #3498db;
    padding-top: 22px;
}

.related-articles .ra-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.related-articles .ra-head h3 {
    margin: 0;
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3498db;
    border: none;
    padding: 0;
}

.related-articles .ra-count {
    font-size: 0.72em;
    color: #bbb;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.related-articles ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-articles li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0 16px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: start;
}

.related-articles li:last-child {
    border-bottom: 1px solid #f0f0f0;
}

.related-articles li .num {
    font-size: 0.95em;
    font-weight: 700;
    color: #3498db;
    line-height: 1.5;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}

.related-articles li a {
    color: #2a3340;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s;
}

.related-articles li a::after {
    content: ' →';
    opacity: 0;
    color: #3498db;
    transition: opacity 0.2s;
}

.related-articles li:hover .num { color: #3498db; }
.related-articles li:hover a { color: #1870cb; }
.related-articles li:hover a::after { opacity: 1; }

@media (max-width: 768px) {
    .related-articles { margin-top: 30px; }
    .related-articles li { grid-template-columns: 24px 1fr; gap: 0 10px; }
}

/* Изображения внутри статей */
.image-container {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    margin: 20px 0;
    padding: 8px;
    background-color: #f8f8f8;
    border-radius: 5px;
    text-align: left;
}

.image-container img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 3px;
}

/* Блок скачивания файла в статье */
.download-section {
    margin: 20px 0;
    padding: 5px 15px 15px;
    background: #faf3e7;
    border-radius: 1px;
}

.download-section .download-title {
    margin: 5px 0 10px;
    color: #2d3748;
    font-size: 20px;
    font-weight: 600;
}

.download-section .download-block {
    margin: 20px 0;
    padding: 3px;
    border-top: 3px solid #e0e0e0;
    border-bottom: 3px solid #e0e0e0;
}

.download-section .content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.download-section .file-main-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.download-section .file-title {
    color: #2d3748;
    font-size: 18px;
}

.download-section .file-format {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #718096;
    font-size: 0.9em;
}

.download-section .file-doc-icon {
    display: inline-block;
    position: relative;
    top: 3px;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath fill="%23718096" d="M14,2H6A2,2 0,0 0 4,4V20A2,2 0,0 0 6,22H18A2,2 0,0 0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-size: contain;
}

.download-section .download-info {
    display: flex;
    align-items: center;
}

.download-section .download-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 60px;
    color: #000;
    font-weight: 500;
    text-decoration: none;
    background-color: #f6be01;
    border-radius: 2px;
    transition: background-color 0.3s;
}

.download-section .download-button:hover {
    background-color: #e6aa00;
}

.download-section .download-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath fill="%23000" d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-size: contain;
}

.download-section .download-button:hover .download-icon {
    transform: translateY(2px);
    transition: transform 0.2s ease;
}

@media (max-width: 600px) {
    .download-section .content-wrapper {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .download-section .download-button {
        padding: 8px 24px;
    }
}

