/* CustomerNode Insights — on-domain reader page (/insights/<slug>/).
   Premium editorial typography for the full-text article/note, rendered from the
   brand source. Light theme, indigo tokens shared with insights.css. No inline
   styles (PUBLIC_CSP style-src 'self'); everything scoped under .cn-reader /
   .cn-article so it cannot collide with the rest of the marketing CSS. */

.cn-reader {
    --cni-indigo: #6366f1;
    --cni-indigo-deep: #4f46e5;
    --cni-indigo-soft: #818cf8;
    /* Neutral editorial palette matching the brand source article style
       (brand/linkedin-series/article_template.html): near-black ink + grey
       secondary. Indigo tokens below stay for the site chrome (badge/CTAs). */
    --cni-ink: #191919;
    --cni-ink-soft: #333333;
    --cni-body: #191919;
    --cni-muted: #555555;
    --cni-border: #e4e2f2;
    --cni-border-strong: #cfcceb;
    --cni-lilac: #edeafe;
    --cni-cover-bg: #f1f1f9;

    position: relative;
    /* top padding == nav height so the sticky bar sits flush under the nav. */
    padding: 60px 24px 110px;
    /* Flat near-white to match the rest of the public site (no purple wash). */
    background: #fdfdff;
}

.cn-reader-inner {
    max-width: 760px;
    margin: 0 auto;
}

/* ---- Full-width sticky bar: meta (left) + small CTAs (right), frosted on
   scroll — same pattern as the hub header. ---- */
.cn-reader-bar {
    position: sticky;
    top: 60px;                 /* flush under the 60px fixed nav */
    z-index: 5;
    margin: 0 -24px 26px;      /* cancel section side padding -> full viewport width */
    padding: 12px 24px;
    background: transparent;   /* frost only once scrolled (.is-stuck) */
    transition: background 200ms ease, box-shadow 200ms ease,
                -webkit-backdrop-filter 200ms ease, backdrop-filter 200ms ease;
}

.cn-reader-bar.is-stuck {
    background: rgba(253, 253, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px -20px rgba(15, 23, 42, 0.5);
}

.cn-reader-bar-inner {
    max-width: 760px;          /* aligns with the reading column */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---- Header ---- */
.cn-reader-head {
    margin-bottom: 36px;
}

.cn-reader .cn-insight-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reset the 16px bottom margin the shared .cn-insight-meta (insights.css)
       carries for grid cards. In this sticky bar the meta is a flex-row item, so
       that margin makes align-items:center center the margin-box — pinning the
       badge/date ~8px above the CTA buttons. Zero it so they align on one line. */
    margin: 0;
}

/* Top-row CTAs read as lightweight TEXT LINKS (no button chrome) so the sticky
   bar stays a low, single-line meta row consistent with the badge + date on the
   left. Strips the gradient fill, border, radius, box-shadow and block padding. */
.cn-reader-ctas--top { gap: 20px; }

.cn-reader-ctas--top .cn-reader-cta,
.cn-reader-ctas--top .cn-reader-cta--back {
    font-size: 0.82rem;
    font-weight: 600;
    gap: 5px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
    color: var(--cni-indigo-deep) !important;
    transition: color 160ms ease;
}

/* Back link is the muted/secondary of the pair. */
.cn-reader-ctas--top .cn-reader-cta--back { color: var(--cni-muted) !important; }

.cn-reader-ctas--top .cn-reader-cta:hover,
.cn-reader-ctas--top .cn-reader-cta:focus-visible {
    transform: none;
    box-shadow: none !important;
    color: var(--cni-indigo) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.cn-reader-ctas--top .cn-reader-cta--back:hover,
.cn-reader-ctas--top .cn-reader-cta--back:focus-visible {
    color: var(--cni-ink-soft) !important;
}

.cn-reader .cn-insight-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--cni-indigo-deep);
    background: var(--cni-lilac);
    border-radius: 999px;
    padding: 5px 12px;
    line-height: 1;
}

.cn-reader .cn-insight-date {
    font-size: 0.82rem;
    color: var(--cni-muted);
    font-weight: 500;
}

.cn-reader-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.8rem, 3.4vw, 2.15rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--cni-ink);
    margin: 0 0 10px;
}

/* Deck/subtitle under the title — italic grey, like the source .subtitle. */
.cn-reader-teaser {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.12rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.5;
    color: var(--cni-muted);
    margin: 0 0 34px;
    max-width: 62ch;
}

/* ---- CTA row: LinkedIn (primary) + Back to Insights (secondary) ---- */
.cn-reader-ctas {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cn-reader-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none !important;
    background: linear-gradient(120deg, #4f46e5, #6366f1);
    border-radius: 12px;
    padding: 13px 24px;
    box-shadow: 0 16px 34px -16px rgba(79, 70, 229, 0.6);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.cn-reader-cta:hover,
.cn-reader-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px -16px rgba(79, 70, 229, 0.7);
    outline: none;
    color: #ffffff;
}

.cn-cta-arrow { transition: transform 160ms ease; }
.cn-reader-cta:hover .cn-cta-arrow { transform: translateX(4px); }

/* Secondary "Back to Insights": ghost/outline, overrides the primary fill. */
.cn-reader-cta--back {
    color: var(--cni-indigo-deep) !important;
    background: #ffffff;
    border: 1px solid var(--cni-border-strong);
    box-shadow: none;
}

.cn-reader-cta--back:hover,
.cn-reader-cta--back:focus-visible {
    border-color: var(--cni-indigo);
    color: var(--cni-indigo) !important;
    box-shadow: none;
    transform: translateY(-2px);
}

.cn-reader-cta--back svg { transition: transform 160ms ease; }
.cn-reader-cta--back:hover svg { transform: translateX(-3px); }

/* ---- Hero cover ---- */
.cn-reader-hero {
    margin: 0 0 44px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--cni-cover-bg);
    border: 1px solid var(--cni-border);
    aspect-ratio: 16 / 9;
    box-shadow: 0 30px 60px -34px rgba(44, 42, 77, 0.5);
}

.cn-reader-hero .cn-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cn-cover-img--top { object-position: top center; }
.cn-cover-img--center { object-position: center; }

/* ============================================================
   Article body — .cn-article
   ============================================================ */
.cn-article {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--cni-body);
}

.cn-article > *:first-child { margin-top: 0; }

.cn-article p {
    margin: 0 0 1em;
}

.cn-article h2 {
    font-size: 1.3rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--cni-ink);
    margin: 2.6em 0 0.8em;
}

.cn-article h3 {
    font-size: 1.12rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--cni-ink-soft);
    margin: 2em 0 0.6em;
}

.cn-article h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cni-ink-soft);
    margin: 1.8em 0 0.5em;
}

/* Article subtitle/deck (e.g. deal-room-paradox leads with p.subtitle) —
   italic grey, matching the source .subtitle. */
.cn-article .subtitle {
    font-size: 1.12rem;
    line-height: 1.5;
    color: var(--cni-muted);
    font-weight: 400;
    font-style: italic;
    margin: 0 0 2.2em;
}

/* Links: LinkedIn blue, undecorated until hover (source article style). */
.cn-article a {
    color: #0a66c2;
    text-decoration: none;
    transition: color 140ms ease;
}

.cn-article a:hover { text-decoration: underline; text-underline-offset: 2px; }

.cn-article strong { color: var(--cni-ink); font-weight: 600; }

/* Account comment — the org's LinkedIn first-comment, rendered up top (above the
   hero) as a lead callout mirroring the source article_template.html box.
   Scoped to .cn-reader (not .cn-article) since it sits outside the body flow. */
.cn-reader .account-comment {
    margin: 0 0 32px;
    padding: 16px 20px;
    background: #f0f6ff;
    border: 1px solid #b8d4f0;
    border-radius: 10px;
}

.cn-reader .account-comment-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2a6cb6;
    margin-bottom: 6px;
}

.cn-reader .account-comment p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--cni-ink);
}

.cn-article ul,
.cn-article ol {
    margin: 0 0 1.35em;
    padding-left: 1.4em;
}

.cn-article li { margin-bottom: 0.5em; }

.cn-article hr {
    border: 0;
    height: 2px;
    background: #e0e0e0;
    margin: 2.8em 0;
}

/* Blockquote: heavy dark rule, bold near-black (source article style). */
.cn-article blockquote {
    margin: 2em 0;
    padding: 8px 0 8px 24px;
    border-left: 4px solid var(--cni-ink);
    color: var(--cni-ink);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Pull-quote — the recurring editorial device in the articles. */
.cn-article .pull-quote {
    margin: 2em 0;
    padding: 28px 30px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f3f1ff 0%, #eef0f6 100%);
    border: 1px solid var(--cni-border);
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cni-indigo-deep);
    text-align: center;
}

/* Postscript — the "About CustomerNode" coda. Flat top-ruled section, like the
   source .postscript (no card / shadow). */
.cn-article .postscript {
    margin: 3.5em 0 0;
    padding: 32px 0 0;
    border-top: 2px solid #e0e0e0;
}

.cn-article .postscript h2,
.cn-article .postscript h3 {
    margin-top: 0;
}

.cn-article .postscript p:last-child { margin-bottom: 0; }

/* Figures / images — plain rounded image + centered italic caption. */
.cn-article figure {
    margin: 2em 0;
}

.cn-article img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em auto;
}

.cn-article figure img { margin: 0 auto; }

.cn-article figcaption {
    margin-top: 6px;
    font-size: 0.6rem;
    line-height: 1.35;
    color: var(--cni-muted);
    text-align: center;
    font-style: italic;
}

/* Link-preview card lifted from a short-form post. */
/* Link-preview card lifted from a short-form post — echoes the source post's
   .li-link card (grey panel, LinkedIn-blue title on hover). */
.cn-article-linkcard {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 2em 0;
    padding: 14px 18px;
    border-radius: 10px;
    background: #f3f6f8;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cn-article-linkcard:hover {
    border-color: #cfd6dc;
    box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.5);
    transform: translateY(-1px);
}

.cn-article-linkcard:hover .cn-linkcard-title { color: #0a66c2; text-decoration: underline; }

.cn-linkcard-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--cni-ink);
}

.cn-linkcard-domain {
    font-size: 0.82rem;
    color: var(--cni-muted);
}

/* ---- Footer ---- */
.cn-reader-foot {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--cni-border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.cn-reader-foot-label {
    font-size: 0.95rem;
    color: var(--cni-muted);
    margin: 0;
}

.cn-reader .cn-insights-hub-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cni-indigo-deep);
    text-decoration: none;
}

.cn-reader .cn-insights-hub-back svg { transition: transform 180ms ease; }
.cn-reader .cn-insights-hub-back:hover svg { transform: translateX(-3px); }

@media (max-width: 640px) {
    .cn-reader { padding: 48px 18px 80px; }
    /* Re-sync the full-bleed reader bar's negative margin to the reduced 18px
       side padding above. Without this, the -24px breakout protrudes 6px past
       each edge and causes a horizontal scrollbar on mobile. */
    .cn-reader-bar { margin: 0 -18px 26px; padding: 12px 18px; }
    .cn-article { font-size: 1.06rem; }
    .cn-article .pull-quote { padding: 22px 20px; }
    .cn-article .postscript { padding: 28px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cn-reader-cta,
    .cn-cta-arrow,
    .cn-article-linkcard,
    .cn-reader .cn-insights-hub-back svg {
        transition: none;
    }
    .cn-reader-cta:hover { transform: none; }
    .cn-article-linkcard:hover { transform: none; }
}
