/* SidekickLab Knowledge Base Styles */

:root {
    /* Brand Colors - matching main site */
    --primary: #1E3A5F;
    --primary-dark: #152A45;
    --primary-light: #E8EEF4;
    --accent: #3EBD93;
    --accent-dark: #2FA77E;
    --accent-light: #E6F7F2;

    /* Neutrals */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;

    /* Shadows - softer to match main site */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    /* Borders */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== Header ==================== */
.kb-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 100;
}

.kb-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
    gap: 32px;
}

.kb-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-image {
    height: 35px;
    width: auto;
}

.logo-kb {
    font-weight: 600;
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: 1.5px;
    margin-top: -6px;
}

.search-form {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.search-form:focus-within {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(62, 189, 147, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-form input {
    flex: 1;
    padding: 12px 16px 12px 48px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--gray-800);
    outline: none;
}

.search-form input::placeholder {
    color: var(--gray-400);
}

.search-btn {
    padding: 8px 20px;
    margin: 4px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--accent-dark);
}

/* ==================== Main Content ==================== */
.kb-main {
    flex: 1;
    padding: 48px 0 64px;
}

/* ==================== Hero Section ==================== */
.hero {
    text-align: center;
    margin-bottom: 56px;
    padding: 32px 0;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.hero p {
    font-size: 17px;
    color: var(--gray-500);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==================== Categories Grid ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 72px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    text-decoration: none;
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    stroke-width: 1.5;
    fill: none;
}

.category-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.category-card p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
    flex: 1;
    line-height: 1.7;
}

.category-count {
    font-size: 13px;
    color: var(--accent-dark);
    font-weight: 500;
}

/* ==================== Section Titles ==================== */
.recent-articles h2,
.category-header h1,
.search-header h1,
.related-articles h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.recent-articles {
    margin-top: 16px;
}

/* ==================== Articles Grid ==================== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}

.article-card-image {
    height: 180px;
    background: var(--accent-light);
    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05);
}

.article-card-body {
    padding: 24px;
}

.article-card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.article-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 10px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.article-card p {
    font-size: 14px;
    color: var(--gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

/* ==================== Articles List ==================== */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-list-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    text-decoration: none;
    display: flex;
    gap: 24px;
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.article-list-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}

.article-list-thumb {
    width: 160px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.article-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-list-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-list-content h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.article-list-content p {
    font-size: 14px;
    color: var(--gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.article-list-meta {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 10px;
}

.article-list-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* ==================== Breadcrumb ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 28px;
    padding: 12px 0;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: var(--accent-dark);
}

.breadcrumb span {
    color: var(--gray-400);
}

/* ==================== Category Header ==================== */
.category-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.category-header h1 {
    margin-bottom: 8px;
}

.category-header p {
    color: var(--gray-500);
    font-size: 16px;
    line-height: 1.6;
}

/* ==================== Search Header ==================== */
.search-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.search-header h1 {
    margin-bottom: 8px;
}

.search-header p {
    color: var(--gray-500);
    font-size: 16px;
}

/* ==================== Article Page ==================== */
.article {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--gray-100);
}

.article-header {
    padding: 48px 48px 0;
}

.article-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.25;
    margin-bottom: 20px;
    letter-spacing: -0.025em;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--gray-500);
    font-size: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-100);
}

.article-meta time,
.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-cover {
    margin: 32px 48px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    line-height: 0;
}

.article-cover img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    display: block;
}

.article-content {
    padding: 24px 48px 56px;
    font-size: 16px;
    line-height: 1.85;
    color: var(--gray-700);
}

.article-content h1,
.article-content h2,
.article-content h3 {
    color: var(--gray-900);
    margin-top: 40px;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.article-content h1 { font-size: 32px; }
.article-content h2 { font-size: 28px; }
.article-content h3 { font-size: 24px; }

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 28px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(62, 189, 147, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s ease;
}

.article-content a:hover {
    text-decoration-color: var(--accent);
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow);
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 28px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--gray-700);
    font-style: italic;
}

.article-content pre {
    background: var(--gray-900);
    color: #E2E8F0;
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.6;
}

.article-content code {
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--primary-dark);
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: 'JetBrains Mono', monospace;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 15px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.article-content thead {
    background: var(--primary);
    color: var(--white);
}

.article-content th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-content td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.article-content tbody tr {
    background: var(--white);
    transition: background 0.15s ease;
}

.article-content tbody tr:hover {
    background: var(--gray-50);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.article-content tbody tr:nth-child(even):hover {
    background: var(--gray-100);
}

/* ==================== CTA Block ==================== */
.kb-cta-block {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    margin: 40px 0;
    text-align: center;
}

.kb-cta-eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.kb-cta-heading,
.article-content .kb-cta-heading {
    font-size: 32px;
    font-weight: 700;
    color: var(--white) !important;
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.kb-cta-body {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 28px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.kb-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.kb-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.kb-cta-btn-primary,
.article-content .kb-cta-btn-primary {
    background: var(--accent);
    color: var(--white) !important;
    text-decoration: none !important;
}

.kb-cta-btn-primary:hover,
.article-content .kb-cta-btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    color: var(--white) !important;
}

.kb-cta-btn-secondary,
.article-content .kb-cta-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-decoration: none !important;
}

.kb-cta-btn-secondary:hover,
.article-content .kb-cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: var(--white) !important;
}

@media (max-width: 640px) {
    .kb-cta-block {
        padding: 32px 24px;
    }

    .kb-cta-heading {
        font-size: 22px;
    }

    .kb-cta-body {
        font-size: 15px;
    }

    .kb-cta-buttons {
        flex-direction: column;
    }

    .kb-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== Related Articles ==================== */
.related-articles {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.related-articles h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.related-articles nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.related-articles nav a:last-child {
    border-bottom: none;
}

.related-articles nav a:hover {
    color: var(--accent);
}

.related-articles nav a time {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 400;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination-btn.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: var(--gray-400);
}

/* ==================== Error State ==================== */
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-state h1 {
    font-size: 56px;
    color: var(--gray-200);
    margin-bottom: 16px;
    font-weight: 700;
}

.error-state p {
    color: var(--gray-500);
    margin-bottom: 32px;
    font-size: 18px;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
}

.empty-state h2 {
    color: var(--gray-700);
    margin-bottom: 12px;
    font-weight: 600;
}

.empty-state a {
    color: var(--accent);
    font-weight: 500;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-dark);
}

/* ==================== Footer ==================== */
.kb-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 24px 0;
    margin-top: auto;
}

.kb-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    flex-shrink: 0;
}

.footer-logo img {
    height: 28px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    color: var(--gray-400);
    font-size: 14px;
    margin: 0;
}


/* ==================== Responsive ==================== */
@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-header,
    .article-content {
        padding-left: 28px;
        padding-right: 28px;
    }

    .article-cover {
        margin-left: 28px;
        margin-right: 28px;
    }

    .article-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .kb-header .container {
        flex-direction: column;
        height: auto;
        padding: 16px 20px;
        gap: 16px;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
    }

    .kb-main {
        padding: 32px 0 48px;
    }

    .hero {
        margin-bottom: 40px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .article-list-item {
        flex-direction: column;
        gap: 16px;
    }

    .article-list-thumb {
        width: 100%;
        height: 180px;
    }

    .article-header,
    .article-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .article-header {
        padding-top: 32px;
    }

    .article-cover {
        margin: 24px 20px;
    }

    .article-header h1 {
        font-size: 24px;
    }

    .article-content {
        font-size: 15px;
        padding-bottom: 40px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .kb-footer .container {
        flex-direction: column;
        text-align: center;
    }
}
