/* ═══════════════════════════════════════════════════════════════
   blog-article.css — Single Article Page
═══════════════════════════════════════════════════════════════ */

/* ── Back link ─────────────────────────────────────────────────── */
.article-hero .back-link,
.article-hero .back-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 20px;
    text-decoration: none;
    transition: color .15s;
}

.article-hero .back-link:hover { color: var(--brand); }

/* ── Loading ───────────────────────────────────────────────────── */
.article-loading {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-wrap {
    text-align: center;
    color: var(--text-2);
    font-size: 15px;
}

.loading-wrap .loading-spinner {
    margin: 0 auto 20px;
}

/* ── Not found ─────────────────────────────────────────────────── */
.article-not-found {
    text-align: center;
}

.not-found-box {
    max-width: 420px;
    margin: 0 auto;
}

.nf-icon {
    font-size: 52px;
    margin-bottom: 20px;
    line-height: 1;
}

.not-found-box h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}

.not-found-box p {
    font-size: 15px;
    color: var(--text-2);
    margin: 0 0 24px;
}

/* ── Hero ──────────────────────────────────────────────────────── */
.article-hero {
    background: linear-gradient(180deg, var(--brand-light) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 0 36px;
    transition: background .3s;
}

[data-theme="dark"] .article-hero {
    background: linear-gradient(180deg, var(--surface2) 0%, var(--bg) 100%);
}

.article-hero-inner {
    max-width: 820px;
}

/* ── Meta top row ──────────────────────────────────────────────── */
.article-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.article-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: var(--brand-light);
    color: var(--brand);
    border: 1px solid rgba(11,116,209,.2);
}

.pill-sis     { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.pill-erp     { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.pill-medical { background: #fff1f2; color: #be123c; border-color: #fecdd3; }

[data-theme="dark"] .pill-sis     { background: rgba(21,128,61,.15); color: #4ade80; border-color: rgba(74,222,128,.2); }
[data-theme="dark"] .pill-erp     { background: rgba(124,58,237,.15); color: #a78bfa; border-color: rgba(167,139,250,.2); }
[data-theme="dark"] .pill-medical { background: rgba(190,18,60,.15); color: #f87171; border-color: rgba(248,113,113,.2); }

.article-date-top {
    font-size: 13px;
    color: var(--text-3);
}

/* ── Titles ────────────────────────────────────────────────────── */
.article-hero-title {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -.5px;
    margin: 0 0 14px;
}

.article-hero-summary {
    font-size: 17px;
    color: var(--text-2);
    line-height: 1.7;
    margin: 0 0 24px;
    max-width: 720px;
}

/* ── Author row ────────────────────────────────────────────────── */
.article-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.5px;
}

.author-name-lg {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.author-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.views-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-3);
}

/* ── Cover image ───────────────────────────────────────────────── */
.article-cover-section {
    padding: 32px 0 0;
}

.article-cover-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    max-height: 480px;
}

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

/* ── Body layout ───────────────────────────────────────────────── */
.article-body-section {
    padding: 48px 0 72px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

/* ── Prose ─────────────────────────────────────────────────────── */
.article-main { min-width: 0; }

.article-prose {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 32px;
}

.article-prose h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 14px;
    line-height: 1.25;
    letter-spacing: -.3px;
}

.article-prose h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin: 28px 0 12px;
}

.article-prose p {
    margin: 0 0 18px;
}

.article-prose ul,
.article-prose ol {
    padding-left: 24px;
    margin: 0 0 18px;
}

.article-prose li {
    margin-bottom: 6px;
}

.article-prose a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-prose blockquote {
    border-left: 3px solid var(--brand);
    margin: 24px 0;
    padding: 12px 20px;
    background: var(--brand-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-2);
}

[data-theme="dark"] .article-prose blockquote {
    background: rgba(11,116,209,.1);
}

.article-prose img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

.article-prose code {
    font-size: 0.875em;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
}

.article-prose pre {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-prose pre code {
    background: none;
    border: none;
    padding: 0;
}

/* ── Tags ──────────────────────────────────────────────────────── */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-bottom: 24px;
}

.tags-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-right: 4px;
}

.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-2);
    border-radius: 20px;
    padding: 4px 12px;
    transition: border-color .15s, color .15s;
}

.tag:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ── Article footer nav ────────────────────────────────────────── */
.article-footer-nav {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.article-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}

.sidebar-card p {
    font-size: 13px;
    color: var(--text-2);
    margin: 0 0 14px;
    line-height: 1.6;
}

.sidebar-card--cta {
    text-align: center;
    background: var(--brand-light);
    border-color: rgba(11,116,209,.18);
}

[data-theme="dark"] .sidebar-card--cta {
    background: rgba(11,116,209,.1);
    border-color: rgba(11,116,209,.25);
}

.cta-icon {
    font-size: 32px;
    margin-bottom: 10px;
    line-height: 1;
}

.sidebar-card--cta h4 {
    margin-bottom: 6px;
}

/* ── Share buttons ─────────────────────────────────────────────── */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-2);
    font-family: var(--font-body);
    transition: all .15s;
    width: 100%;
}

.share-btn:hover { border-color: var(--brand); color: var(--brand); }

.share-twitter:hover  { border-color: #1d9bf0; color: #1d9bf0; }
.share-linkedin:hover { border-color: #0a66c2; color: #0a66c2; }

/* ── Small button modifier ─────────────────────────────────────── */
.btn-sm {
    font-size: 13px;
    padding: 8px 16px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        order: -1;
    }

    .share-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .share-btn { width: auto; flex: 1; min-width: 120px; }
}

@media (max-width: 600px) {
    .article-hero { padding: 28px 0 24px; }
    .article-hero-summary { font-size: 15px; }
    .article-prose { font-size: 15px; }
    .article-body-section { padding: 32px 0 52px; }
}
