/* =======================================================
   ОБЪЕДИНЕННЫЙ CSS (v16.0 FINAL - ИСПРАВЛЕННЫЙ СКРОЛЛ)
   - База: v15.0
   - ИСПРАВЛЕНИЕ: Изменено выравнивание в контейнерах логотипов
     с 'center' на 'flex-start'. Это гарантирует, что прокрутка
     будет работать корректно, и картинки не будут обрезаться слева,
     когда их много.
   ======================================================= */

/* --- 1. ПОДКЛЮЧЕНИЕ ШРИФТА Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Глобальное применение Inter */
body, h1, h2, h3, h4, h5, h6, p, a, li, div, span, input, button {
    font-family: "Inter", sans-serif !important;
}


/* =======================================================
   2. БАЗОВЫЕ СТИЛИ СТРУКТУРЫ
   ======================================================= */
/* --- ОБЩАЯ СЕТКА И ДЕСКТОП (> 992px) --- */
.pkp_structure_content {
    max-width: 1160px !important; margin: 0 auto; width: 100%; box-sizing: border-box; display: flex; flex-wrap: wrap;
}
.pkp_structure_main {
    width: 860px !important; flex: 0 0 860px !important; max-width: 860px !important; padding-right: 20px; box-sizing: border-box;
}
.pkp_structure_sidebar {
    width: 300px !important; min-width: 300px !important; flex: 0 0 300px !important;
    padding: 0 10px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
}
@media (min-width: 992px) {
    .pkp_structure_sidebar { padding-top: 30px; }
}

/* =======================================================
   3. ЕДИНЫЕ СТИЛИ ДЛЯ ПОЛОС С ЛОГОТИПАМИ (ВЕРХНЕЙ И НИЖНЕЙ)
   ======================================================= */

/* Основной контейнер верхней полосы (под баннером) */
.journal-indexing-strip {
    width: 760px !important;
    max-width: 760px !important;
    margin: 10px auto 20px auto !important;
    background-color: transparent;
    padding: 5px 0;
    text-align: center;
}

/* Текст на верхней полосе */
.indexing-text {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: bold; 
    color: #000000;
    margin-bottom: 15px;
}

/* --- УНИФИЦИРОВАННЫЕ КОНТЕЙНЕРЫ (Верхний + Нижний в футере) --- */
/* Применяем стили flex и прокрутки к обоим контейнерам сразу */
.indexing-logos-container,
.footer-partners-container {
    display: flex; /* Горизонтальный ряд */
    align-items: center;
    
    /* ВАЖНОЕ ИСПРАВЛЕНИЕ v16.0: выравнивание от начала, чтобы работал скролл */
    justify-content: flex-start; 
    
    gap: 25px; /* Отступ между логотипами */
    
    /* CSS-ПРОКРУТКА (ВИДИМАЯ) */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px; /* Место для скроллбара */

    /* --- СВЕТЛЫЙ СКРОЛЛБАР (Firefox) --- */
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #f9f9f9;
}

/* --- СВЕТЛЫЙ СКРОЛЛБАР (Chrome, Safari, Edge) --- */
/* Применяем к обоим контейнерам */
.indexing-logos-container::-webkit-scrollbar,
.footer-partners-container::-webkit-scrollbar {
    height: 8px;
}
.indexing-logos-container::-webkit-scrollbar-track,
.footer-partners-container::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 4px;
}
.indexing-logos-container::-webkit-scrollbar-thumb,
.footer-partners-container::-webkit-scrollbar-thumb {
    background-color: #d0d0d0;
    border-radius: 4px;
    border: 1px solid #f9f9f9;
}
.indexing-logos-container::-webkit-scrollbar-thumb:hover,
.footer-partners-container::-webkit-scrollbar-thumb:hover {
    background-color: #b0b0b0;
}

/* --- УНИФИЦИРОВАННЫЕ ЛОГОТИПЫ (Верхние + Нижние) --- */
/* Принудительная ширина 200px и эффекты для всех логотипов */
.indexing-logo,
.footer-partner-logo {
    display: block;
    width: 200px !important; /* ВАЖНО: Единый размер */
    height: auto !important; 
    object-fit: contain;
    filter: grayscale(100%); /* Черно-белые по умолчанию */
    opacity: 0.8;
    transition: all 0.3s ease;
    /* ВАЖНО: Запрет сжатия, чтобы они не сплющивались */
    flex: 0 0 auto; 
}
.indexing-logo:hover,
.footer-partner-logo:hover {
    filter: grayscale(0%); /* Цветные при наведении */
    opacity: 1;
    transform: scale(1.05);
}

/* Дополнительный отступ для обертки в футере, чтобы не прилипала к копирайту */
.footer-partners-wrapper {
    margin-bottom: 20px;
}


/* =======================================================
   4. ОСТАЛЬНЫЕ СТИЛИ (САЙДБАР, ЖУРНАЛ, ФУТЕР)
   ======================================================= */

/* --- ЭЛЕМЕНТЫ САЙДБАРА (ДЕСКТОП) --- */
.pkp_structure_sidebar .pkp_block {
    width: 100%; margin: 0 0 15px 0 !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center;
}
.pkp_structure_sidebar .pkp_block .content {
    width: 100%; padding: 0 !important; margin: 0 !important; display: flex; flex-direction: column; align-items: center;
}
.pkp_structure_sidebar .pkp_block .title {
    width: 240px !important; height: 29.02px !important; min-height: 29.02px !important;
    margin: 0 auto 10px auto !important; background-color: #e62129; color: #ffffff !important;
    font-size: 14px; font-weight: bold; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; text-align: center;
    border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); padding: 0;
}
.pkp_structure_sidebar .pkp_block .content > div[style*="background-color"],
.sidebar-button {
    width: 240px !important; margin: 0 auto 15px auto !important;
    border-bottom: 3px solid #f7bc4a !important; box-sizing: border-box; border-radius: 10px;
}
.pkp_structure_sidebar ul, .pkp_structure_sidebar .pkp_block ul, .pkp_structure_sidebar .pkp_block .content ul {
    width: 240px !important; padding: 0 !important; margin: 0 auto !important; list-style: none !important; display: block;
}
.pkp_structure_sidebar ul li, .pkp_structure_sidebar .pkp_block ul li {
    width: 100% !important; min-height: 29.02px; background-color: #ffffff;
    margin: 0 0 2px 0 !important; padding: 5px 0 !important;
    border-bottom: 1px solid #e62129; border-radius: 10px; box-sizing: border-box; text-align: center;
}
.pkp_structure_sidebar ul li a {
    font-size: 14px; color: #000000; text-decoration: none; font-weight: normal;
    display: block; width: 100%; text-align: center;font-weight: bolder;
}
.pkp_structure_sidebar ul li:hover { background-color: #ffffff !important; }
.pkp_structure_sidebar ul li a:hover { color: #e62129 !important; background-color: transparent !important; }

/* --- ФУТЕР (БАЗА) --- */
.pkp_brand_footer img { display: none !important; }

/* --- ОФОРМЛЕНИЕ БЛОКА ЖУРНАЛА (ДЕСКТОП) --- */
.custom-journal-wrapper {
    width: 100%; display: flex; flex-direction: column; align-items: center;
    margin-bottom: 40px; box-sizing: border-box;
}
.journal-top-banner {
    width: 760px !important; max-width: 760px !important; margin: 0 auto 20px auto;
    border-radius: 10px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.journal-top-banner img { width: 100%; height: auto; display: block; }
.journal-grid-info {
    width: 760px !important; max-width: 760px !important; display: flex;
    justify-content: space-between; margin: 0 auto 10px auto !important; gap: 20px;
}
.journal-cover-col {
    width: 220px !important; min-width: 220px !important; flex: 0 0 220px !important;
}
.journal-cover-col img.cover-img {
    width: 100%; height: auto; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    border: 1px solid #ddd; display: block;
}
.journal-meta-col {
    flex: 1; background-color: #fff; border: 1px solid #eee; border-radius: 5px;
    overflow: hidden; display: flex; flex-direction: column;
}
.meta-row {
    display: flex; border-bottom: 1px solid #eee; min-height: 35px; background-color: #fff;
}
.meta-row:last-child { border-bottom: none; }
.meta-row.first-row { background-color: #e0e0e0 !important; border-bottom: 1px solid #ccc; }
.meta-label {
    width: 150px; min-width: 150px; padding: 10px 15px; font-weight: bold;
    font-size: 13px; color: #333; display: flex; align-items: center;
}
.meta-value {
    flex: 1; padding: 10px 15px; font-size: 13px; color: #444;
    display: flex; align-items: center; flex-wrap: wrap; line-height: 1.4;
}
.meta-value a { color: #007bff; text-decoration: none; border-bottom: 1px dotted #007bff; }
.meta-value a:hover { color: #0056b3; border-bottom: 1px solid #0056b3; }
.journal-description-text {
    width: 760px !important; max-width: 760px !important; margin: 0 auto;
    border: 1px solid #eee; border-radius: 5px; background-color: #fff;
    font-size: 14px; line-height: 1.6; color: #333; text-align: justify;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 10px 20px 20px 20px !important;
}
.journal-description-text h2 {
    margin-top: 0 !important; padding-top: 0 !important; margin-bottom: 10px !important; line-height: 1.2;
}

/* --- PDF ВЬЮВЕР --- */
.header_view { background-color: #d32f2f !important; border-bottom: none; color: #fff; }
.header_view .return, .header_view .title { color: #fff !important; text-decoration: none; }
.header_view .download {
    background-color: #fff; color: #d32f2f !important; border-radius: 4px;
    padding: 5px 15px; font-weight: bold; text-decoration: none; transition: all 0.3s ease;
}
.header_view .download:hover { background-color: #ffebee; color: #b71c1c !important; }


/* =======================================================
   5. МОБИЛЬНАЯ ВЕРСИЯ (< 992px)
   ======================================================= */
.journal-top-banner img, .custom-journal-wrapper img {
    max-width: 100% !important; height: auto !important; display: block; margin: 0 auto;
}

@media (max-width: 991.98px) {
    /* --- Сайдбар вниз --- */
    .pkp_structure_main {
        order: 1 !important; width: 100% !important; flex: 0 0 100% !important;
        padding: 0 10px !important; margin: 0 !important;
    }
    .pkp_structure_sidebar {
        display: flex !important; flex-direction: column !important; align-items: center !important;
        width: 100% !important; min-width: 100% !important; order: 2 !important;
        margin-top: 20px !important; padding: 0 10px !important;
    }

    /* --- Адаптация блока журнала --- */
    .journal-top-banner, .journal-grid-info, .journal-description-text {
        width: 100% !important; max-width: 100% !important;
    }
    .custom-journal-wrapper, .journal-description-text, .block {
        background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); padding: 10px 12px !important;
        margin-bottom: 15px !important; overflow: hidden;
    }
    .custom-journal-wrapper h2, .journal-description-text h2, .block h2 {
        margin-top: 0 !important; margin-bottom: 10px !important; font-size: 18px !important;
    }
    .journal-top-banner img, .journal-cover-col img.cover-img, .journal-description-text img, .block img {
        border-radius: 8px !important;
    }
    .journal-grid-info { display: block !important; }
    .journal-cover-col { width: 100% !important; text-align: center; margin-bottom: 15px !important; padding: 0 !important; }
    .journal-meta-col {
        width: 100% !important; padding: 0 !important; border: none !important;
        border-top: 2px solid #d0d0d0 !important;
    }
    .meta-row { display: flex; flex-direction: column; padding: 12px 0 !important; border-bottom: 2px solid #d0d0d0 !important; }
    .meta-label { width: 100% !important; font-size: 14px !important; font-weight: 700 !important; margin-bottom: 5px !important; }
    .meta-value { width: 100% !important; font-size: 14px !important; }

    /* --- Адаптация полос индексации (Верхняя) --- */
    .journal-indexing-strip {
        width: 100% !important; max-width: 100% !important; margin-top: 10px !important; padding: 10px 0;
    }
    .indexing-text { font-size: 13px; }
    
    /* --- Адаптация контейнеров и логотипов (Верхние + Нижние) --- */
    .indexing-logos-container,
    .footer-partners-container {
        justify-content: flex-start; /* Выравнивание влево для прокрутки */
        gap: 20px;
    }
    /* На мобильных делаем чуть меньше, 150px, для обоих блоков */
    .indexing-logo,
    .footer-partner-logo {
        width: 150px !important;
    }

    /* --- ВЫРАВНИВАНИЕ В САЙДБАРЕ (МОБИЛЬНЫЕ) --- */
    .pkp_structure_sidebar .pkp_block .title,
    .pkp_structure_sidebar .pkp_block .content > div[style*="background-color"],
    .pkp_structure_sidebar .pkp_block ul,
    .sidebar-button {
        width: 92% !important; max-width: none !important;
        margin-left: auto !important; margin-right: auto !important;
        box-sizing: border-box !important; text-align: center !important;
        border-radius: 10px !important;
    }
    .pkp_structure_sidebar .pkp_block { margin-bottom: 25px !important; }
}


/* =======================================================
   6. ФУТЕР (ТЕКСТ)
   ======================================================= */
.pkp_structure_footer {
    background-color: #ffffff !important; text-align: center !important;
    padding: 0 !important; margin: 0 !important; border: none !important;
}
.pkp_structure_footer_wrapper { padding-top: 20px; }
.custom-footer-copyright-text p {
    color: #202020 !important; font-size: 14px; line-height: 1.5; font-weight: 500; margin: 0 0 5px 0 !important;
}
.custom-footer-copyright-text a { color: #202020 !important; text-decoration: underline; }


/* --- УЛЬТРА-КОМПАКТНЫЕ МОБИЛЬНЫЕ КАРТОЧКИ (МАКСИМАЛЬНОЕ СЖАТИЕ) --- */
@media only screen and (max-width: 767px) {
    
    .journal-meta-col {
        display: block !important;
        width: 100% !important;
        padding: 0 4px !important;
        box-sizing: border-box !important;
    }

    .journal-meta-col .meta-row {
        /* Тонкая рамка */
        border: 2px solid #7aa8d9 !important; 
        border-radius: 6px !important;
        background-color: #ffffff !important;
        
        /* МАКСИМАЛЬНОЕ УМЕНЬШЕНИЕ ВЫСОТЫ */
        margin-bottom: 5px !important; /* Щель между карточками всего 5px */
        padding: 4px 8px !important;   /* Внутренний отступ минимальный */
        
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Заголовок (Label) */
    .journal-meta-col .meta-label {
        font-weight: bold;
        display: block !important;
        margin-bottom: 0 !important; /* Убираем отступ между заголовком и текстом */
        color: #000 !important;
        font-size: 0.85em !important; /* Шрифт чуть меньше для компактности */
        line-height: 1.1 !important;  /* Плотный межстрочный интервал */
    }

    /* Значение (Value) */
    .journal-meta-col .meta-value {
        display: block !important;
        word-wrap: break-word !important;
        font-size: 0.9em !important;
        line-height: 1.1 !important;  /* Плотный текст */
        margin-top: 1px !important;
    }
}

/* --- ВЫРАВНИВАНИЕ БАННЕРА (ОПУСКАЕМ ВНИЗ) --- */
@media only screen and (min-width: 992px) {
    .custom-journal-wrapper {
        /* Добавляем отступ сверху, чтобы сравнять с кнопками */
        margin-top: 30px !important; 
    }
}

/* Скрываем поиск в липком меню */
.pkp_navigation_primary_wrapper.sticky .pkp_search,
.pkp_navigation_primary_wrapper.sticky .search-item,
.pkp_navigation_primary_wrapper.sticky li[class*="search"] {
    display: none !important;
}