/* ============================================
   БАЗОВЫЕ СБРОСЫ И ШРИФТЫ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* Контейнер */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ШАПКА И НАВИГАЦИЯ
   ============================================ */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}

/* Основное меню */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    height: 100%;
}

.menu-item {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-item>a {
    text-decoration: none;
    color: #333;
    font-weight: bolder;
    font-size: 14px;
    padding: 25px 0;
    position: relative;
    transition: color 0.3s ease;
}

.menu-item>a::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #000;
    transition: width 0.3s ease;
}

.menu-item:hover>a::after {
    width: 100%;
}

.menu-item:hover>a {
    color: #000;
}

.menu-item.active>a::after {
    width: 100%;
    /* Подчеркивание всегда видно */
    background-color: #000;
    /* Цвет как у hover */
}

/* Правая часть меню (кнопки) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.nav-button {
    background-color: #333;
    color: #fff !important;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bolder;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.nav-button i {
    color: white;
    margin-left: 5px;
}

.nav-button:hover {
    background-color: #333;
}

/* Стили для приветствия */
.welcome {
    color: #fff;
    margin-right: 15px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
}

.welcome::before {
    content: '👋';
    margin-right: 6px;
    font-size: 16px;
}

/* Стили для кнопки выхода */
.logout-btn {
    background-color: transparent;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.logout-btn:hover {
    background-color: #ff6b6b;
    color: #fff;
}

/* Стили для ссылки на админку */
.admin-link {
    color: #ffd700;
    margin-right: 15px;
    text-decoration: none;
    font-size: 14px;
}

.admin-link:hover {
    text-decoration: underline;
}

/* Базовые стили для блока с логином */
.user-login {
    color: #333;
    margin-right: 15px;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.user-login i {
    margin-right: 6px;
    font-size: 14px;
    color: #ffffff;
    opacity: 0.9;
}

.user-login.admin-login i {
    color: #333;
}

.user-login.admin-login:hover {
    color: #9d0707;
}

/* Ссылка внутри блока администратора */
.admin-login-link {
    color: #333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-login-link:hover {
    color: #9d0707;
}

.admin-login-link i {
    transition: transform 0.3s ease;
}

.admin-login-link:hover i {
    transform: rotate(30deg);
}

#logoutBtn:hover {
    background-color: #9d0707;
    color: #fff !important;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* ============================================
   СТИЛИ ДЛЯ СЕКЦИЙ (БЕЗ ПАРАЛЛАКСА)
   ============================================ */
.content-section {
    position: relative;
    padding: 100px 0;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.content-section:nth-child(even) {
    background-color: #fafafa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: #333333;
    margin: 0;
    line-height: 1.2;
    position: relative;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-title.section-visible {
    opacity: 1;
    transform: translateX(0);
}

.section-desc {
    font-size: 1rem;
    color: #4e4e4e;
    max-width: 700px;
    margin: 0;
    line-height: 1.6;
    text-align: right;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.quote-text {
    text-align: justify;
    /* Выравнивание по ширине */
    font-style: italic;
    /* Курсив для цитаты */
    font-size: 1rem;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
    word-spacing: 1px;
}

.quote-author {
    text-align: right;
    /* Выравнивание вправо */
    font-size: 0.85rem;
    color: #999999;
    margin-top: 5px;
    font-style: normal;
    /* Обычный шрифт для автора */
    border-bottom: 1px dotted #cccccc;
    /* Тонкая линия для отделения (опционально) */
    padding-bottom: 5px;
}

.section-desc.section-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   КАРУСЕЛЬ (С ФИКСИРОВАННЫМ КОЛИЧЕСТВОМ КАРТОЧЕК)
   ============================================ */
.cards-carousel-container {
    position: relative;
    width: 100%;
    margin: 30px auto 50px;
    overflow: visible;
}

.cards-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 5px 20px;
    scrollbar-width: thin;
    scrollbar-color: #cccccc #f5f5f5;
}

.cards-carousel::-webkit-scrollbar {
    height: 6px;
}

.cards-carousel::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.cards-carousel::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 10px;
}

.carousel-card {
    flex: 0 0 300px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eeeeee;
    transition: all 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.carousel-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
}

.carousel-card h3 a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.carousel-card h3 a:hover {
    color: #000000;
}

.carousel-card p {
    color: #666666;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.carousel-card .card-meta {
    margin-bottom: 8px;
}

.carousel-card .card-date {
    font-size: 0.75rem;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-link {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: transform 0.3s ease;
    border-bottom: 1px solid transparent;
}

.card-link:hover {
    transform: translateX(5px);
    border-bottom-color: #333333;
}

/* Стрелки навигации */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #eeeeee;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .carousel-nav {
        display: flex;
    }
}

.carousel-nav:hover {
    background: #333333;
    color: white;
    border-color: #333333;
}

.carousel-prev {
    left: -20px;
}

.carousel-next {
    right: -20px;
}

/* Индикаторы для мобильных */
.carousel-indicators {
    display: none;
}

@media (max-width: 767px) {
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 15px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #cccccc;
        transition: all 0.3s ease;
    }

    .carousel-indicator.active {
        background: #333333;
        width: 20px;
        border-radius: 10px;
    }

    .carousel-nav {
        display: none;
    }

    .quote-text {
        text-align: left;
        /* На мобильных justify может быть неудобен */
        font-size: 0.95rem;
    }

    .quote-author {
        text-align: left;
    }
}

/* Футер секции */
.section-footer {
    margin-top: 30px;
    text-align: center;
}

.section-link {
    color: #333333;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 24px;
    border: 1px solid #cccccc;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(255, 255, 255, 0.5);
}

.section-link:hover {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

/* ============================================
   СТИЛИ ДЛЯ БЛОГА (ВОССТАНОВЛЕНО)
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.category-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.category-card h3 {
    margin-bottom: 15px;
    color: #333;
}

.category-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.category-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.category-link:hover {
    color: #0056b3;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    font-size: 4rem;
    opacity: 0.8;
}

.blog-card-content {
    padding: 25px;
}

.blog-card-content h3 {
    margin-bottom: 15px;
}

.blog-card-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-content h3 a:hover {
    color: #007bff;
}

.blog-card-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #999;
}

.blog-meta .category {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.text-center {
    text-align: center;
}

/* ============================================
   СТИЛИ ДЛЯ КОНТЕНТА (MathJax, Mermaid, изображения)
   ============================================ */
/* Защита от выделения */
.blog-post-content {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Разрешаем выделение только внутри кода (если нужно) */
.blog-post-content pre,
.blog-post-content code {
    user-select: text;
    -webkit-user-select: text;
}

/* Стиль для режима чтения (если нужно что-то скрыть) */
.blog-post-content.reading-mode {
    opacity: 0.8;
}

/* Запрет печати */
@media print {
    .blog-post-content {
        display: none !important;
    }
    
    .watermark {
        display: block !important;
    }
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
}

.blog-post-content img[data-align="left"] {
    float: left;
    margin: 0 20px 20px 0;
}

.blog-post-content img[data-align="right"] {
    float: right;
    margin: 0 0 20px 20px;
}

.blog-post-content img[data-align="center"] {
    display: block;
    margin: 20px auto;
}

.blog-post-content:after {
    content: "";
    display: table;
    clear: both;
}

.blog-post-content pre[class*="language-"] {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

/* Принудительное применение стилей к контенту */
#postContent,
.blog-post-content {
    transition: font-size 0.2s ease;
}

#postContent *,
.blog-post-content * {
    font-size: inherit !important;
}

/* Стили для MathJax формул */
.mjx-chtml {
    padding: 10px 0;
}

/* Стили для Mermaid диаграмм */
.mermaid {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ КАРУСЕЛИ (3 КАРТОЧКИ)
   ============================================ */
@media (min-width: 1200px) {
    .cards-carousel-container {
        max-width: 940px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .cards-carousel-container {
        max-width: 860px;
    }

    .carousel-card {
        flex: 0 0 280px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .cards-carousel-container {
        max-width: 780px;
    }

    .carousel-card {
        flex: 0 0 260px;
    }

    .cards-carousel {
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .cards-carousel-container {
        max-width: 100%;
    }

    .carousel-card {
        flex: 0 0 260px;
    }
}

@media (max-width: 480px) {
    .carousel-card {
        flex: 0 0 240px;
    }
}

/* ============================================
   ФУТЕР
   ============================================ */
footer {
    background-color: #E9EAED;
    border-top: 1px solid #333;
    color: #333;
    padding: 20px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 10px;
}

.footer-column h3 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 12px;
}

.footer-link {
    color: #333;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    display: inline-block;
    padding-bottom: 5px;
}

.text_in_center {
    text-align: center !important;
}

.text_to_left {
    text-align: left !important;
}

.text_to_right {
    text-align: right !important;
}

.social-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
}

.social-icon {
    width: auto;
    height: 15px;
    display: block;
}

.social-links span {
    line-height: 1;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #D5D5D5;
    color: #333;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.footer-botton-column p {
    color: #333;
    margin-bottom: 10px;
    font-size: 11px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.tab-btn.active {
    color: #000;
    border-bottom: 2px solid #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.form-messages {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.form-messages.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-messages.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
   ============================================ */
@media (max-width: 1024px) {
    .mega-menu-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {

    .nav-menu,
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .menu-toggle {
        display: block;
    }

    .mega-menu-wrapper {
        display: none;
    }

    .section-header {
        flex-direction: column;
        gap: 20px;
    }

    .section-title {
        font-size: 2.2rem;
        transform: translateY(-30px);
    }

    .section-desc {
        text-align: left;
        max-width: 100%;
        transform: translateY(30px);
    }

    .section-title.section-visible,
    .section-desc.section-visible {
        transform: translateY(0);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }

    .section-intro {
        font-size: 1rem;
    }
}

.pulse-title {
    background-image: url('../images/pulse.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 40px 40px;
    padding-left: 50px;
    /* чтобы текст не налезал на иконку */
}

.discourse-title {
    background-image: url('../images/discourse.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 40px 40px;
    padding-left: 50px;
    /* чтобы текст не налезал на иконку */
}

.meaninigs-title {
    background-image: url('../images/meanings.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 40px 40px;
    padding-left: 50px;
    /* чтобы текст не налезал на иконку */
}

.solutions-title {
    background-image: url('../images/solutions.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 40px 40px;
    padding-left: 50px;
    /* чтобы текст не налезал на иконку */
}

.technics-title {
    background-image: url('../images/tools.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 40px 40px;
    padding-left: 50px;
    /* чтобы текст не налезал на иконку */
}

/* ============================================
   СТРАНИЦА "О ПРОЕКТЕ" (ЛИПКАЯ ЛЕВАЯ КОЛОНКА)
   ============================================ */

/* Герой-секция страницы */
.page-hero {
    padding: 120px 0 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    text-align: center;
    margin-top: 70px;
}

.page-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 15px;
    color: #333;
    letter-spacing: 4px;
}

.page-title-decoration {
    width: 80px;
    height: 2px;
    background: #cccccc;
    margin: 0 auto;
}

/* Основная секция */
.about-section {
    padding: 60px 0 80px;
    background-color: #ffffff;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Левая колонка 1 часть, правая 2 части */
    gap: 50px;
    align-items: start;
    /* Важно для sticky */
}

/* Левая колонка с фото - ЛИПКАЯ */
.sticky-column {
    position: sticky;
    top: 90px;
    /* Отступ от верхнего края при скролле (учитываем высоту шапки) */
    align-self: start;
}

/* Правая колонка с текстом - СКРОЛЛИТСЯ */
.scrollable-column {
    max-height: calc(100vh - 150px);
    /* Ограничиваем высоту, чтобы появился скролл */
    overflow-y: auto;
    /* Включаем вертикальный скролл */
    padding-right: 20px;
    /* Отступ для скроллбара */
    scrollbar-width: thin;
    scrollbar-color: #cccccc #f5f5f5;
}

/* Стилизация скроллбара для WebKit (Chrome, Safari) */
.scrollable-column::-webkit-scrollbar {
    width: 6px;
}

.scrollable-column::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.scrollable-column::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 10px;
}

.scrollable-column::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* Оформление фото (без изменений) */
.image-frame {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.profile-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.image-frame:hover .profile-image {
    transform: scale(1.02);
}

/* Декоративная рамка */
.image-frame::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
    pointer-events: none;
    border-radius: 8px;
}

.image-caption {
    margin-top: 20px;
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Правая колонка с текстом */
.about-text-column {
    padding-right: 10px;
}

.about-name {
    font-size: 1.5rem;
    font-weight: 550;
    margin-bottom: 5px;
    margin-top: 5px;
    color: #333;
    text-align: center;
}

.about-role {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eeeeee;
}

.about-description {
    color: #444;
    line-height: 1.8;
}

.lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.7;
}

.about-description p {
    margin-bottom: 20px;
}

.about-description h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 35px 0 20px;
    color: #333;
    letter-spacing: 1px;
}

.about-list {
    list-style: none;
    margin: 25px 0;
}

.about-list li {
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.about-list li::before {
    content: '•';
    position: absolute;
    left: 5px;
    color: #999;
    font-size: 1.2rem;
}

.about-list strong {
    color: #333;
    font-weight: 600;
}

.about-quote {
    font-style: italic;
    color: #666;
    padding: 20px 0 20px 30px;
    border-left: 3px solid #cccccc;
    margin: 30px 0;
}

.about-signature {
    margin-top: 40px;
    text-align: right;
    font-family: Georgia, serif;
}

.signature-name {
    font-size: 1.1rem;
    font-style: italic;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.signature-date {
    font-size: 0.9rem;
    color: #999;
}

/* Адаптивность */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr 1.5fr;
        gap: 30px;
    }

    .about-name {
        font-size: 1.5rem;
        font-weight: 550;
        margin-bottom: 5px;
        margin-top: 5px;
        color: #333;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* На мобильных отключаем sticky и независимый скролл */
    .sticky-column {
        position: static;
    }

    .scrollable-column {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .about-image-column {
        max-width: 400px;
        margin: 0 auto;
    }

    .about-text-column {
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }

    .about-name {
        font-size: 1.8rem;
    }

    .lead {
        font-size: 1.1rem;
    }
}

/* Вариант 2: Всплывающие подсказки */
.footnote-hint {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #f0f0f0;
    color: #666;
    border-radius: 50%;
    font-size: 0.7rem;
    text-align: center;
    line-height: 16px;
    cursor: help;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.footnote-hint:hover {
    background: #333;
    color: #fff;
}

/* ============================================
   СТРАНИЦЫ РАЗДЕЛОВ (НОВЫЙ ДИЗАЙН)
   ============================================ */

/* Двухколоночный макет */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    /* Посты занимают оставшееся место, фильтры 300px */
    gap: 40px;
    margin-top: 40px;
}

/* Левая колонка с постами */
.posts-column {
    min-width: 0;
    /* Для корректного сжатия */
}

/* Правая колонка с фильтрами */
.filters-column {
    position: relative;
}

.filters-sticky {
    position: sticky;
    top: 90px;
    /* Отступ от шапки */
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
}

.filters-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.filter-block {
    margin-bottom: 25px;
}

.filter-block-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: color 0.3s ease;
}

.filter-radio:hover {
    color: #333;
}

.filter-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #333;
}

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

.filter-tag {
    padding: 5px 12px;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.filter-tag.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.filter-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.filter-reset {
    display: inline-block;
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.filter-reset:hover {
    color: #333;
}

/* Стили для списка постов */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    display: flex;
    height: 180px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: #ddd;
}

.post-item-image {
    flex: 0 0 180px;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
}

.post-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-item:hover .post-item-image img {
    transform: scale(1.05);
}

.post-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

.post-item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    word-wrap: break-word;
}

.post-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #999;
}

.post-item-meta i {
    margin-right: 3px;
    font-size: 0.75rem;
}

.post-item-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item-title a:hover {
    color: #000;
}

.post-item-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    max-width: 100%;
    overflow: hidden;
}

.post-item-tag {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    transition: background 0.3s ease;
}

.post-item-tag:hover {
    background: #333;
    color: #fff;
}

.post-item-tag-more {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #999;
    font-size: 0.75rem;
    cursor: help;
}

.post-item-read-more {
    align-self: flex-start;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.3s ease;
    margin-top: auto;
}

.post-item-read-more:hover {
    transform: translateX(5px);
}

/* Стили для даты и мета-информации */
.post-item-date {
    font-size: 0.8rem;
    color: #565656;
}

.post-views, .post-comments {
    font-size: 0.8rem;
    color: #999;
    margin-left: 10px;
}

.post-views i, .post-comments i {
    margin-right: 3px;
}

/* Пагинация */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 30px;
}

.pagination-prev,
.pagination-next {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    color: #000;
}

.pagination-current {
    color: #666;
    font-size: 0.9rem;
}

.no-posts {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 50px 0;
}

/* Адаптивность */
@media (max-width: 992px) {
    .content-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .filters-sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    .post-item {
        flex-direction: column;
        height: auto;
    }

    .post-item-image {
        flex: 0 0 200px;
        width: 100%;
        height: 200px;
    }

    .post-item-content {
        padding: 15px;
    }

    .pagination-nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* Отступ для основного контента, чтобы не перекрывался шапкой */
main {
    padding-top: 10px;
    /* Высота вашей шапки */
    min-height: calc(100vh - 70px - 200px);
    /* 70px - шапка, 200px - примерная высота футера */
}

/* Для страниц с пагинацией и фильтрами */
.section-content {
    padding: 30px 0 60px;
}

/* Структура страницы для прижатого футера */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Шапка фиксированная, её не включаем во flex-контейнер */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* остальные стили шапки остаются */
}

/* Основной контент занимает всё доступное место */
main {
    flex: 1 0 auto;
    margin-top: 10px;
    /* Высота шапки */
    padding-bottom: 40px;
}

/* Футер всегда внизу */
footer {
    flex-shrink: 0;
    width: 100%;
    background-color: #E9EAED;
    border-top: 1px solid #333;
    color: #333;
    padding: 20px 0;
}

/* Облако тегов в правой колонке */
.filter-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    position: relative;
    padding: 5px 12px;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tag:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.filter-tag.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.tag-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================
   УЛУЧШЕННЫЙ ФИЛЬТР ТЕГОВ
   ============================================ */

.tag-selector {
    margin-bottom: 15px;
}

.tag-multiselect {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.9rem;
    color: #333;
    min-height: 120px;
}

.tag-multiselect option {
    padding: 4px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.tag-multiselect option:checked {
    background: #333 linear-gradient(0deg, #333 0%, #333 100%);
    color: #fff;
}

.select-hint {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

/* Мини-облако выбранных тегов */
.selected-tags-cloud {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.selected-tags-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

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

.selected-tag-item {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 2px 2px 2px 10px;
    font-size: 0.8rem;
    color: #333;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.selected-tag-item:hover {
    background: #e5e5e5;
}

.selected-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ccc;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    margin-right: 6px;
    transition: background 0.2s ease;
}

.selected-tag-remove:hover {
    background: #ff4444;
    color: #fff;
}

.selected-tag-name {
    padding-right: 8px;
}

/* Кнопка применения */
.filter-apply {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-right: 10px;
}

.filter-apply:hover {
    background: #000;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================
   POST DETAIL
   ============================================ */

/* Полный пост */
.post-full {
    padding-top: 5px !important;
    max-width: 800px;
    margin: 0 auto;
}

.post-full-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.post-full-title {
    font-size: 1.8rem;
    font-weight: 550;
    line-height: 1.3;
    margin: 15px 0 15px;
    color: #333;
}

.post-full-excerpt {
    font-size: 1rem;
	line-height: 1.3;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #333;
}

.post-full-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 10px;
}

.post-full-category {
    font-size: 0.9rem;
    color: #999;
}

.post-full-category a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.post-full-category a:hover {
    border-bottom-color: #333;
}

.post-full-content {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

.post-full-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    margin: 20px 0 20px;
}

.post-full-content h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 30px 0 15px;
}

.post-full-content p {
    margin-bottom: 20px;
}

.post-full-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.post-full-content blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: #f8f9fa;
    border-left: 4px solid #333;
    font-style: italic;
    color: #555;
}

.post-full-content pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

/* Похожие посты в правой колонке */
.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.related-post-item {
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-meta {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 5px;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.4;
}

.related-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: #000;
}

.related-post-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.related-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.related-post-tag {
    padding: 2px 6px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.7rem;
    transition: background 0.3s ease;
}

.related-post-tag:hover {
    background: #333;
    color: #fff;
}

.related-post-tag-more {
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #999;
    font-size: 0.7rem;
}

.no-related {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .post-full-title {
        font-size: 2rem;
    }

    .post-full-excerpt {
        font-size: 1rem;
    }

    .post-full-content {
        font-size: 1rem;
    }
}

.section-header-simple {
    margin-bottom: 40px;
}

.section-title-simple {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    color: #333;
}

.section-desc-simple {
    font-size: 1rem;
    color: #666;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================
   ССЫЛКИ НА ТЕГИ В POST_DETAIL
   ============================================ */

.filter-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.filter-block-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tags-links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tag-link-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tag-link-block i {
    color: #666;
    font-size: 0.8rem;
}

.tag-link-block:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.tag-link-block:hover i {
    color: #fff;
}

.no-related {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 15px 0;
}

/* ============================================
   ТИЗЕР ДЛЯ НЕЗАРЕГИСТРИРОВАННЫХ
   ============================================ */

/* Контейнер для тизера */
.teaser-content {
    position: relative;
    max-height: 500px;
    overflow: hidden;
    margin-bottom: 0;
}

/* Размытие и градиентное затемнение */
.blur-overlay {
    position: relative;
    height: 120px;
    margin-top: -120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
    z-index: 2;
}

/* Панель регистрации */
.registration-prompt {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #eee;
    position: relative;
    z-index: 3;
}

.prompt-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.prompt-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.prompt-link:hover {
    text-decoration: underline;
}

.prompt-subtext {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 25px;
}

.prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.prompt-buttons .cta-button {
    background: #333;
    color: #fff;
    padding: 10px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.prompt-buttons .cta-button:hover {
    background: #000;
    transform: translateY(-2px);
}

.prompt-buttons .cta-secondary {
    background: transparent;
    border: 1px solid #333;
    color: #333;
}

.prompt-buttons .cta-secondary:hover {
    background: #333;
    color: #fff;
}

/* Адаптивность */
@media (max-width: 768px) {
    .prompt-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .prompt-text {
        font-size: 1rem;
    }
}

.restricted-content {
    text-align: center;
    padding: 60px 40px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

.restricted-message i {
    font-size: 3rem;
    color: #999;
    margin-bottom: 20px;
    display: block;
}

.restricted-message p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

/* Горизонтальный скроллинг для графиков */
.chart-block {
    margin: 30px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.chart-scroll-container {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
}

.chart-caption {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

.chart-caption-icon {
    margin-right: 8px;
    opacity: 0.7;
}

.chart-caption-text {
    letter-spacing: 0.3px;
}

.chart-caption-desc {
    color: #888;
    font-size: 0.8rem;
    margin-left: 8px;
    font-style: normal;
}

/* Стилизация скроллбара (опционально) */
.chart-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.chart-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chart-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chart-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chart-error {
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    color: #999;
}

.chart-caption-trend {
    margin-left: 8px;
    font-size: 0.75rem;
    color: #ff4444;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .chart-scroll-container canvas {
        min-width: 600px;  /* На мобильных можно сделать чуть уже */
		height: auto !important;
    }
}

.post-meta-separator,
.post-item-separator {
    color: #565656;
    margin: 0 4px;
}

.post-author,
.post-item-author {
    font-weight: 500;
    color: #565656;
}
.post-full-content table {
    margin: 1em auto;
    display: table;
    border-collapse: collapse;
}

.post-full-content table td,
.post-full-content table th {
    border: 1px solid hsl(0, 0%, 80%);
    padding: 0.4em;
    vertical-align: top;
    border-collapse: collapse;
}

/* Стили подписи, как в редакторе */
.post-full-content figure.table,
.blog-post-content figure.table {
    margin: 1em auto;
    display: table;
}

.post-full-content figure.table figcaption,
.blog-post-content figure.table figcaption {
    display: table-caption;
    caption-side: top;
    text-align: center;
    margin: 0.5em 0;
    font-style: italic;
    color: #666;
}

/* ============================================
   КНОПКИ УПРАВЛЕНИЯ РАЗМЕРОМ ШРИФТА
   ============================================ */

.font-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.font-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.font-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.font-decrease {
    font-size: 12px;
}

.font-increase {
    font-size: 16px;
}

.font-reset {
    font-weight: bold;
}

@media (max-width: 768px) {
    .font-controls {
        justify-content: center;
    }

    .font-btn {
        padding: 8px 16px;
        font-size: 16px;
    }
}

.font-size-small {
    font-size: 0.85rem !important;
}

.font-size-normal {
    font-size: 1rem !important;
}

.font-size-large {
    font-size: 1.2rem !important;
}

/* Наследование для всех вложенных элементов */
.font-size-small *,
.font-size-normal *,
.font-size-large * {
    font-size: inherit !important;
}

/* ============================================
   ВЫРАВНИВАНИЕ ИЗОБРАЖЕНИЙ (СТАНДАРТНЫЕ КЛАССЫ CKEDITOR)
   ============================================ */

/* Для изображений с подписью (figure) */
figure.image-style-align-left {
    float: left !important;
    margin-right: 20px !important;
    margin-bottom: 10px !important;
}

figure.image-style-align-right {
    float: right !important;
    margin-left: 20px !important;
    margin-bottom: 10px !important;
}

/* Для изображений без подписи */
img.image-style-align-left {
    float: left !important;
    margin-right: 20px !important;
    margin-bottom: 10px !important;
}

img.image-style-align-right {
    float: right !important;
    margin-left: 20px !important;
    margin-bottom: 10px !important;
}

/* Для центрирования */
figure.image-style-align-center,
img.image-style-align-center {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

/* Очистка обтекания после изображений */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Чтобы изображения не выходили за пределы контейнера */
.post-full-content figure.image,
.blog-post-content figure.image {
    max-width: 100%;
}

.post-full-content figure.image img,
.blog-post-content figure.image img {
    max-width: 100%;
    height: auto;
}

/* Отступы для текста после изображения */
.post-full-content figure.image-style-align-left+p,
.blog-post-content figure.image-style-align-left+p {
    margin-top: 0;
}

/* Основной контейнер формулы */
mjx-container {
    font-size: 1.5em !important;
    /* Увеличиваем все формулы */
    display: inline-block;
    margin: 0.1em 0.2em;
}

/* Выключные формулы (отображаются отдельной строкой) */
mjx-container[display="block"] {
    font-size: 2em !important;
    /* Ещё крупнее для выключных */
    margin: 2em 0 !important;
    text-align: center;
}

/* Дроби */
mjx-container mjx-mfrac {
    font-size: 1.2em !important;
}

/* Корни */
mjx-container mjx-sqrt {
    font-size: 1.2em !important;
}

/* Индексы и степени */
mjx-container mjx-msup,
mjx-container mjx-msub {
    font-size: 1.1em !important;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    mjx-container[display="block"] {
        font-size: 1.5em !important;
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
        padding: 0.5em 0;
    }
}

/* Принудительное применение для всех mjx-container */
.post-full-content mjx-container,
.blog-post-content mjx-container,
#postContent mjx-container {
    font-size: 1.5em !important;
}

.post-full-content mjx-container[display="block"],
.blog-post-content mjx-container[display="block"],
#postContent mjx-container[display="block"] {
    font-size: 2em !important;
}

/* Индексы — уменьшены (работает с mjx-texatom) */
.post-full-content mjx-container mjx-msub mjx-texatom,
.post-full-content mjx-container mjx-msup mjx-texatom,
.post-full-content mjx-container mjx-msubsup mjx-texatom {
    font-size: 0.7em !important;
}

/* Запасной вариант: последний дочерний элемент в mjx-msub */
.post-full-content mjx-container mjx-msub>*:last-child,
.post-full-content mjx-container mjx-msup>*:last-child,
.post-full-content mjx-container mjx-msubsup>*:last-child {
    font-size: 0.7em !important;
}

/* Стиль для бейджа типа инструмента в карточке */
.tool-type-badge {
    background: #3f2b96;
    color: white;
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 10px;
    display: inline-block;
}

/* Стили для таблицы агентов */
#agentsTable {
    font-size: 0.85rem;
}

#agentsTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

#agentsTable tbody tr:hover {
    background: #e9ecef !important;
}

#agentsTable tbody tr td {
    border-bottom: 1px solid #dee2e6;
}

/* Стили для скроллбара */
#agentsTable~div::-webkit-scrollbar {
    width: 6px;
}

#agentsTable~div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#agentsTable~div::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#agentsTable~div::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}