/* База знаний — лента статей и страница статьи */

.knowledge-page {
    padding-bottom: 60px;
}

/* Навигация */
.knowledge-nav {
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.1s;
}

.knowledge-nav .back-btn,
.article-detail-page .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #77F601;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.knowledge-nav .back-btn:hover,
.article-detail-page .back-btn:hover {
    color: rgba(255, 255, 255, 0.95);
}

.knowledge-nav .back-btn svg,
.article-detail-page .back-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Заголовок секции */
.knowledge-header {
    text-align: center;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.15s;
}

.knowledge-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.knowledge-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Фильтр категорий */
.knowledge-filters {
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.2s;
}

.knowledge-filters-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.knowledge-filter-btn {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.knowledge-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(119, 246, 1, 0.3);
}

.knowledge-filter-btn.active {
    background: linear-gradient(45deg, rgba(119, 246, 1, 0.2), rgba(196, 0, 251, 0.15));
    border-color: rgba(119, 246, 1, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(119, 246, 1, 0.2);
}

/* Лента статей */
.knowledge-feed {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.25s;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(119, 246, 1, 0.35);
    box-shadow: 0 12px 40px rgba(119, 246, 1, 0.15);
}

.article-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    position: relative;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.03);
}

.article-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.25);
}

.article-card-placeholder svg {
    opacity: 0.6;
}

.article-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #77F601;
    margin-bottom: 8px;
}

.article-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-excerpt {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.45;
    margin: 0 0 12px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Пустое состояние */
.knowledge-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.knowledge-empty p {
    margin: 0 0 16px 0;
    font-size: 1rem;
}

.knowledge-empty-link {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: #77F601;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.knowledge-empty-link:hover {
    color: #ffffff;
}

/* Похожие статьи */
.similar-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.similar-articles-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.similar-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.article-detail-page .similar-articles-grid .article-card-title {
    -webkit-line-clamp: 2;
}

/* Футер-ссылки */
.knowledge-footer-link {
    text-align: center;
    padding: 40px 20px 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.knowledge-footer-link a {
    color: #77F601;
    text-decoration: none;
}

.knowledge-footer-link a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* --- Страница статьи --- */
.article-detail-page .page-nav {
    display: flex;
    align-items: center;
    padding: 24px 0 28px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.article-detail-page .nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.article-detail-page .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

.article-detail-page .breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.article-detail-page .breadcrumb a:hover {
    color: #77F601;
}

.article-detail-page .breadcrumb span:last-child {
    color: #ffffff;
    font-weight: 600;
}

/* Контент статьи */
.article-detail {
    max-width: 720px;
    margin: 0 auto 60px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.15s;
}

.article-detail-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid rgba(119, 246, 1, 0.2);
}

.article-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-detail-header {
    margin-bottom: 24px;
}

.article-detail-date {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.article-detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #77F601;
    margin: 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.article-detail-content-wrap {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.article-detail-content {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.article-detail-content br {
    display: block;
    content: "";
    margin-top: 0.5em;
}

.article-detail-content p {
    margin: 0 0 1em 0;
}

.article-detail-content p:last-child {
    margin-bottom: 0;
}

/* HTML-контент из редактора (списки, ссылки, изображения) */
.article-detail-content-html ul,
.article-detail-content-html ol {
    margin: 0 0 1em 0;
    padding-left: 1.5em;
}

.article-detail-content-html li {
    margin-bottom: 0.5em;
}

.article-detail-content-html a {
    color: #77F601;
    text-decoration: none;
}

.article-detail-content-html a:hover {
    text-decoration: underline;
}

.article-detail-content-html img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em 0;
    display: block;
    border: 1px solid rgba(119, 246, 1, 0.2);
}

.article-detail-content-html strong {
    font-weight: 700;
}

.article-detail-content-html em {
    font-style: italic;
}

/* Карточки услуг в статье */
.article-service-links {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.article-service-links-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 18px 0;
}

.article-service-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-service-card {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.article-service-card__img-wrap {
    flex-shrink: 0;
    width: 100px;
    min-height: 72px;
    background: rgba(0, 0, 0, 0.3);
}

.article-service-card__img-wrap img {
    width: 100%;
    height: 100%;
    min-height: 72px;
    object-fit: cover;
    display: block;
}

.article-service-card__placeholder {
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.25);
}

.article-service-card__placeholder svg {
    opacity: 0.6;
}

.article-service-card__body {
    flex: 1;
    min-width: 0;
}

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

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-card-image {
        height: 140px;
    }

    .article-detail-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .knowledge-filters-wrap {
        gap: 6px;
    }

    .knowledge-filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .article-card-body {
        padding: 14px 16px 16px;
    }
}
