/* ============================================================
   ParseKeep — стилі блогу (standalone, бренд як на лендингу).
   Токени, контейнер, кнопки, шапка й футер портовані з landing.html;
   нижче — типографіка статті й картки списку статей.
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-soft: #f5f8ff;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e7ecf5;
    --brand: #2563eb;
    --brand-2: #0ea5e9;
    --brand-ink: #1e40af;
    --accent: #22d3ee;
    --dark: #0b1222;
    --dark-2: #111c36;
    --ok: #16a34a;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.06);
    --shadow-md: 0 14px 40px -16px rgba(15,23,42,.28);
    --shadow-lg: 0 40px 80px -28px rgba(2,8,23,.55);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

.container { max-width: 1160px; }

/* ---------- Buttons (override Tabler, same class names) ---------- */
.btn { font-weight: 600; border-radius: 12px; padding: .62rem 1.15rem; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; border-radius: 13px; }
.btn-sm { padding: .45rem .9rem; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: none; color: #fff; box-shadow: 0 8px 20px -8px rgba(37,99,235,.7); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(37,99,235,.75); }
.btn-outline-primary { border: 1.5px solid var(--brand); color: var(--brand); background: transparent; }
.btn-outline-primary:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(11,18,34,.72);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; text-decoration: none; }
.brand .brand-mark { width: 32px; height: 32px; display: inline-grid; place-items: center; }
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a.navlink { color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; font-size: .95rem; padding: .45rem .7rem; border-radius: 9px; }
.nav-links a.navlink:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (max-width: 860px) { .nav-links .navlink { display: none; } }
@media (max-width: 520px) {
    .site-header .inner { height: 58px; gap: .5rem; }
    .brand { font-size: 1rem; gap: .45rem; }
    .brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
    .nav-links { gap: .25rem; flex-shrink: 0; }
    .nav-links .btn-primary { padding: .42rem .68rem; font-size: .82rem; white-space: nowrap; }
}

/* ---------- Footer ---------- */
footer.site-footer { background: var(--dark); color: rgba(255,255,255,.62); padding: 3rem 0 1.6rem; }
footer.site-footer h5 { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: .9rem; }
footer.site-footer a { color: rgba(255,255,255,.66); text-decoration: none; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer ul li { padding: .22rem 0; }

/* ---------- Blog hero (заголовок розділу) ---------- */
.blog-hero {
    position: relative; overflow: hidden; color: #fff; background: var(--dark);
    padding: 3.4rem 0 3rem;
}
.blog-hero::before {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(60% 70% at 12% 0%, rgba(37,99,235,.40), transparent 60%),
        radial-gradient(55% 60% at 92% 8%, rgba(14,165,233,.30), transparent 55%);
}
.blog-hero .container { position: relative; z-index: 1; }
.blog-kicker { color: #93c5fd; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.blog-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 800; letter-spacing: -.025em; margin: .5rem 0 .6rem; }
.blog-hero-sub { color: rgba(255,255,255,.82); font-size: 1.08rem; line-height: 1.55; max-width: 640px; margin: 0; }

/* ---------- Blog list ---------- */
.blog-list-section { padding: 3.4rem 0 4.5rem; }
.blog-empty { text-align: center; color: var(--muted); font-size: 1.05rem; padding: 3rem 0; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
@media (max-width: 760px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex; flex-direction: column;
}
.post-cover-link { display: block; line-height: 0; }
.post-cover { display: block; width: 100%; height: auto; background: var(--dark); }
.post-card-body { padding: 1.15rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex-grow: 1; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #d7e1f2; }
.post-card-meta { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; }
.post-card-dot { color: var(--line); }
.post-card-title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .55rem; }
.post-card-title a { color: var(--ink); text-decoration: none; }
.post-card-title a:hover { color: var(--brand); }
.post-card-desc { color: var(--muted); font-size: .96rem; line-height: 1.6; margin: 0 0 1rem; flex-grow: 1; }
.post-card-more { color: var(--brand); font-weight: 600; font-size: .95rem; text-decoration: none; align-self: flex-start; }
.post-card-more:hover { text-decoration: underline; }

/* ---------- Article ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 3rem 1rem 4rem; }
.article-head { margin-bottom: 2rem; }
.article-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .9rem; color: var(--ink); }
.article-meta { color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: .5rem; }
.article-meta-dot { color: var(--line); }

.article-body { color: var(--ink-2); font-size: 1.06rem; }
.article-body h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); margin: 2.4rem 0 .9rem; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin: 1.9rem 0 .7rem; }
.article-body p { line-height: 1.75; margin: 0 0 1.15rem; }
.article-body ul, .article-body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; line-height: 1.7; }
.article-body li { margin-bottom: .4rem; }
.article-body a { color: var(--brand); text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body blockquote {
    border-left: 3px solid var(--brand);
    background: var(--bg-soft);
    margin: 1.4rem 0; padding: .9rem 1.2rem;
    border-radius: 0 10px 10px 0; color: var(--ink-2);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code { background: #eef2f9; color: var(--brand-ink); padding: .1rem .35rem; border-radius: 6px; font-size: .85em; font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-body pre { background: #eef2f9; border-radius: 10px; padding: 1rem 1.15rem; overflow-x: auto; margin: 0 0 1.15rem; }
.article-body pre code { background: none; padding: 0; }
.article-body img { max-width: 100%; height: auto; border-radius: 10px; }

/* ---------- Article CTA ---------- */
.article-cta {
    margin-top: 2.8rem; padding: 1.6rem 1.8rem;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
    text-align: center;
}
.article-cta-lead { font-size: 1.12rem; font-weight: 800; color: var(--ink); margin: 0 0 1.1rem; }
.article-cta-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
@media (max-width: 520px) {
    .article-cta { padding: 1.4rem 1.1rem; }
    .article-cta-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Post hero (тёмна плашка заголовка статті) ---------- */
.post-hero { position: relative; overflow: hidden; color: #fff; background: var(--dark); padding: 3rem 0 2.8rem; }
.post-hero::before {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(60% 70% at 12% 0%, rgba(37,99,235,.42), transparent 60%),
        radial-gradient(55% 60% at 92% 8%, rgba(14,165,233,.30), transparent 55%);
}
.post-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.post-kicker { display: flex; align-items: center; gap: .5rem; color: #93c5fd; font-size: .82rem; font-weight: 600; }
.post-kicker span { color: rgba(147,197,253,.6); }
.post-hero h1 { font-size: clamp(1.85rem, 3.6vw, 2.55rem); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; margin: .7rem 0 .6rem; }
.post-sub { color: rgba(255,255,255,.82); font-size: 1.1rem; line-height: 1.5; max-width: 92%; margin: 0; }
@media (max-width: 520px) { .post-hero { padding: 2.4rem 0 2.2rem; } .post-sub { font-size: 1.02rem; } }

/* ---------- Article figures (SVG-діаграми + підписи) ---------- */
.article-body figure { margin: 1.7rem 0; }
.article-body figure svg { width: 100%; height: auto; display: block; }
.article-body figcaption { color: var(--muted); font-size: .86rem; line-height: 1.5; margin-top: .6rem; text-align: center; }

/* ---------- Callout (чесна виноска) ---------- */
.article-body .pk-callout {
    border-left: 4px solid var(--brand); background: var(--bg-soft);
    border-radius: 0 12px 12px 0; padding: 1rem 1.2rem; margin: 1.7rem 0;
    color: var(--ink-2); font-size: 1rem; line-height: 1.65;
}
.article-body .pk-callout b { color: var(--brand-ink); }

/* ---------- Comparables table (приклад вибірки аналогів) ---------- */
.article-body .cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body table.cmp { width: 100%; border-collapse: collapse; font-size: .9rem; }
.article-body table.cmp thead th { background: var(--dark); color: #fff; font-weight: 600; text-align: left; padding: .55rem .7rem; font-size: .8rem; white-space: nowrap; }
.article-body table.cmp tbody td { border-bottom: 1px solid var(--line); padding: .5rem .7rem; color: var(--ink-2); white-space: nowrap; }
.article-body table.cmp tbody tr:last-child td { border-bottom: none; }
.article-body table.cmp td.num { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.article-body .cmp-src { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--brand-ink); background: #e0ecff; border-radius: 6px; padding: .1rem .45rem; }
