/* Articles & Knowledge Hub Modern Stylesheet */
:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-bg: rgba(255, 255, 255, 0.95);
    --nav-item-bg: #f1f5f9;
    --nav-item-border: #e2e8f0;
    --nav-item-color: #475569;
}

body.dark-mode, html.dark-mode body {
    --bg-primary: #0b0d17;
    --bg-card: rgba(22, 27, 46, 0.8);
    --bg-subtle: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --header-bg: rgba(11, 13, 23, 0.95);
    --nav-item-bg: rgba(255, 255, 255, 0.05);
    --nav-item-border: rgba(255, 255, 255, 0.1);
    --nav-item-color: #cbd5e1;
}

body.light-mode, html.light-mode body {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --header-bg: rgba(255, 255, 255, 0.95);
    --nav-item-bg: #f1f5f9;
    --nav-item-border: #e2e8f0;
    --nav-item-color: #475569;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #f8fafc;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark-mode, html.dark-mode body {
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0b0d17 60%) no-repeat fixed !important;
    background-color: #0b0d17 !important;
    color: #f8fafc !important;
}

body.light-mode, body.light-theme, html.light-mode body {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

a { color: var(--accent-green); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #059669; }

/* In-iframe support */
html.in-iframe .hub-header,
body.in-iframe .hub-header {
    display: none !important;
}
html.in-iframe .hub-main,
html.in-iframe .article-container,
body.in-iframe .hub-main,
body.in-iframe .article-container {
    padding-top: 24px !important;
}

/* Modern Hub Navigation Header */
.hub-header {
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.hub-nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}
.hub-header-top-row {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.hub-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap !important;
    flex-shrink: 0;
    text-decoration: none;
}
.hub-logo i { color: var(--accent-green); }

.hub-nav-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0 auto;
    min-width: 0;
}
.hub-nav-links {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    margin: 0 auto;
}
.hub-nav-links a {
    color: var(--nav-item-color);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap !important;
    flex-shrink: 0;
    padding: 6px 11px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.hub-nav-links a:hover, .hub-nav-links a.active {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
}
body.dark-mode .hub-nav-links a:hover, body.dark-mode .hub-nav-links a.active {
    background: rgba(16, 185, 129, 0.15);
}

.hub-header-cta-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.article-theme-toggle-btn {
    background: rgba(125, 125, 125, 0.12);
    border: 1px solid rgba(125, 125, 125, 0.25);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.article-theme-toggle-btn:hover {
    background: rgba(125, 125, 125, 0.22);
    transform: scale(1.05);
}

.btn-tool-cta {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    border: 1px solid #10b981 !important;
    padding: 8px 16px !important;
    border-radius: 9px;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap !important;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}
.btn-tool-cta:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* Visibility helpers */
.mobile-header-actions {
    display: none !important;
}

/* Main Containers */
.hub-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.article-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 30px 0 45px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}
.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Category Filter Buttons */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Article Grid & Cards */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
}
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
}
body.dark-mode .article-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
body.dark-mode .article-card:hover {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.article-card-body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.article-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.78rem;
}
.article-card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}
.article-card-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-green);
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Single Article Header & Content */
.article-header {
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.article-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.article-main-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.article-lead {
    font-size: 1.12rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.article-content h2 {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 44px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.article-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 28px 0 12px;
}
.article-content p {
    margin-bottom: 20px;
    color: var(--text-primary);
}
.article-content ul, .article-content ol {
    margin: 0 0 24px 24px;
    color: var(--text-secondary);
}
.article-content li {
    margin-bottom: 8px;
}
.article-content strong {
    color: var(--text-primary);
}

.callout-box {
    background: rgba(16, 185, 129, 0.06);
    border-left: 4px solid var(--accent-green);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 30px 0;
}
.callout-title {
    font-weight: 800;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1rem;
}
.callout-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0 !important;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.content-table th, .content-table td {
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.92rem;
}
.content-table th {
    background: var(--bg-subtle);
    font-weight: 700;
}

.tool-promo-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0;
}

/* Footer */
.hub-footer {
    border-top: 1px solid var(--border-color);
    padding: 50px 24px 36px;
    background: var(--bg-subtle);
    margin-top: 70px;
}
.hub-footer-container,
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 40px;
}
.footer-brand h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
.footer-col h4,
.footer-col h5 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.footer-col ul,
.footer-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.footer-col li {
    margin-bottom: 9px;
    list-style: none !important;
}
.footer-col a,
.footer-links a {
    color: var(--text-muted);
    font-size: 0.86rem;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-col a:hover,
.footer-links a:hover {
    color: var(--accent-green);
}
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1024px) {
    .hub-header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .hub-nav-container {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .hub-header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
    .hub-mobile-home-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
        padding: 6px 12px;
        border-radius: 9px;
        background: rgba(16, 185, 129, 0.12);
        border: 1px solid rgba(16, 185, 129, 0.35);
        color: #10b981;
        font-size: 0.78rem;
        font-weight: 700;
        text-decoration: none;
        transition: all 0.2s;
    }
    .hub-mobile-home-btn:hover {
        background: #10b981;
        color: #ffffff;
    }
    .hub-header-cta-wrap {
        display: none !important;
    }
    .hub-nav-wrapper {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .hub-nav-links {
        display: flex !important;
        width: 100%;
        overflow-x: auto;
        padding: 4px 6px;
        gap: 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        justify-content: flex-start !important;
    }
    .hub-nav-links::-webkit-scrollbar {
        display: none;
    }
    .hub-nav-links a {
        font-size: 0.78rem;
        padding: 6px 11px;
        background: var(--nav-item-bg);
    }
    .hub-nav-links a.active {
        background: rgba(16, 185, 129, 0.15) !important;
        border-color: var(--accent-green) !important;
        color: var(--accent-green) !important;
        font-weight: 700;
    }
    .hub-main, .article-container {
        padding: 20px 14px 60px;
    }
    .hero-section {
        padding: 20px 0 28px;
    }
    .hero-title {
        font-size: 1.6rem;
        word-break: keep-all;
        line-height: 1.35;
    }
    .hero-desc {
        font-size: 0.95rem;
        word-break: keep-all;
        line-height: 1.6;
    }
    .category-filter {
        gap: 6px;
        margin-bottom: 24px;
    }
    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    .article-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .article-card-body {
        padding: 18px 16px;
    }
    .article-card-title {
        font-size: 1.08rem;
        word-break: keep-all;
        line-height: 1.4;
    }
    .article-card-desc {
        font-size: 0.85rem;
        word-break: keep-all;
        line-height: 1.55;
    }
    .article-main-title {
        font-size: 1.55rem;
        word-break: keep-all;
        line-height: 1.35;
    }
    .article-lead {
        font-size: 0.98rem;
        word-break: keep-all;
    }
    .article-content {
        font-size: 0.95rem;
        word-break: keep-all;
    }
    .article-content h2 {
        font-size: 1.3rem;
        word-break: keep-all;
        margin: 32px 0 14px;
    }
    .article-content h3 {
        font-size: 1.1rem;
        word-break: keep-all;
    }
    .tool-promo-banner {
        padding: 20px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hub-footer {
        padding: 36px 16px 24px;
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.2s ease;
}
.modal-overlay.hide {
    display: none !important;
}
.primary-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
}
.primary-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}


/* Hub Nav Wrapper & Floating Scroll Indicators */
.hub-nav-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.hub-nav-links {
    display: flex !important;
    align-items: center;
    gap: 6px;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap !important;
    scroll-behavior: smooth;
    width: 100%;
}
.hub-nav-links::-webkit-scrollbar {
    display: none;
}

/* Hide scroll indicator buttons to keep navigation clean on all screens */
.scroll-indicator-left,
.scroll-indicator-right {
    display: none !important;
}
