/* Стили для базы знаний */

/* Общие стили */
.knowledge-container {
    background: white;
    border: 6px solid var(--cartoon-secondary);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 0 var(--cartoon-dark);
    position: relative;
    overflow: hidden;
}

.knowledge-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px dashed var(--cartoon-accent);
    border-radius: 18px;
    pointer-events: none;
    z-index: -1;
}

/* Заголовок базы знаний */
#knowledge-index h1 {
    color: var(--cartoon-primary);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 var(--cartoon-shadow);
}

#knowledge-index p {
    text-align: center;
    font-size: 1.2rem;
    color: var(--cartoon-dark);
    margin-bottom: 40px;
}

/* Категории */
.knowledge-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.knowledge-category {
    background: white;
    border: 4px solid var(--cartoon-secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 0 var(--cartoon-dark);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.knowledge-category::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed var(--cartoon-accent);
    border-radius: 14px;
    pointer-events: none;
    z-index: -1;
}

.knowledge-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 var(--cartoon-dark);
}

.knowledge-category h3 {
    color: var(--cartoon-primary);
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.knowledge-category h3 a {
    color: var(--cartoon-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.knowledge-category h3 a:hover {
    color: var(--cartoon-dark);
}

.knowledge-category p {
    color: #666;
    margin: 0;
}

/* Статьи */
.knowledge-articles {
    margin: 30px 0;
}

.knowledge-article {
    display: flex;
    margin-bottom: 30px;
    background: white;
    border: 4px solid var(--cartoon-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 0 var(--cartoon-dark);
    transition: all 0.2s ease;
    position: relative;
}

.knowledge-article::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed var(--cartoon-accent);
    border-radius: 14px;
    pointer-events: none;
    z-index: -1;
}

.knowledge-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 var(--cartoon-dark);
}

.article-image {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-right: 3px solid var(--cartoon-secondary);
}

.article-content {
    flex: 1;
    padding: 20px;
}

.article-content h3 {
    margin: 0 0 15px 0;
}

.article-content h3 a {
    color: var(--cartoon-dark);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
    transition: color 0.2s ease;
}

.article-content h3 a:hover {
    color: var(--cartoon-primary);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta .category {
    font-weight: bold;
    color: var(--cartoon-secondary);
}

.article-meta .category a {
    color: var(--cartoon-secondary);
    text-decoration: none;
}

.article-meta .category a:hover {
    text-decoration: underline;
}

.article-excerpt {
    margin: 0;
    line-height: 1.6;
    color: var(--cartoon-dark);
}

/* Полная статья */
.knowledge-article-full {
    background: white;
    border: 6px solid var(--cartoon-secondary);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 0 var(--cartoon-dark);
    position: relative;
    overflow: hidden;
}

.knowledge-article-full::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px dashed var(--cartoon-accent);
    border-radius: 18px;
    pointer-events: none;
    z-index: -1;
}

.knowledge-article-full h1 {
    color: var(--cartoon-primary);
    margin-bottom: 20px;
    text-align: center;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--cartoon-accent);
    font-size: 0.9rem;
    color: #666;
}

.article-meta .category {
    font-weight: bold;
    color: var(--cartoon-secondary);
}

.article-meta .category a {
    color: var(--cartoon-secondary);
    text-decoration: none;
}

.article-meta .category a:hover {
    text-decoration: underline;
}

.article-image-full {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border: 3px solid var(--cartoon-secondary);
    border-radius: 10px;
    margin: 20px 0;
    display: block;
}

.article-content {
    line-height: 1.8;
    color: var(--cartoon-dark);
    font-size: 1.1rem;
}

.article-content p {
    margin: 15px 0;
}

.article-content h2, .article-content h3, .article-content h4 {
    color: var(--cartoon-primary);
    margin: 25px 0 15px 0;
    border-bottom: 2px solid var(--cartoon-secondary);
    padding-bottom: 5px;
}

/* Теги */
.knowledge-tags {
    margin: 20px 0;
    padding: 10px;
    background: var(--cartoon-light);
    border: 3px solid var(--cartoon-accent);
    border-radius: 10px;
    display: inline-block;
}

.knowledge-tags strong {
    margin-right: 10px;
    color: var(--cartoon-primary);
}

.knowledge-tags .tag {
    display: inline-block;
    background: var(--cartoon-secondary);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    margin: 0 5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.knowledge-tags .tag:hover {
    background: var(--cartoon-primary);
    transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .knowledge-article {
        flex-direction: column;
    }
    
    .article-image {
        width: 100%;
        height: 200px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .article-meta .date, .article-meta .views {
        display: inline;
    }
}