/* =====================================================================
   Blog section only - loaded by views/pages/blog/{index,archive,post}.ejs.
   Plain hand-written CSS, not Tailwind utility classes, so it needs no
   purge/build step - see public/css/style.css for the site-wide
   equivalent (search bars, tool cards, footer, related tools).
   ===================================================================== */

/* ---- category color system - mirrors the accent on each badge/chip/kicker,
   so text and icon colors read as one system without needing a real photo
   per post. Falls back to the brand blue for anything unmapped. ---- */
.blog-card, .blog-chip, .post-kicker { --cat: #2563eb; --cat-tint: #eff6ff; --cat-tint2: #dbeafe; }
[data-cat="compression"]      { --cat: #2563eb; --cat-tint: #eff6ff; --cat-tint2: #dbeafe; }
[data-cat="pdf-tools"]        { --cat: #ea580c; --cat-tint: #fff7ed; --cat-tint2: #ffedd5; }
[data-cat="image-tools"]      { --cat: #16a34a; --cat-tint: #f0fdf4; --cat-tint2: #dcfce7; }
[data-cat="file-conversion"]  { --cat: #7c3aed; --cat-tint: #f5f3ff; --cat-tint2: #ede9fe; }
[data-cat="shipping-labels"]  { --cat: #db2777; --cat-tint: #fdf2f8; --cat-tint2: #fce7f3; }
[data-cat="guides"]           { --cat: #4f46e5; --cat-tint: #eef2ff; --cat-tint2: #e0e7ff; }
[data-cat="product-news"]     { --cat: #4f46e5; --cat-tint: #eef2ff; --cat-tint2: #e0e7ff; }
[data-cat="security"]         { --cat: #dc2626; --cat-tint: #fef2f2; --cat-tint2: #fee2e2; }
[data-cat="scanning"]         { --cat: #0891b2; --cat-tint: #ecfeff; --cat-tint2: #cffafe; }
[data-cat="business"]         { --cat: #ca8a04; --cat-tint: #fefce8; --cat-tint2: #fef9c3; }
[data-cat="editing"]          { --cat: #0d9488; --cat-tint: #f0fdfa; --cat-tint2: #ccfbf1; }

.blog-wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem 3.5rem; }
.blog-crumbs { font-size: .8rem; color: #6b7280; margin: 1.25rem 0; }
.blog-crumbs a { color: #2563eb; }
.blog-crumbs a:hover { text-decoration: underline; }

/* ---- hero header --------------------------------------------------- */
.blog-hero {
    position: relative; overflow: hidden; border-radius: 24px;
    background: radial-gradient(120% 160% at 100% 0%, #16264a 0%, #0f1b2e 55%, #0b1524 100%);
    padding: 3rem 2rem 3.25rem; margin: 0 0 2.25rem;
    isolation: isolate;
}
.blog-hero::before, .blog-hero::after {
    content: ""; position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,.16) 0%, rgba(96,165,250,0) 70%);
    z-index: -1;
}
.blog-hero::before { width: 620px; height: 620px; right: -180px; top: -220px; }
.blog-hero::after { width: 420px; height: 420px; right: -80px; bottom: -220px;
    background: radial-gradient(circle, rgba(129,140,248,.14) 0%, rgba(129,140,248,0) 70%); }
.blog-hero__eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: #93c5fd; background: rgba(96,165,250,.14); border: 1px solid rgba(96,165,250,.3);
    padding: .4rem .85rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.blog-hero h1 { font-size: 2.5rem; line-height: 1.12; font-weight: 800; color: #fff; margin-bottom: .7rem; max-width: 34rem; letter-spacing: -.02em; }
.blog-hero p { color: #aebbd4; font-size: 1.08rem; max-width: 34rem; line-height: 1.6; }
@media (max-width: 640px) { .blog-hero { padding: 2.25rem 1.25rem 2.5rem; border-radius: 18px; } .blog-hero h1 { font-size: 1.85rem; } }

/* ---- category chips -------------------------------------------------- */
.blog-chips { display: flex; flex-wrap: nowrap; gap: .55rem; margin: 0 0 2.25rem; overflow-x: auto; padding-bottom: .35rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.blog-chips::-webkit-scrollbar { display: none; }
.blog-chip {
    display: inline-flex; align-items: center; white-space: nowrap; flex-shrink: 0;
    padding: .48rem 1rem; border-radius: 999px;
    border: 1px solid #e5e7eb; background: #fff; color: #374151;
    font-size: .83rem; font-weight: 700; transition: all .15s ease;
}
.blog-chip:hover { border-color: var(--cat, #93c5fd); color: var(--cat, #1d4ed8); background: var(--cat-tint, #eff6ff); }
.blog-chip.is-active { background: #0f172a; border-color: #0f172a; color: #fff; box-shadow: 0 6px 16px -4px rgba(15,23,42,.35); }

/* ---- featured post (page 1 only) - the one place a full cover image
   still earns its keep, since it only appears once per page ---- */
.blog-featured {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
    background: #fff; border: 1px solid #eef0f3; border-radius: 22px; overflow: hidden;
    margin-bottom: 2.25rem; transition: box-shadow .2s ease, transform .2s ease;
}
.blog-featured:hover { box-shadow: 0 20px 45px -20px rgba(15,23,42,.22); transform: translateY(-2px); }
.blog-featured__media { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #eef2ff; }
.blog-featured__media img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; transition: transform .4s ease; }
.blog-featured:hover .blog-featured__media img { transform: scale(1.04); }
.blog-featured__body { padding: 2.25rem 2.25rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.blog-featured__badge {
    display: inline-flex; align-self: flex-start; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #fff; background: #0f172a; padding: .3rem .8rem .3rem .6rem; border-radius: 999px; margin-bottom: 1rem;
}
.blog-featured__badge svg { width: 12px; height: 12px; }
.blog-featured__cat { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cat); margin-bottom: .6rem; }
.blog-featured__cat a { color: inherit; }
.blog-featured h2 { font-size: 1.65rem; line-height: 1.24; font-weight: 800; color: #0f172a; margin-bottom: .75rem; }
.blog-featured h2 a:hover { color: var(--cat); }
.blog-featured__excerpt { color: #4b5563; font-size: 1rem; line-height: 1.65; margin-bottom: 1.35rem; }
.blog-featured__meta { font-size: .84rem; color: #6b7280; }
.blog-featured__meta a { color: #374151; font-weight: 700; }
@media (max-width: 800px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-featured__body { padding: 1.6rem 1.4rem 1.75rem; }
    .blog-featured h2 { font-size: 1.35rem; }
}

/* ---- grid + cards ----------------------------------------------------
   No per-post cover image here: every post currently uses the same
   auto-generated dark title-card graphic, so repeating it 6-8 times per
   page just looked like the same card over and over. A small
   category-tinted icon does the visual job instead, consistently. ---- */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid #eef0f3; border-radius: 18px; padding: 1.5rem;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.blog-card:hover { box-shadow: 0 18px 38px -18px rgba(15,23,42,.2); transform: translateY(-3px); border-color: #e5e7eb; }
.blog-card__top-link { display: block; text-decoration: none; }
.blog-card__top { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.1rem; }
.blog-card__icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--cat-tint); color: var(--cat); flex-shrink: 0; transition: transform .18s ease; }
.blog-card:hover .blog-card__icon { transform: scale(1.07) rotate(-4deg); }
.blog-card__cat { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--cat); }
.blog-card__body { display: flex; flex-direction: column; flex: 1; }
.blog-card__title { font-size: 1.1rem; font-weight: 750; line-height: 1.33; color: #111827; margin-bottom: .55rem; }
.blog-card__title a { color: inherit; }
.blog-card__title a:hover { color: var(--cat); }
.blog-card__excerpt {
    font-size: .89rem; color: #5b6472; line-height: 1.58; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__meta {
    margin-top: 1rem; padding-top: .85rem; border-top: 1px solid #f1f2f4;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    font-size: .78rem; color: #6b7280;
}
.blog-card__meta a { color: #374151; font-weight: 700; }
.blog-card__meta a:hover { color: var(--cat); }

.blog-empty {
    border: 1px dashed #d1d5db; border-radius: 18px; padding: 3.5rem 1rem;
    text-align: center; color: #6b7280; background: #fafbfc;
}

.blog-pager { display: flex; justify-content: center; align-items: center; gap: .4rem; margin-top: 2.75rem; flex-wrap: wrap; }
.blog-pager a, .blog-pager span {
    min-width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
    text-align: center; padding: 0 .6rem; border-radius: 999px;
    border: 1px solid #e5e7eb; font-size: .85rem; font-weight: 700; color: #374151; background: #fff;
    transition: all .15s ease;
}
.blog-pager a:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.blog-pager .is-current { background: #0f172a; border-color: #0f172a; color: #fff; }

/* ===================================================================
   Post detail
   =================================================================== */
.post-wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem 3.5rem; }
.post-header { margin-top: .5rem; }
.post-header h1 { font-size: 2.5rem; line-height: 1.14; font-weight: 800; color: #0f172a; margin: .65rem 0 1.1rem; letter-spacing: -.02em; }
.post-kicker {
    display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase; color: var(--cat);
    background: var(--cat-tint); border: 1px solid var(--cat-tint2);
    padding: .38rem .85rem; border-radius: 999px;
}
.post-byline {
    display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .9rem;
    font-size: .88rem; color: #6b7280; margin-bottom: 2rem;
    padding-bottom: 1.4rem; border-bottom: 1px solid #eef0f3;
}
.post-byline a { color: #374151; font-weight: 700; }
.post-byline a:hover { color: var(--cat); }
.post-byline .dot { width: 3px; height: 3px; border-radius: 999px; background: #cbd5e1; }
.post-cover { border-radius: 20px; overflow: hidden; margin-bottom: 2.25rem; background: #eef2ff; box-shadow: 0 20px 45px -24px rgba(15,23,42,.28); }
.post-cover img { width: 100%; display: block; }

.post-body { font-size: 1.07rem; line-height: 1.8; color: #1f2937; }
.post-body h2 { font-size: 1.5rem; font-weight: 800; margin: 2.4rem 0 .9rem; color: #0f172a; letter-spacing: -.01em; }
.post-body h3 { font-size: 1.18rem; font-weight: 750; margin: 1.7rem 0 .6rem; color: #0f172a; }
.post-body p { margin: 0 0 1.15rem; }
.post-body ul, .post-body ol { margin: 0 0 1.15rem 1.4rem; }
.post-body li { margin-bottom: .45rem; }
.post-body li::marker { color: var(--cat); font-weight: 700; }
.post-body a { color: var(--cat); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--cat) 45%, transparent); text-underline-offset: 2px; }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body code { background: #f1f5f9; color: #0f172a; padding: .15em .4em; border-radius: 5px; font-size: .9em; }
.post-body img { border-radius: 14px; margin: 1.3rem 0; }
.post-body blockquote {
    border-left: 3px solid var(--cat); padding: .2rem 0 .2rem 1.15rem; color: #475569; font-style: italic; margin: 1.4rem 0;
}
.post-body hr { border: none; border-top: 1px solid #eef0f3; margin: 2.5rem 0; }

.post-author-box {
    display: flex; gap: 1.1rem; align-items: flex-start; margin-top: 3.25rem;
    padding: 1.6rem; background: linear-gradient(180deg,#f8fafc,#f9fafb); border: 1px solid #eef0f3; border-radius: 18px;
}
.post-author-box img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eef0f3; }
.post-author-box .author-name { font-weight: 800; color: #111827; margin-bottom: .3rem; }
.post-author-box p { font-size: .9rem; color: #4b5563; line-height: 1.55; }

.post-more { margin-top: 3.75rem; padding-top: 2.75rem; border-top: 1px solid #eef0f3; }
.post-more h2 { font-size: 1.4rem; font-weight: 800; color: #0f172a; margin-bottom: 1.4rem; letter-spacing: -.01em; }

.post-back {
    display: inline-flex; align-items: center; gap: .4rem; margin-top: 2.75rem;
    font-weight: 700; font-size: .9rem; color: #374151;
    border: 1px solid #e5e7eb; padding: .55rem 1.1rem; border-radius: 999px; transition: all .15s ease;
}
.post-back:hover { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
