/* ==========================================================================
   Public Blog (/blog, /blog/{slug})
   Built on top of style.css -- reuses CSS custom properties, .glass-card,
   .btn/.btn-primary/.btn-secondary and the existing .kb-* article typography
   (kb-article-body, kb-callout-box, kb-table-wrapper, kb-steps-container, ...)
   that already ships with the private knowledge base. Only page chrome
   (header/footer/hero/cards/CTA) and a couple of small gaps are added here.
   ========================================================================== */

body.blog-page {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ---------- Header ---------- */
.blog-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(5, 7, 10, 0.85);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.blog-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.blog-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
}

.blog-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.blog-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.blog-nav-link:hover,
.blog-nav-link.is-active {
    color: white;
}

/* ---------- Layout ---------- */
.blog-main {
    padding: 48px 24px 80px;
}

.blog-container {
    max-width: 1100px;
    margin: 0 auto;
}

.blog-article-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ---------- Index: hero ---------- */
.blog-hero {
    max-width: 720px;
    margin-bottom: 40px;
}

.blog-hero h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-hero p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ---------- Index: article grid ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.blog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.blog-card-icon {
    font-size: 28px;
}

.blog-card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.blog-card-title {
    font-size: 19px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    margin-bottom: 12px;
}

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-card-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
}

/* ---------- Article page ---------- */
.blog-article {
    padding: 40px;
}

.blog-article-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.25;
    margin-bottom: 12px;
}

.blog-article-meta {
    font-size: 13px;
}

/* Readable prose column inside the card: 800px card - 40px padding * 2 = 720px */
.blog-article .kb-article-body {
    max-width: 720px;
}

/* Fallback: the shared style.css only styles kb-article-body h2 explicitly;
   a couple of fragments use bare <h3> outside of already-styled components
   (kb-step-title, kb-comparison-card h3, ...). */
.blog-article .kb-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 24px 0 12px;
    letter-spacing: -0.2px;
}

/* ---------- CTA block ---------- */
.blog-cta {
    margin-top: 40px;
    padding: 28px 32px;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid var(--glass-border);
}

.blog-cta h3 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.blog-cta p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.blog-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ---------- Related articles ---------- */
.blog-related {
    margin-top: 32px;
}

.blog-related h3 {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 3px solid var(--accent-purple);
}

.blog-related-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-related-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.blog-related-link:hover {
    background-color: var(--glass-hover);
}

.blog-related-icon {
    font-size: 18px;
}

/* ---------- Footer ---------- */
.blog-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 48px 24px 24px;
}

.blog-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--glass-border);
}

.blog-footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.blog-footer-tagline {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.blog-footer-col h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.blog-footer-col a {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 10px;
    transition: var(--transition-smooth);
}

.blog-footer-col a:hover {
    color: white;
}

.blog-footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Missing calculator styles ----------
   статьи/article_lost_clicks.html uses kb-calc-* classes for its interactive
   loss calculator, but the source fragment ships with neither <style> nor
   <script> for it (checked: 0 occurrences project-wide). Added here so the
   widget renders and works on /blog/poteryannye-kliki; the JS lives in
   blog/article.html. Not touched: статьи/*.html and app/templates/knowledge/*
   still have the same pre-existing gap. */
.kb-calc-wrapper {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    margin: 28px 0;
}

.kb-calc-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.kb-calc-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.kb-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.kb-calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kb-calc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kb-calc-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kb-calc-input {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    color: white;
    font-family: var(--font-main);
    font-size: 15px;
}

.kb-calc-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.kb-calc-slider-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kb-calc-slider {
    flex: 1;
    accent-color: var(--accent-purple);
}

.kb-calc-slider-val {
    font-weight: 700;
    color: white;
    min-width: 42px;
    text-align: right;
}

.kb-calc-outputs {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.kb-calc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.kb-calc-result-item.highlight {
    padding-top: 14px;
    border-top: 1px dashed var(--glass-border);
}

.kb-calc-result-lbl {
    color: var(--text-secondary);
}

.kb-calc-result-val {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.kb-calc-result-val.success {
    color: var(--status-active);
}

.kb-calc-result-val.warning {
    color: var(--status-paused);
}

.kb-calc-result-val.danger {
    color: var(--status-banned);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .blog-footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .kb-calc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .blog-header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .blog-nav {
        gap: 16px;
    }

    .blog-hero h1 {
        font-size: 30px;
    }

    .blog-article {
        padding: 24px;
    }

    .blog-article-title {
        font-size: 26px;
    }

    .blog-cta {
        padding: 20px;
    }
}

@media (max-width: 560px) {
    .blog-footer-inner {
        grid-template-columns: 1fr;
    }
}
