/* Knowledge Base Styles - Based on Main Site Design System */

/* CSS Custom Properties from Main Site */
:root {
    --primary-color: #51B316;
    --secondary-color: #2B463C;
    --accent-color: #688F4E;
    --light-accent: #B1D182;
    --text-color: #2B463C;
    --light-text: #688F4E;
    --background-color: #ffffff;
    --light-background: #F4F1E9;
    --border-color: #e0e0e0;
    --success-color: #51B316;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-background);
}

/* Typography - Following Main Site Pattern */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', sans-serif;
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Knowledge Base Container */
.kb-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--background-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* Header Styling */
.kb-header {
    border-bottom: 2px solid var(--light-accent);
    padding-bottom: 30px;
    margin-bottom: 40px;
    text-align: center;
}

.kb-header h1 {
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
}

.kb-header h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.kb-header a {
    color: inherit;
}

.kb-header p {
    color: var(--light-text);
    font-size: 1.1rem;
    margin-top: 20px;
}

/* Post List Styling */
.kb-post-list {
    list-style: none;
}

.kb-post-list li {
    margin-bottom: 30px;
    padding: 25px;
    background-color: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-left: 4px solid var(--light-accent);
}

.kb-post-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    border-left-color: var(--primary-color);
}

.kb-post-list h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.kb-post-list a {
    color: var(--secondary-color);
    font-weight: 600;
}

.kb-post-list a:hover {
    color: var(--primary-color);
}

.kb-post-meta {
    font-size: 0.9rem;
    color: var(--light-text);
    font-weight: 500;
}

/* Individual Post Styling */
.kb-post h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.kb-post-content {
    margin-top: 30px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.kb-post-content h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 10px;
}

.kb-post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

.kb-post-content h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.kb-post-content p {
    margin-bottom: 1.2rem;
}

.kb-post-content ul, .kb-post-content ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

.kb-post-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Code Styling */
.kb-post-content code {
    background-color: var(--light-background);
    color: var(--secondary-color);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.kb-post-content pre {
    background-color: var(--secondary-color);
    color: #f1f1f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid var(--primary-color);
}

.kb-post-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.95em;
}

/* Images */
.kb-content img,
.kb-post-content img {
    max-width: 70%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 30px auto;
    display: block;
}

/* Mobile responsive for images */
@media (max-width: 768px) {
    .kb-content img,
    .kb-post-content img {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .kb-content img,
    .kb-post-content img {
        max-width: 100%;
    }
}

/* Blockquotes */
.kb-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 20px 0;
    background-color: var(--light-background);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--accent-color);
}

/* Footer */
.kb-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--light-accent);
    font-size: 0.95rem;
    color: var(--light-text);
}

.kb-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kb-container {
        margin: 20px;
        padding: 25px;
    }
    
    .kb-header h1 {
        font-size: 2rem;
    }
    
    .kb-post h1 {
        font-size: 2rem;
    }
    
    .kb-post-content h2 {
        font-size: 1.5rem;
    }
    
    .kb-post-content {
        font-size: 1rem;
    }
    
    .kb-post-list li {
        padding: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .kb-container {
        margin: 10px;
        padding: 20px;
    }
    
    .kb-header h1 {
        font-size: 1.8rem;
    }
    
    .kb-post h1 {
        font-size: 1.8rem;
    }
}

/* Global Header Styles - Navigation handled by nav-styles.css */
/* Knowledge Base pages inherit all navigation styling from the centralized nav-styles.css */

/* Knowledge Base Layout */
.kb-layout {
    display: flex;
    min-height: calc(100vh - 120px);
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem 20px;
}

/* Sidebar Navigation */
.kb-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.kb-nav h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.kb-nav-links {
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.kb-nav-links li {
    margin-bottom: 0.5rem;
}

.kb-nav-links a {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 500;
}

.kb-nav-links a:hover,
.kb-nav-links a.active {
    background-color: var(--light-accent);
    color: var(--secondary-color);
}

.kb-recent h4 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.kb-recent ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kb-recent li {
    margin-bottom: 0.5rem;
}

.kb-recent a {
    display: block;
    padding: 0.25rem 0;
    text-decoration: none;
    color: var(--light-text);
    font-size: 0.9rem;
    line-height: 1.4;
    transition: var(--transition);
}

.kb-recent a:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.kb-main {
    flex: 1;
    min-width: 0;
}

.kb-content {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Update existing kb-container styles */
.kb-container {
    display: none; /* Hide old container */
}

/* Footer Updates */
.kb-footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.kb-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mobile Responsive for Knowledge Base Layout */
@media (max-width: 768px) {
    /* Mobile navigation handled by nav-styles.css */
    
    .kb-layout {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 20px;
    }
    
    .kb-sidebar {
        width: 100%;
        position: static;
        order: 1;
    }
    
    .kb-main {
        order: 2;
    }
    
    .kb-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .kb-content {
        padding: 1rem;
    }
    
    .kb-sidebar {
        padding: 1rem;
    }
}
