/* ==========================================================================
   Kinexus Insights — blog-only components.
   Loads AFTER /assets/brand.css, which supplies the tokens, type, nav, footer,
   buttons, pills and the WhatsApp float. Nothing here redefines those; this
   file only adds the pieces the blog has and the rest of the site doesn't.
   ========================================================================== */

/* ---------- page header (listing) ---------- */
.blog-hero {
    position: relative; padding: calc(var(--nav-h) + 5rem) 0 3.5rem; overflow: hidden;
    background:
        radial-gradient(820px 480px at 88% -8%, rgba(1,116,160,.13) 0%, rgba(1,116,160,0) 62%),
        radial-gradient(680px 440px at -4% 106%, rgba(147,54,134,.11) 0%, rgba(147,54,134,0) 60%),
        var(--canvas);
}
.blog-hero h1 { margin-bottom: 1.3rem; max-width: 46rem; }
.blog-hero .lead-p { max-width: 40rem; }

/* ---------- listing controls: search + category filters ---------- */
.blog-controls {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
    padding-bottom: 1.75rem; border-bottom: 1px solid var(--rule);
}
.blog-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.blog-search svg {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2; stroke-linecap: round;
    pointer-events: none;
}
.blog-search input {
    width: 100%; padding: .8rem 1rem .8rem 2.6rem; border-radius: 999px;
    border: 1px solid var(--rule-s); background: var(--card);
    font-family: inherit; font-size: .95rem; color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.blog-search input::placeholder { color: var(--faint); }
.blog-search input:focus { outline: none; border-color: var(--lead); box-shadow: 0 0 0 3px var(--lead-tint); }

.blog-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-btn {
    font-family: Poppins, sans-serif; font-size: .72rem; font-weight: 500; letter-spacing: .08em;
    text-transform: uppercase; padding: .5rem .95rem; border-radius: 999px; cursor: pointer;
    background: var(--card); border: 1px solid var(--rule); color: var(--slate);
    transition: color .2s, border-color .2s, background .2s;
}
.filter-btn:hover { color: var(--lead-d); border-color: var(--rule-s); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1.25rem; margin-top: 2.25rem; }
.post-card {
    display: flex; flex-direction: column; position: relative; overflow: hidden;
    background: var(--card); border: 1px solid var(--rule); border-radius: 20px;
    padding: 1.9rem 1.9rem 1.6rem; box-shadow: var(--sh-1);
    transition: transform .32s var(--ease), box-shadow .32s, border-color .32s;
}
.post-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--lead); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--rule-s); }
.post-card:focus-within { border-color: var(--lead); }
.post-card .cat {
    font-family: Poppins, sans-serif; font-size: .7rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; color: var(--lead-d); margin-bottom: .8rem;
}
.post-card h3 { font-size: 1.28rem; margin-bottom: .7rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
/* The whole card is the click target; the heading link stretches over it. */
.post-card h3 a::after { content: ''; position: absolute; inset: 0; }
.post-card h3 a:focus-visible { outline: none; }
.post-card .excerpt { font-size: .96rem; color: var(--slate); line-height: 1.55; flex: 1; margin-bottom: 1.3rem; }
.post-card .meta {
    display: flex; gap: .5rem; align-items: center; padding-top: 1rem; border-top: 1px dashed var(--rule-s);
    font-family: "IBM Plex Mono", monospace; font-size: .76rem; color: var(--faint);
}
.post-card .meta .go { margin-left: auto; font-family: "Source Sans 3", sans-serif; font-weight: 600; font-size: .9rem; color: var(--lead-d); }
.post-card .meta .go .arw { display: inline-block; transition: transform .22s var(--ease); }
.post-card:hover .meta .go .arw { transform: translateX(3px); }
.no-results { grid-column: 1 / -1; text-align: center; color: var(--slate); padding: 3rem 1rem; }

/* ---------- single post ---------- */
.post-wrap { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-h) + 3.5rem) 1.5rem 1rem; }

.breadcrumb { font-size: .88rem; color: var(--faint); margin-bottom: 2rem; }
.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--lead-d); }
.breadcrumb span[aria-current] { color: var(--ink); }

.post-header { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.post-header .cat { text-decoration: none; }
.post-header .cat:hover { color: var(--lead); }
.post-header h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); margin-bottom: 1.2rem; }
.post-meta {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--faint);
}
.post-meta .dot, .post-card .meta .dot { opacity: .6; }

/* Body copy is Ink, always — plum and teal are for headings, links and rules. */
.post-body { font-size: 1.1rem; line-height: 1.75; color: var(--ink); }
.post-body > p { margin-bottom: 1.35rem; }
.post-body h2 { font-size: 1.65rem; letter-spacing: -0.02em; line-height: 1.25; margin: 2.75rem 0 1rem; }
.post-body h3 { font-size: 1.25rem; margin: 2rem 0 .8rem; }
.post-body ul, .post-body ol { margin: 0 0 1.35rem 1.3rem; }
.post-body li { margin-bottom: .5rem; }
.post-body a { color: var(--lead-d); font-weight: 600; text-underline-offset: 3px; }
.post-body blockquote {
    margin: 2rem 0; padding-left: 1.15rem; border-left: 3px solid var(--lead);
    font-family: Poppins, sans-serif; font-weight: 500; font-size: 1.2rem;
    line-height: 1.45; letter-spacing: -0.02em; color: var(--ink);
}

/* "What to do about it" */
.callout {
    position: relative; overflow: hidden; margin: 2.5rem 0;
    background: var(--card); border: 1px solid var(--rule); border-radius: 20px;
    padding: 1.8rem 2rem; box-shadow: var(--sh-1);
}
.callout::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--lead); }
.callout .callout-title {
    font-family: Poppins, sans-serif; font-size: .75rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--lead-d); margin-bottom: 1rem;
}
.callout p { font-size: 1.02rem; line-height: 1.6; margin-bottom: .7rem; padding-left: 1.5rem; position: relative; }
.callout p:last-child { margin-bottom: 0; }
.callout .arrow { position: absolute; left: 0; color: var(--lead); font-weight: 700; }

.post-note { font-size: .88rem; color: var(--faint); font-style: italic; margin: 1.5rem 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.25rem 0; }
.tag-list .tag {
    font-family: Poppins, sans-serif; font-size: .7rem; font-weight: 500; letter-spacing: .08em;
    text-transform: uppercase; padding: .34rem .8rem; border-radius: 999px;
    background: var(--lead-tint); color: var(--lead-d);
}

/* End-of-post call to action — the same dark callout the homepage uses. */
.post-cta {
    position: relative; overflow: hidden; margin: 3rem 0;
    background: var(--ink); color: #fff; border-radius: 24px; padding: 2.75rem;
}
.post-cta::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(520px 300px at 92% 6%, rgba(147,54,134,.34), transparent 62%);
}
.post-cta > * { position: relative; }
.post-cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: .75rem; }
.post-cta p { color: #C8BFCE; margin-bottom: 1.6rem; max-width: 34rem; }

/* Prev / next */
.post-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2.5rem 0 1rem; }
.post-nav a {
    flex: 1 1 240px; padding: 1.15rem 1.35rem; border-radius: 16px; text-decoration: none;
    background: var(--card); border: 1px solid var(--rule);
    transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.post-nav a:hover { transform: translateY(-3px); border-color: var(--rule-s); box-shadow: var(--sh-1); }
.post-nav .dir {
    font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--faint); margin-bottom: .35rem;
}
.post-nav .t { font-family: Poppins, sans-serif; font-weight: 600; font-size: .98rem; line-height: 1.35; color: var(--ink); letter-spacing: -0.01em; }
.post-nav a.next { text-align: right; }

/* Related */
.related { background: var(--mist); padding: 4.5rem 0 5rem; margin-top: 3rem; }
.related h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.related .post-grid { margin-top: 1.75rem; }

@media (max-width: 820px) {
    .blog-hero { padding: calc(var(--nav-h) + 3rem) 0 2.5rem; }
    .blog-search { max-width: none; }
    .post-wrap { padding-top: calc(var(--nav-h) + 2.25rem); }
    .post-cta { padding: 2.1rem 1.5rem; border-radius: 20px; }
    .callout { padding: 1.5rem 1.4rem; }
    .post-nav a.next { text-align: left; }
}
