/* Стили для шаблона статьи /articles/article.php */
/* Используем классы Bootstrap 5 там, где это возможно */

/* ===== Автор статьи ===== */
.author-block .card-body {
    padding: 1rem;
}

.author-block img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
}

.author-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.author-name:hover {
    color: #0d6efd;
}

/* ===== Содержание статьи ===== */
.toc-block .card-body {
    padding: 1.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* ===== Контент статьи ===== */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #333;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content .table {
    font-size: 0.9375rem;
}

.article-content .alert {
    font-size: 0.9375rem;
    border-radius: 6px;
}

.article-content .card {
    font-size: 0.9375rem;
    border-radius: 6px;
}

/* ===== Аудио кнопка ===== */
.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e7f1ff;
    color: #0d6efd;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.audio-btn:hover {
    background: #0d6efd;
    color: #fff;
}

/* ===== Сайдбар ===== */
.article-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-block .card-body {
    padding: 1.25rem;
}

/* ===== Плитка рубрик ===== */
.rubrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.rubric-tag {
    display: block;
    padding: 0.5rem 0.75rem;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
}

.rubric-tag:hover {
    background: #0d6efd;
    color: #fff;
}

.rubric-tag.active {
    background: #0d6efd;
    color: #fff;
}

/* ===== Список статей рубрики ===== */
.rubric-articles {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.rubric-articles.active {
    display: block;
}

.rubric-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rubric-articles li {
    margin-bottom: 0.5rem;
}

.rubric-articles a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
}

.rubric-articles a:hover {
    text-decoration: underline;
}

/* ===== Скрываем голубой сайдбар в контенте статьи ===== */
.sidebar.bg-info.bg-opacity-25 {
    display: none !important;
}

/* ===== Адаптив для планшетов ===== */
@media (max-width: 991px) {
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .rubrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Адаптив для мобильных ===== */
@media (max-width: 768px) {
    .author-block .card-body {
        flex-direction: column;
        text-align: center;
    }
    
    .toc-list {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.25rem;
    }
    
    .article-content h3 {
        font-size: 1.125rem;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 1rem;
        font-size: 0.9375rem;
    }
    
    .article-content li {
        margin-bottom: 0.375rem;
    }
    
    .article-content .table {
        font-size: 0.8125rem;
    }
    
    .article-content .alert,
    .article-content .card {
        font-size: 0.875rem;
    }
    
    .rubrics-grid {
        grid-template-columns: 1fr;
    }
}
