/* blog.css: article typography and blog index for /blog/. Loads after features.css.
   Uses only the site's existing tokens (theme.css / components.css). The site has no dark
   mode, so neither does this file. */

/* ---------- Post hero ---------- */
.post-hero .hero-dark-bg{filter:blur(22px) saturate(.75) brightness(.42);transform:scale(1.15)}
.post-hero-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:36px;align-items:center}
@media(min-width:900px){.post-hero-grid{grid-template-columns:minmax(0,1fr) 340px;gap:56px}}
.post-hero h1{font-size:clamp(1.85rem,1.2rem + 2.6vw,3rem)}
.post-hero .hero-sub{margin-bottom:22px}
.post-hero-media{display:none;margin:0}
@media(min-width:900px){.post-hero-media{display:block}}
.post-hero-media img{width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;border-radius:var(--radius-lg);box-shadow:0 24px 60px -24px rgba(0,0,0,.6);border:1px solid rgba(255,255,255,.14)}
.post-byline{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;font-size:.9rem;color:rgba(255,255,255,.78)}
.post-byline strong{color:#fff;font-weight:600}
.post-byline .pb-sep{width:4px;height:4px;border-radius:50%;background:rgba(255,255,255,.45)}
.post-byline svg{width:15px;height:15px;margin-right:4px;opacity:.8}

/* ---------- Layout: article + sticky contents ---------- */
.post-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:40px}
@media(min-width:1024px){.post-layout{grid-template-columns:minmax(0,1fr) 280px;gap:64px;align-items:start}}
.post-aside{min-width:0}
@media(min-width:1024px){.post-aside{order:2;position:sticky;top:calc(var(--header-total) + 24px)}}
.post-main{min-width:0;max-width:68ch}

/* ---------- Table of contents ---------- */
.post-toc{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px 22px}
.post-toc-title{font-family:var(--font-sans);font-size:.74rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--text-muted);margin-bottom:10px}
.post-toc ol{list-style:none;counter-reset:toc;display:flex;flex-direction:column;gap:2px}
.post-toc li{counter-increment:toc;display:flex;gap:10px;font-size:.92rem;line-height:1.45}
.post-toc li::before{content:counter(toc,decimal-leading-zero);font-family:var(--font-mono);font-size:.74rem;color:var(--accent);padding-top:.32em;min-width:1.6em}
.post-toc a{display:block;padding:5px 0;color:var(--text-secondary);transition:color .15s var(--ease-hover)}
.post-toc a:hover,.post-toc a:focus-visible{color:var(--primary)}
.post-aside-cta{margin-top:18px;background:var(--dark);color:#fff;border-radius:var(--radius-lg);padding:22px}
.post-aside-cta strong{display:block;font-family:var(--font-display);font-size:1.12rem;font-weight:600;margin-bottom:6px;color:#fff}
.post-aside-cta p{color:rgba(255,255,255,.8);font-size:.9rem;margin-bottom:14px}
.post-aside-cta .btn{width:100%;justify-content:center}
@media(max-width:1023px){.post-aside-cta{display:none}}

/* ---------- Article typography ---------- */
.post-body{font-size:1.07rem;line-height:1.75;color:var(--text-secondary);overflow-wrap:break-word}
.post-body > *:first-child{margin-top:0}
.post-body p{margin:0 0 1.15em}
.post-body .post-intro{font-size:1.18rem;line-height:1.7;color:var(--text)}
.post-body h2{font-size:clamp(1.45rem,1.15rem + 1.2vw,1.95rem);margin:2.3em 0 .65em;scroll-margin-top:calc(var(--header-total) + 20px)}
.post-body h3{font-size:1.2rem;margin:1.8em 0 .5em;scroll-margin-top:calc(var(--header-total) + 20px)}
.post-body h2 + h3{margin-top:1em}
.post-body strong{color:var(--text);font-weight:600}
.post-body a:not(.btn){color:var(--primary);font-weight:500;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent) 55%,transparent);text-decoration-thickness:2px;text-underline-offset:3px;transition:color .15s var(--ease-hover),text-decoration-color .15s var(--ease-hover)}
.post-body a:not(.btn):hover{color:var(--accent-dark);text-decoration-color:var(--accent)}
.post-body ul,.post-body ol{margin:0 0 1.3em;padding-left:1.35em}
.post-body ul{list-style:disc}
.post-body ol{list-style:decimal}
.post-body li{margin:0 0 .5em;padding-left:.2em}
.post-body li::marker{color:var(--accent);font-weight:600}
.post-body li > ul,.post-body li > ol{margin:.5em 0 0}

/* Checklist */
.post-body ul.post-checklist{list-style:none;padding:18px 20px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg)}
.post-body ul.post-checklist li{position:relative;padding-left:30px;margin-bottom:.6em}
.post-body ul.post-checklist li:last-child{margin-bottom:0}
.post-body ul.post-checklist li::before{content:"";position:absolute;left:0;top:.32em;width:18px;height:18px;border-radius:4px;background:var(--primary)}
.post-body ul.post-checklist li::after{content:"";position:absolute;left:6px;top:calc(.32em + 4px);width:6px;height:10px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}

/* Callout and blockquote */
.post-body .post-callout{margin:1.6em 0;padding:18px 20px;background:var(--secondary);border-left:4px solid var(--primary);border-radius:0 var(--radius-md) var(--radius-md) 0}
.post-body .post-callout p{margin:0;color:var(--text)}
.post-body .post-callout p + p{margin-top:.7em}
.post-body blockquote{margin:1.8em 0;padding:4px 0 4px 22px;border-left:4px solid var(--accent);font-family:var(--font-display);font-size:1.22rem;line-height:1.5;color:var(--text)}
.post-body blockquote p{margin:0;color:inherit}

/* Tables (reuse .table-wrap/.data-table from components.css) */
.post-body .table-wrap{margin:1.5em 0 1.8em;background:#fff}
.post-body .data-table{font-size:.93rem;line-height:1.55}
.post-body .data-table th,.post-body .data-table td{padding:12px 16px}
.post-body .data-table thead th{white-space:normal}

/* Figures */
.post-body .post-figure{margin:2em 0}
.post-body .post-figure img{width:100%;max-width:520px;height:auto;margin:0 auto;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--surface)}
.post-body .post-figure figcaption{max-width:520px;margin:10px auto 0;font-size:.86rem;line-height:1.55;color:var(--text-muted);text-align:center}

/* FAQ block inside the article */
.post-faq{margin-top:2.6em}
.post-faq h2{font-size:clamp(1.45rem,1.15rem + 1.2vw,1.95rem);margin-bottom:.9em;scroll-margin-top:calc(var(--header-total) + 20px)}
.post-faq .faq-list{max-width:none}
.post-faq .faq-answer-inner{font-size:.98rem;line-height:1.7}

/* Author box */
.post-author{display:flex;gap:16px;align-items:flex-start;margin-top:2.6em;padding:22px;border:1px solid var(--border);border-radius:var(--radius-lg);background:#fff}
.post-author-mark{flex-shrink:0;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--primary);color:#fff;font-family:var(--font-display);font-weight:600;font-size:1.05rem}
.post-author p{margin:0;font-size:.94rem;line-height:1.65;color:var(--text-secondary)}
.post-author strong{display:block;color:var(--text);font-size:1rem;margin-bottom:2px}
.post-author a{color:var(--primary);font-weight:600}

/* ---------- Cards (related posts and index) ---------- */
.post-card{position:relative}
.post-card .ic-media{aspect-ratio:16/10}
.post-card .pc-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;font-size:.8rem;color:var(--text-muted)}
.post-card h2,.post-card h3{font-size:1.12rem;line-height:1.3;letter-spacing:-.01em;margin:0 0 8px}
.post-card h2 a,.post-card h3 a{color:var(--text)}
.post-card h2 a::after,.post-card h3 a::after{content:"";position:absolute;inset:0;z-index:1}
.post-card h2 a:focus-visible,.post-card h3 a:focus-visible{outline:none}
.post-card:focus-within{box-shadow:0 0 0 2px var(--accent)}
.post-card .cc-foot{margin-top:14px}

/* ---------- Blog index ---------- */
.blog-filters{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:-8px 0 36px}
.blog-filter{min-height:44px;padding:9px 18px;border-radius:var(--radius-pill);border:1px solid var(--border);background:#fff;font-size:.92rem;font-weight:600;color:var(--text-secondary);transition:background .2s var(--ease-hover),color .2s var(--ease-hover),border-color .2s var(--ease-hover)}
.blog-filter:hover{border-color:var(--primary);color:var(--primary)}
.blog-filter[aria-pressed="true"]{background:var(--primary);border-color:var(--primary);color:#fff}
.blog-filter .bf-count{font-family:var(--font-mono);font-size:.76rem;opacity:.7;margin-left:6px}
.blog-grid > [hidden]{display:none}
.blog-empty{text-align:center;color:var(--text-muted)}

/* The whole post card is clickable: the title's link stretches over the card, so there is
   still one descriptive link per post (no duplicate anchors for crawlers or screen readers). */
.post-card{position:relative;cursor:pointer}
.post-card :is(h2,h3) a::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit}
.post-card:hover :is(h2,h3) a{color:var(--accent)}
.post-card:hover .cc-foot{gap:10px}
.post-card:focus-within{outline:2px solid var(--primary);outline-offset:3px}
.post-card :is(h2,h3) a:focus-visible{outline:none}
.post-card .cc-foot,.post-card .cc-foot::before,.post-card .cc-foot::after{pointer-events:none}
