/* Blog on v5: the studio layer over blog/style.css, reader.css and engage.css.
   Loaded last on blog pages. Only looks change: class names, ids and data attributes are what
   blog.js and engage.js rely on (likes, comments, highlights, the contents box, zoom, Reader mode). */

/* ---------- shared ---------- */
.v5 .progress { height: 2px; z-index: 140; }
.v5 .progress-bar { background: linear-gradient(90deg, var(--g-1), var(--g-2), var(--g-3)); }
.v5 .back-link, .v5 .post-breadcrumb { font: 400 .8125rem/1.4 var(--font); color: var(--text-meta); }
.v5 .post-breadcrumb a:hover, .v5 .back-link a:hover { color: var(--text); }
.v5 .chip, .v5 .tag { font: var(--w-ui) .75rem/1 var(--font); letter-spacing: 0; text-transform: none; padding: 6px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); }
.v5 .chip:hover { color: var(--text); border-color: var(--border-2); }

/* ---------- listing ---------- */
.v5 .blog-header { padding-top: calc(var(--nav-h) + 64px); text-align: center; }
.v5 .blog-header h1 { font: var(--w-head) var(--fs-display)/1.08 var(--font); letter-spacing: var(--track-display); text-wrap: balance; }
.v5 .blog-header h1 em { font-style: normal; background: linear-gradient(90deg, var(--g-1), var(--g-2) 60%, var(--g-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.v5 .blog-header p { color: var(--text-muted); font-size: var(--fs-lead); max-width: 560px; margin-left: auto; margin-right: auto; }
.v5 .series-feature, .v5 .blog-card, .v5 .end-next-card, .v5 .author-card, .v5 .series-box, .v5 .series-item, .v5 .newsletter {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow);
  transition: transform var(--d-base) var(--ease), box-shadow var(--d-base); }
.v5 .series-feature { border-radius: var(--r-panel); background: var(--surface); }
.v5 .blog-card:hover, .v5 .end-next-card:hover, .v5 .series-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.v5 .blog-card h2, .v5 .series-feature h2, .v5 .series-item-title { font-family: var(--font); font-weight: var(--w-head); letter-spacing: -.03em; }
.v5 .blog-card-eyebrow, .v5 .series-feature-eyebrow, .v5 .grid-heading, .v5 .end-eyebrow, .v5 .series-label { font: 400 var(--fs-label)/1.3 var(--mono); letter-spacing: 0; text-transform: none; color: var(--text-meta); }
.v5 .stat-strip { border-radius: var(--r-card); }
.v5 .stat-strip b, .v5 .stat-strip strong { font-family: var(--font); font-weight: 400; letter-spacing: -.05em; }
.v5 .blog-search input, .v5 .blog-search { border-radius: var(--r-pill); }
.v5 .blog-search input { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-family: var(--font); }
.v5 .blog-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.v5 .blog-tags-filter .chip.active, .v5 .blog-tags-filter [aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.v5 .series-progress-bar { background: linear-gradient(90deg, var(--g-1), var(--g-2)); }

/* ---------- post ---------- */
.v5 .post-grid { padding-top: calc(var(--nav-h) + 48px); }
.v5 .post-kicker { display: inline-flex; font: var(--w-ui) .75rem/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--accent); background: var(--accent-soft); padding: 7px 11px; border-radius: var(--r-pill); }
.v5 .post-header h1 { font-family: var(--font); font-weight: var(--h1-weight, 480); letter-spacing: -.045em; line-height: 1.08; }
.v5 .post-dek { color: var(--text-muted); }
.v5 .post-meta { font-family: var(--font); color: var(--text-meta); }
.v5 .avatar { background: var(--text); color: var(--bg); border: 0; font-family: var(--mono); }
.v5 .reader-nudge { color: var(--accent); font-family: var(--font); }
.v5 .toc { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.v5 .toc-title, .v5 .toc-toggle { font: 400 var(--fs-label)/1 var(--mono); letter-spacing: 0; text-transform: none; color: var(--text-meta); }
.v5 .toc-list a { border-radius: 10px; font-family: var(--font); }
.v5 .toc-list a.is-active { color: var(--accent); background: var(--accent-soft); border-left-color: transparent; }
.v5 .toc-mobile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.v5 .post-content h2, .v5 .post-content h3 { font-family: var(--font); font-weight: var(--w-head); letter-spacing: -.03em; }
.v5 .post-content a { text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.v5 .post-content a:hover { color: var(--accent); }
.v5 .post-content blockquote:not(.callout) { border-left: 2px solid var(--accent); }
.v5 .callout { border: 0; border-radius: 16px; background: var(--accent-soft); }
.v5 .callout-warning { background: color-mix(in oklab, var(--g-3) 12%, transparent); }
.v5 .post-content pre, .v5 .code-block { border-radius: 16px; border: 1px solid var(--border); }
.v5 .post-content :not(pre) > code { border-radius: 6px; }
.v5 .table-wrap { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.v5 .diagram, .v5 .figure-diagram { border-radius: var(--r-card); }

/* likes, share, comments (engage.js) */
.v5 .like-btn, .v5 .comments-link, .v5 .share-btn { border-radius: var(--r-pill); background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); font-family: var(--font); }
.v5 .like-btn:hover, .v5 .comments-link:hover, .v5 .share-btn:hover { box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.v5 .like-btn[aria-pressed="true"] { box-shadow: none; }
.v5 .comment-form input, .v5 .comment-form textarea { border-radius: var(--r-input); background: var(--surface); border-color: var(--border-2); font-family: var(--font); }
.v5 .comment-form input:focus, .v5 .comment-form textarea:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
.v5 .cf-label { font-family: var(--font); }

/* end of post */
.v5 .author-card { padding: 22px; }
.v5 .end-next-card { padding: 20px; }
.v5 .series-box { padding: 18px 20px; }
.v5 .series-name { font-weight: var(--w-strong); }
.v5 .newsletter { padding: 20px; border-radius: var(--r-card); }
.v5 .newsletter input { border-radius: var(--r-input); background: var(--surface); font-family: var(--font); }

/* ---------- series page ---------- */
.v5 .series-header { padding-top: calc(var(--nav-h) + 48px); }
.v5 .series-header h1 { font-family: var(--font); font-weight: var(--w-head); letter-spacing: -.045em; }
.v5 .act-roman, .v5 .series-num { font-family: var(--mono); color: var(--accent); }
.v5 .series-item { padding: 16px 18px; }
.v5 .series-item + .series-item { margin-top: 10px; }

/* Reader mode: the chrome steps back */
.v5[data-mode="reader"] .toc, .v5[data-mode="reader"] .series-box, .v5[data-mode="reader"] .author-card { box-shadow: none; }
