/* Clasto — blog, glossary and author pages. Uses the tokens from site.css; adds nothing new. */

.post, .blog-index, .glossary-index, .author-page { padding: 56px 0 88px; }
.post-wrap { max-width: 1180px; }

/* breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }
.crumbs a { color: var(--text-secondary); }
.crumbs a:hover { color: var(--amber-dark); }

/* page + post headers */
.blog-intro { max-width: 720px; margin-bottom: 40px; }
.blog-intro h1 { margin: 14px 0 14px; }
.blog-intro p { font-size: 17px; }
.post-head { max-width: 780px; margin-bottom: 26px; }
.post-head h1 { margin: 14px 0 16px; }
.post-deck { font-size: 18px; line-height: 1.55; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.byline { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text-secondary); }
.byline-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amber-tint); color: var(--amber-dark); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.byline-avatar.lg { width: 46px; height: 46px; font-size: 15px; }

/* the answer, stated before the reader scrolls */
.short-answer { max-width: 780px; margin: 0 0 34px; padding: 18px 22px; background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 8px; font-size: 16px; line-height: 1.6; color: var(--text-primary); }
.short-answer strong { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-dark); display: block; margin-bottom: 6px; }

.post-draft { margin-bottom: 22px; padding: 10px 16px; border-radius: 6px; background: var(--amber-tint); border: 1px solid var(--amber); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-800); }

.post-hero { margin: 0 0 34px; }
.post-hero img { width: 100%; height: auto; border-radius: 10px; }

/* contents rail + prose */
.post-grid { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 48px; align-items: start; }
@media (max-width: 980px) { .post-grid { grid-template-columns: 1fr; gap: 28px; } }

.post-toc { position: sticky; top: 88px; }
@media (max-width: 980px) { .post-toc { position: static; padding-bottom: 20px; border-bottom: 1px solid var(--border); } }
.post-toc h2 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.post-toc ol { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.post-toc li.sub { padding-left: 14px; }
.post-toc a { font-size: 13.5px; line-height: 1.4; color: var(--text-secondary); }
.post-toc a:hover { color: var(--amber-dark); }

.post-body { min-width: 0; font-size: 16.5px; line-height: 1.7; color: var(--text-secondary); }
.post-body h2 { font-size: 26px; margin: 44px 0 14px; scroll-margin-top: 88px; }
.post-body h3 { font-size: 18px; margin: 30px 0 10px; scroll-margin-top: 88px; }
.post-body p { margin-bottom: 18px; }
.post-body ul, .post-body ol { margin: 0 0 20px 22px; display: flex; flex-direction: column; gap: 9px; }
.post-body li { line-height: 1.65; }
.post-body a { color: var(--amber-dark); font-weight: 500; text-decoration: underline; }
.post-body strong { color: var(--text-primary); }
.post-body code { font-size: .92em; background: var(--amber-tint); padding: 1px 5px; border-radius: 4px; color: var(--navy-700); }
.post-body blockquote { margin: 0 0 20px; padding-left: 18px; border-left: 3px solid var(--amber); color: var(--text-primary); }
.post-body img { border-radius: 8px; margin-bottom: 18px; }

/* wide tables scroll inside their own container, never the page */
.table-scroll { overflow-x: auto; margin-bottom: 22px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.post-body th, .post-body td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.post-body th { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }

.howto { counter-reset: step; }
.howto-name { font-weight: 600; color: var(--text-primary); }
.framework-note { margin: 26px 0; padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 14.5px; }
.framework-note a { margin-left: 6px; }
.post-video { margin: 26px 0; }
.post-video iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.post-video figcaption { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.deep-dive { font-weight: 600; }

/* author, cta, related */
.author-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; max-width: 780px; margin: 52px 0 0; padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.author-label { display: block; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.author-name { display: inline-block; font-size: 17px; font-weight: 700; margin: 4px 0 2px; }
.author-title { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.author-card p { font-size: 14.5px; }
.author-links { list-style: none; display: flex; gap: 14px; margin-top: 14px; font-size: 14px; }

.post-cta { max-width: 780px; margin: 40px 0 0; padding: 30px; border-radius: 10px; background: var(--navy-800); }
.post-cta h2 { color: #fff; font-size: 24px; margin-bottom: 10px; }
.post-cta p { color: #B7C4D8; font-size: 15px; margin-bottom: 20px; }
.post-cta .btn-primary { background: var(--amber); color: var(--navy-900); }
.post-cta .btn-primary:hover { background: var(--amber-light); }

.related { margin-top: 56px; }
.related h2 { font-size: 20px; margin-bottom: 20px; }
.lang-switch { margin-top: 34px; font-size: 14px; font-weight: 600; }

/* card grids, shared by the index, author page and related rail */
.post-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .post-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .post-cards { grid-template-columns: 1fr; } }
.post-card, .post-featured { display: block; padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); transition: border-color .15s, transform .15s; }
.post-card:hover, .post-featured:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-card h2, .post-card h3 { font-size: 17px; margin: 10px 0 8px; }
.post-card p, .post-featured p { font-size: 14px; }
.post-featured { margin-bottom: 20px; padding: 32px; border-left: 3px solid var(--amber); }
.post-featured h2 { font-size: 26px; margin: 12px 0 10px; }
.post-featured p { font-size: 16px; max-width: 720px; }
.post-card-meta { display: block; margin-top: 14px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.post-card .tag, .post-featured .tag { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dark); }

/* cluster filter — real links, one URL per view.
   Scoped to nav.chips: this sheet loads on every page, and a bare .chip here was
   overriding the hero mockup's own .chip in site.css (see .mock-doc). */
nav.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
nav.chips .chip { padding: 7px 15px; min-height: 34px; display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
nav.chips .chip:hover { border-color: var(--navy-800); color: var(--navy-800); }
nav.chips .chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* glossary */
.glossary { max-width: 780px; }
.glossary dt { margin-top: 22px; font-size: 17px; font-weight: 700; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.glossary-link { margin-top: 44px; font-size: 14px; font-weight: 600; }
.empty { font-size: 16px; color: var(--text-muted); }

/* reading progress bar (site.js) */
#readbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--amber); z-index: 60; }
@media (prefers-reduced-motion: reduce) { #readbar { display: none; } }
.post-toc a.active { color: var(--amber-dark); font-weight: 600; }

/* No title can push the page sideways. A long unbroken word — a product code, a URL, an
   over-eager placeholder — would otherwise overflow the viewport on narrow screens. */
.post-head h1, .blog-intro h1, .post-card h2, .post-card h3, .post-featured h2,
.post-body h2, .post-body h3, .glossary dt { overflow-wrap: break-word; }
.post-body pre { overflow-x: auto; }

/* Card thumbnail — the post's own heroImage. Cards get padding, so the thumbnail is pulled
   back out to the card edge and clipped by the card's own radius. aspect-ratio holds the
   space before the image decodes, so the grid never reflows on load. */
.post-thumb { display: block; margin: -24px -24px 18px; aspect-ratio: 1200 / 630; overflow: hidden; border-radius: 10px 10px 0 0; background: var(--navy-900); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-featured .post-thumb { margin: -32px -32px 22px; border-radius: 0 10px 0 0; }
@media (max-width: 620px) { .post-featured .post-thumb { border-radius: 0 10px 0 0; } }
