/* ==========================================================================
   LekkerLogic blog: the index (blog-*) and article (post-*) pages in /blog.
   Loaded after site.css and built on its tokens and primitives.
   Sections:
     1  Shared (breadcrumb, footer, call to action)
     2  Blog index
     3  Article header + layout
     4  Article body
     5  Responsive
     6  Print
   ========================================================================== */

/* 1 Shared ---------------------------------------------------------------- */
html { scroll-padding-top: 88px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font: 500 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.crumbs li + li::before { content: '/'; margin: 0 10px; color: var(--fg-4); }
.crumbs a { transition: color .15s; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg-2); }

.blog-cta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; padding: 22px 26px; border: 1px solid color-mix(in srgb, var(--signal) 32%, transparent); border-radius: var(--radius); background: radial-gradient(120% 140% at 0 0, var(--signal-tint), transparent 60%); }
.blog-cta p { max-width: 46em; margin: 0; font-size: 15.5px; line-height: 1.55; }
.blog-cta p b { color: var(--fg); font-weight: 600; }

.blog-foot { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.blog-foot .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; }
.blog-foot .mark { width: 28px; height: 28px; }
.blog-foot ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.blog-foot ul a { font-size: 14.5px; color: var(--fg-2); transition: color .15s; }
.blog-foot ul a:hover { color: var(--fg); }
.blog-foot p { flex-basis: 100%; font-size: 13px; color: var(--fg-3); }

/* 2 Blog index ------------------------------------------------------------ */
.blog-head { padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.blog-head h1 { max-width: 17em; margin-top: 24px; font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1.06; letter-spacing: -.028em; font-stretch: 96%; text-wrap: balance; }
.blog-lede { max-width: 40em; margin-top: 16px; font-size: 19px; line-height: 1.5; }

.blog-list { padding: 56px 0 0; }
.blog-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.blog-list-head span { color: var(--signal); }

/* One row per article. The title link is stretched over the whole row. */
.post-card { position: relative; display: grid; grid-template-columns: 3fr 9fr; gap: 16px 32px; padding: 36px 0; border-top: 1px solid var(--line-2); }
.post-card:last-child { border-bottom: 1px solid var(--line-2); }
.post-card-meta { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.post-card-meta .mono-idx { text-transform: uppercase; letter-spacing: .05em; }
.post-card h2 { max-width: 24em; font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem); line-height: 1.12; letter-spacing: -.022em; font-stretch: 96%; text-wrap: balance; }
.post-card h2 a::after { content: ''; position: absolute; inset: 0; }
.post-card p { max-width: 44em; margin-top: 12px; font-size: 16.5px; line-height: 1.6; }
.post-card .tags { margin-top: 18px; }
.post-card-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14.5px; font-weight: 500; color: var(--signal); }
.post-card-more i { transition: transform .2s var(--ease); }
.post-card:hover .post-card-more i { transform: translateX(4px); }

.blog-topics { display: grid; grid-template-columns: 3fr 9fr; gap: 16px 32px; padding: 36px 0 72px; }
.blog-topics p { max-width: 44em; margin-bottom: 16px; font-size: 16px; }
.blog-index .blog-cta { margin-bottom: 96px; }

/* 3 Article header + layout ---------------------------------------------- */
.post-head { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.post-head h1 { max-width: 21em; margin-top: 24px; font-size: clamp(2rem, 1.3rem + 2.4vw, 3.2rem); line-height: 1.06; letter-spacing: -.028em; font-stretch: 96%; text-wrap: balance; }
.post-dek { max-width: 42em; margin-top: 16px; font-size: 19px; line-height: 1.5; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 28px; font: 500 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.post-meta b { font-weight: 500; color: var(--fg); }

/* The rail comes first in the markup so the contents list leads on small screens; the grid places it on the right. */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 0 72px; align-items: start; padding-top: 48px; padding-bottom: 96px; }
.post-body { grid-column: 1; grid-row: 1; min-width: 0; }
.post-aside { grid-column: 2; grid-row: 1; position: sticky; top: 92px; display: flex; flex-direction: column; gap: 28px; }

.post-toc h2 { margin-bottom: 10px; }
.post-toc ol { border-top: 1px solid var(--line); counter-reset: toc; }
.post-toc a { counter-increment: toc; display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.35; color: var(--fg-2); transition: color .15s; }
.post-toc a::before { content: counter(toc); flex: none; width: 1.2em; font: 500 12px/1.4 var(--mono); color: var(--signal); }
.post-toc a:hover { color: var(--fg); }

.post-related { display: block; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-1); transition: border-color .15s; }
.post-related:hover { border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.post-related b { display: block; margin-top: 8px; font-size: 15.5px; line-height: 1.35; font-weight: 600; color: var(--fg); }
.post-related span:last-child { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--signal); }

/* 4 Article body ---------------------------------------------------------- */
.post-body > p { max-width: 44em; margin-top: 18px; font-size: 17px; line-height: 1.7; text-wrap: pretty; }
.post-body h2 { margin-top: 56px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem); line-height: 1.15; letter-spacing: -.022em; font-stretch: 96%; }
.post-body h2 + p { margin-top: 20px; }
.post-body strong { font-weight: 600; color: var(--fg); }
.post-body p a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body p a:hover { color: var(--signal); }

/* Key takeaways */
.post-key { padding: 20px 26px 12px; border: 1px solid color-mix(in srgb, var(--signal) 32%, transparent); border-radius: var(--radius); background: radial-gradient(120% 120% at 0 0, var(--signal-tint), transparent 60%); }
.post-body .post-key h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; font: 500 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--signal); }
.post-key h2 i { font-size: 15px; }
.post-key ul { margin-top: 10px; }
.post-key li { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; font-size: 15.5px; line-height: 1.5; color: var(--fg); }
.post-key li + li { border-top: 1px solid var(--line); }
.post-key li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); transform: translateY(-2px); }
.post-key + p { margin-top: 32px; }

/* Lead-in lists: a bold claim on the left, the explanation on the right */
.post-points { margin-top: 24px; border-top: 1px solid var(--line); }
.post-points li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 6px 32px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; }
.post-points b { font-weight: 600; color: var(--fg); }

/* Numbered steps */
.post-steps { margin-top: 24px; border-top: 1px solid var(--line); counter-reset: step; }
.post-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 4fr) minmax(0, 8fr); gap: 6px 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; }
.post-steps li::before { content: counter(step, decimal-leading-zero); font: 500 12px/1.4 var(--mono); color: var(--signal); }
.post-steps b { font-weight: 600; color: var(--fg); }

/* Tables */
.post-fig { margin: 28px 0 0; }
.post-fig figcaption { margin-bottom: 10px; font-size: 13.5px; line-height: 1.5; color: var(--fg-3); }
.post-fig figcaption b { margin-right: 6px; font: 500 12px/1.5 var(--mono); letter-spacing: .03em; text-transform: uppercase; color: var(--fg); }
.post-tw { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); }
.post-t { width: 100%; border-collapse: collapse; }
.post-t th, .post-t td { padding: 12px 18px; text-align: left; vertical-align: top; font-size: 14.5px; line-height: 1.5; border-top: 1px solid var(--line); }
.post-t thead th { border-top: 0; padding-block: 11px; background: var(--bg-2); font: 500 11px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.post-t tbody th { width: 21%; font-weight: 600; color: var(--fg); }
.post-t td { color: var(--fg-2); }
.post-t td + td, .post-t th + td, .post-t th + th { border-left: 1px solid var(--line); }
.post-t.is-vs thead th:last-child { color: var(--signal); }
.post-t.is-vs td:last-child { color: var(--fg); }
.post-fig .post-note { margin-top: 10px; }
.post-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: var(--radius); }
.post-fig + .post-steps, .post-fig + .post-points { margin-top: 28px; }

.post-note { max-width: 60em; font-size: 13.5px; line-height: 1.5; color: var(--fg-3); }
.post-body .blog-cta { margin-top: 48px; }
.post-end { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 32px; margin-top: 28px; }

/* 5 Responsive ------------------------------------------------------------ */
@media (max-width: 960px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
    .post-body, .post-aside { grid-column: 1; grid-row: auto; }
    .post-aside { position: static; margin-bottom: 32px; }
    .post-related { display: none; }
    .post-card, .blog-topics { grid-template-columns: 1fr; }
    .post-card-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; padding-top: 0; }
}
@media (max-width: 640px) {
    .blog-head { padding: 48px 0 40px; }
    .post-head { padding: 40px 0 28px; }
    .blog-lede, .post-dek { font-size: 17px; }
    .post-body > p { font-size: 16.5px; }
    .post-body h2 { margin-top: 48px; }
    .post-key { padding: 18px 18px 10px; }
    .post-points li { grid-template-columns: 1fr; }
    .post-steps li { grid-template-columns: 28px minmax(0, 1fr); }
    .post-steps li span { grid-column: 2; }
    .post-t { min-width: 600px; }
    .post-t th, .post-t td { padding: 11px 14px; font-size: 14px; }
    .blog-cta { padding: 20px; }
    .blog-cta .btn { width: 100%; }
    .blog-list { padding-top: 40px; }
    .blog-topics { padding-bottom: 56px; }
    .blog-index .blog-cta { margin-bottom: 72px; }
    .post-layout { padding-bottom: 72px; }
}

/* 6 Print: light paper, Letter, article on two pages ---------------------- */
@media print {
    @page { size: Letter; margin: .5in .6in .45in; }
    :root {
        color-scheme: light;
        --bg: #fff; --bg-1: #fff; --bg-2: #f1f4f5; --bg-3: #e9edef;
        --line: rgba(10, 20, 25, .11); --line-2: rgba(10, 20, 25, .2); --line-3: rgba(10, 20, 25, .34);
        --fg: #0b1215; --fg-2: #2a343a; --fg-3: #56616a; --fg-4: #98a2a9;
        --signal: #0a7a58; --signal-tint: rgba(10, 122, 88, .07); --signal-ring: transparent;
        --gutter: 0px; --radius: 6px;
    }
    *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; }
    html, body { background: #fff; }
    /* .post-no-print: screen-only blocks, such as dark diagrams */
    .nav, .skip, .post-aside, .crumbs, .post-end, .post-no-print, .blog-cta .btn, .blog-foot ul, .blog-foot .brand { display: none !important; }
    .wrap { max-width: none; }
    a { text-decoration: none !important; }

    .post-head { padding: 0 0 10px; }
    .post-head h1 { max-width: none; margin-top: 0; font-size: 22px; line-height: 1.12; }
    .post-dek { max-width: none; margin-top: 5px; font-size: 11.5px; line-height: 1.45; }
    .post-meta { margin-top: 8px; font-size: 7.6px; }
    .post-layout { display: block; padding: 10px 0 0; }

    .post-body > p { max-width: none; margin-top: 6px; font-size: 10.2px; line-height: 1.48; }
    .post-body h2 { margin-top: 14px; padding-bottom: 4px; font-size: 13.5px; break-after: avoid; }
    .post-body h2 + p { margin-top: 6px; }
    .post-body h2.post-break { break-before: page; margin-top: 0; }
    .post-key { padding: 7px 12px 4px; background: #fff; }
    .post-body .post-key h2 { margin: 0; padding: 0; font-size: 8px; }
    .post-key h2 i { font-size: 10px; }
    .post-key ul { margin-top: 2px; }
    .post-key li { gap: 8px; padding: 3px 0; font-size: 9.8px; line-height: 1.4; }
    .post-key li::before { width: 4px; height: 4px; transform: translateY(-1px); }
    .post-key + p { margin-top: 10px; }

    .post-points, .post-steps { margin-top: 7px; }
    .post-points li { gap: 0 18px; padding: 3.5px 0; font-size: 9.8px; line-height: 1.4; break-inside: avoid; }
    .post-steps li { grid-template-columns: 16px minmax(0, 4fr) minmax(0, 8fr); gap: 0 10px; padding: 3.5px 0; font-size: 9.8px; line-height: 1.4; break-inside: avoid; }
    .post-steps li::before { font-size: 8px; }

    .post-fig { margin-top: 9px; break-inside: avoid; }
    .post-fig figcaption { margin-bottom: 4px; font-size: 8.8px; }
    .post-fig figcaption b { margin-right: 4px; font-size: 7.6px; }
    .post-tw { overflow: visible; }
    .post-t { min-width: 0; }
    .post-t th, .post-t td { padding: 3.5px 8px; font-size: 9.5px; line-height: 1.38; }
    .post-t thead th { padding-block: 3.5px; font-size: 7.3px; }
    .post-fig .post-note { margin-top: 4px; }
    .post-note { max-width: none; font-size: 8.4px; }

    .post-body .blog-cta { margin-top: 14px; padding: 7px 12px; background: #fff; break-inside: avoid; }
    .blog-cta p { max-width: none; font-size: 9.8px; line-height: 1.42; }
    .blog-cta p::after { content: ' lekkerlogic.com'; font: 500 9.4px/1.4 var(--mono); color: var(--signal); }
    .blog-foot { margin-top: 10px; padding: 6px 0 0; }
    .blog-foot p { font-size: 7.8px; }
}
