/* ============================================================
   WorQuick — Blog / Article styles
   Builds on styles.css design tokens. Load AFTER styles.css.
   ============================================================ */

/* ---------- Article shell ---------- */
.article-wrap { padding: 40px 0 96px; }
.article-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 760px) 1fr;
  gap: 0;
}
.article-grid > * { grid-column: 2; }

/* Table of contents rail (desktop) — spans all rows so the sticky child travels */
.toc-rail { grid-column: 3; grid-row: 1 / -1; position: relative; }
.toc-sticky {
  position: sticky; top: 96px;
  margin-left: 40px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  max-width: 240px;
}
.toc-sticky .toc-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 14px; display: block;
}
.toc-sticky a {
  display: block; font-size: 13.5px; color: var(--muted); padding: 6px 0;
  line-height: 1.4; transition: color .15s; border-left: 2px solid transparent;
  margin-left: -24px; padding-left: 22px;
}
.toc-sticky a:hover { color: var(--blue); }
.toc-sticky a.active { color: var(--blue); border-left-color: var(--accent); font-weight: 500; }
.toc-sticky a.sub { padding-left: 34px; font-size: 12.5px; }
@media (max-width: 1100px) { .toc-rail { display: none; } .article-grid { grid-template-columns: 1fr minmax(0,760px) 1fr; } }

/* ---------- Breadcrumb ---------- */
.crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint); margin-bottom: 26px; }
.crumb a { color: var(--muted); transition: color .15s; }
.crumb a:hover { color: var(--blue); }
.crumb .sep { opacity: .5; }
.crumb .current { color: var(--ink-2); }

/* ---------- Article header ---------- */
.article-head { margin-bottom: 32px; }
.article-cat { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.article-cat .eyebrow { margin: 0; }
h1.article-title {
  font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -0.03em; line-height: 1.06;
  margin-bottom: 20px;
}
.article-dek { font-size: 20px; color: var(--ink-2); line-height: 1.5; margin-bottom: 28px; }

/* Byline */
.byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; font-weight: 600; font-size: 16px; flex-shrink: 0; border: 1px solid var(--blue-tint-2); overflow: hidden; }
.byline .avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline .by-meta { display: flex; flex-direction: column; gap: 2px; }
.byline .by-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.byline .by-name a:hover { color: var(--blue); }
.byline .by-sub { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.byline .by-sub .di { display: inline-flex; align-items: center; gap: 5px; }
.byline .by-sub svg { width: 13px; height: 13px; opacity: .7; }
.byline .by-actions { margin-left: auto; display: flex; gap: 8px; }
.share-btn { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: all .15s; }
.share-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.share-btn svg { width: 17px; height: 17px; }
@media (max-width: 600px) { .byline .by-actions { margin-left: 0; width: 100%; } }

/* ---------- Hero figure ---------- */
.article-hero { margin: 34px 0; }
.article-hero img, .article-hero .img-ph {
  width: 100%; border-radius: var(--r-lg); border: 1px solid var(--line); display: block;
  aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt);
}
.img-ph { display: grid; place-items: center; color: var(--faint); font-family: 'IBM Plex Mono', monospace; font-size: 13px; text-align: center; gap: 10px; }
.img-ph svg { width: 34px; height: 34px; opacity: .4; }
.article-hero figcaption { margin-top: 12px; font-size: 13.5px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; text-align: center; }

/* ---------- Key takeaways / TL;DR (LLM SEO answer block) ---------- */
.takeaways {
  background: var(--blue-tint); border: 1px solid var(--blue-tint-2); border-radius: var(--r-lg);
  padding: 26px 28px; margin: 0 0 40px;
}
.takeaways h2 {
  font-size: 15px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase;
  color: var(--blue); display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.takeaways h2 svg { width: 18px; height: 18px; }
.takeaways ul { display: grid; gap: 11px; }
.takeaways li { position: relative; padding-left: 26px; font-size: 16px; color: var(--ink-2); line-height: 1.5; }
.takeaways li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.takeaways .answer { font-size: 17px; color: var(--ink); font-weight: 500; margin-bottom: 16px; line-height: 1.55; }

/* ---------- Article body typography ---------- */
.article-body { font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.article-body > * + * { margin-top: 24px; }
.article-body h2 {
  font-size: clamp(24px, 2.8vw, 32px); color: var(--ink); margin-top: 52px; letter-spacing: -0.02em;
  scroll-margin-top: 96px; line-height: 1.15;
}
.article-body h3 {
  font-size: clamp(20px, 2.2vw, 24px); color: var(--ink); margin-top: 40px; scroll-margin-top: 96px;
}
.article-body h2 + p, .article-body h3 + p { margin-top: 14px; }
.article-body p { margin-top: 20px; }
.article-body a:not(.btn) { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: var(--blue-tint-2); transition: text-decoration-color .15s; }
.article-body a:not(.btn):hover { text-decoration-color: var(--blue); }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body ul, .article-body ol { margin-top: 20px; padding-left: 4px; display: grid; gap: 12px; }
.article-body ul li { position: relative; padding-left: 28px; }
.article-body ul li::before { content: ""; position: absolute; left: 6px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.article-body ol { counter-reset: li; padding-left: 0; }
.article-body ol li { position: relative; padding-left: 42px; counter-increment: li; }
.article-body ol li::before { content: counter(li); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 7px; background: var(--blue-tint); color: var(--blue); font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.article-body li { line-height: 1.65; }
.article-body li > ul, .article-body li > ol { margin-top: 12px; }

/* First-paragraph answer styling (LLM SEO: lead with the answer) */
.article-body .lead-answer { font-size: 19px; color: var(--ink); }
.article-body .lead-answer strong { font-weight: 600; }

/* ---------- Definition callout (entity clarity for LLMs) ---------- */
.def-box {
  border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--r);
  background: var(--bg-alt); padding: 20px 24px; margin-top: 28px;
}
.def-box .def-term { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; display: block; }
.def-box p { margin: 0; font-size: 16.5px; }

/* ---------- Stat / highlight callout ---------- */
.stat-callout {
  border: 1px solid var(--accent-tint); border-left: 4px solid var(--accent); border-radius: var(--r);
  background: var(--accent-tint); padding: 20px 24px; margin-top: 28px; display: flex; gap: 18px; align-items: flex-start;
}
.stat-callout .big { font-size: 38px; font-weight: 700; color: var(--orange-600); line-height: 1; letter-spacing: -0.02em; flex-shrink: 0; }
.stat-callout .sc-text { font-size: 15.5px; color: var(--ink-2); }
.stat-callout .sc-text cite { display: block; margin-top: 6px; font-style: normal; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }

/* ---------- Blockquote ---------- */
.article-body blockquote {
  margin: 32px 0; padding: 4px 0 4px 28px; border-left: 4px solid var(--accent);
  font-size: 22px; font-weight: 500; color: var(--ink); line-height: 1.45; letter-spacing: -0.01em;
}
.article-body blockquote cite { display: block; margin-top: 12px; font-size: 14px; font-weight: 400; color: var(--muted); font-style: normal; font-family: 'IBM Plex Mono', monospace; }

/* ---------- Comparison table (highly extractable for LLMs) ---------- */
.table-scroll { margin-top: 28px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 520px; }
.article-body table caption { caption-side: top; text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 18px 0; }
.article-body th, .article-body td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.article-body thead th { background: var(--bg-alt); color: var(--ink); font-weight: 600; font-size: 13.5px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .02em; border-bottom: 1px solid var(--line); }
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body tbody tr:hover { background: var(--bg-alt); }
.article-body td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- Inline figure inside body ---------- */
.body-fig { margin: 32px 0; }
.body-fig img, .body-fig .img-ph { width: 100%; border-radius: var(--r); border: 1px solid var(--line); aspect-ratio: 16/9; object-fit: cover; }
.body-fig figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }

/* ---------- Key-term pills under heading ---------- */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- FAQ (article) ---------- */
.article-faq { margin-top: 64px; padding-top: 8px; }
.article-faq > h2 { font-size: clamp(24px, 2.8vw, 32px); margin-bottom: 8px; }
.article-faq .faq { margin-top: 24px; }

/* ---------- Author bio card (E-E-A-T) ---------- */
.author-card {
  margin-top: 56px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-alt); display: flex; gap: 22px; align-items: flex-start;
}
.author-card .a-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.author-card .a-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card .a-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.author-card .a-name { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.author-card .a-role { font-size: 14px; color: var(--blue); font-family: 'IBM Plex Mono', monospace; margin-bottom: 12px; }
.author-card .a-bio { font-size: 15px; color: var(--muted); line-height: 1.6; }
.author-card .a-links { margin-top: 14px; display: flex; gap: 16px; }
.author-card .a-links a { font-size: 13.5px; color: var(--blue); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.author-card .a-links svg { width: 14px; height: 14px; }
@media (max-width: 560px) { .author-card { flex-direction: column; gap: 16px; } }
.author-card .a-name a { color: inherit; text-decoration: none; }
.author-card .a-name a:hover { color: var(--blue); }

/* ---------- Author profile page ---------- */
.author-profile-hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); margin-bottom: 56px; }
.author-profile-inner { display: flex; gap: 40px; align-items: flex-start; }
.author-avatar-lg { width: 120px; height: 120px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 40px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.author-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.author-profile-meta h1 { font-size: 32px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.author-social { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.author-social a { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink); padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px; transition: border-color .15s, background .15s, color .15s; }
.author-social a svg { width: 14px; height: 14px; flex-shrink: 0; }
.author-social a:hover { border-color: var(--blue); background: var(--blue-tint); color: var(--blue); }
.author-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.author-tags .tag { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; padding: 4px 10px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); }
.author-profile-content { max-width: 780px; margin: 0 auto; padding-bottom: 80px; }
.author-profile-content h2 { font-size: 22px; font-weight: 600; color: var(--ink); margin: 0 0 18px; }
.author-profile-content p { font-size: 16px; color: var(--muted); line-height: 1.75; margin-bottom: 16px; }
@media (max-width: 640px) { .author-profile-inner { flex-direction: column; gap: 24px; } .author-avatar-lg { width: 80px; height: 80px; font-size: 28px; } .author-profile-meta h1 { font-size: 26px; } }

/* ---------- Sources / references ---------- */
.sources { margin-top: 48px; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.sources h2 { font-size: 16px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 16px; }
.sources ol { counter-reset: src; display: grid; gap: 10px; }
.sources li { counter-increment: src; font-size: 14px; color: var(--muted); padding-left: 30px; position: relative; line-height: 1.5; }
.sources li::before { content: "[" counter(src) "]"; position: absolute; left: 0; top: 0; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); font-weight: 600; }
.sources a { color: var(--blue); word-break: break-word; }

/* ---------- CTA banner inside article ---------- */
.article-cta {
  margin-top: 56px; background: var(--bg-deep); color: #fff; border-radius: var(--r-lg);
  padding: 40px 36px; text-align: center; position: relative; overflow: hidden;
}
.article-cta::before { content: ""; position: absolute; inset: 0; opacity: .55;
  background: radial-gradient(500px 280px at 50% -30%, rgba(62,120,219,.5), transparent 60%), radial-gradient(380px 220px at 85% 130%, rgba(242,148,76,.35), transparent 60%); }
.article-cta > * { position: relative; z-index: 1; }
.article-cta h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); margin-bottom: 12px; }
.article-cta p { color: #B7C8E6; font-size: 16.5px; max-width: 520px; margin: 0 auto 24px; }

/* ---------- Related posts ---------- */
.related { margin-top: 80px; }
.related > .eyebrow { margin-bottom: 22px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--blue-tint-2); }
.post-card .pc-img, .post-card .pc-img img { aspect-ratio: 16/9; width: 100%; object-fit: cover; background: var(--bg-alt); display: block; }
.post-card .pc-img { display: grid; place-items: center; color: var(--faint); }
.post-card .pc-img svg { width: 28px; height: 28px; opacity: .4; }
.post-card .pc-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card .pc-cat { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.post-card h3 { font-size: 18px; line-height: 1.25; margin-bottom: 10px; }
.post-card:hover h3 { color: var(--blue); }
.post-card p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.post-card .pc-meta { margin-top: auto; padding-top: 16px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--faint); }
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr; } }

/* ---------- Reading progress bar ---------- */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 200; transition: width .1s linear; }

/* ---------- Mobile TOC (inline) ---------- */
.toc-inline { display: none; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 36px; background: var(--bg-alt); }
.toc-inline summary { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.toc-inline ol { counter-reset: toc; margin-top: 14px; display: grid; gap: 9px; }
.toc-inline li { counter-increment: toc; }
.toc-inline a { font-size: 15px; color: var(--blue); display: flex; gap: 10px; }
.toc-inline a::before { content: counter(toc, decimal-leading-zero); font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--faint); }
@media (max-width: 1100px) { .toc-inline { display: block; } }

/* ---------- Toast (copied link) ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; opacity: 0; visibility: hidden; transition: all .25s var(--ease); z-index: 300; box-shadow: var(--sh-3); }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ============================================================
   BLOG INDEX (listing page)
   ============================================================ */
.blog-hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.blog-hero::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(900px 420px at 80% -20%, var(--blue-tint) 0%, rgba(234,240,251,0) 60%), radial-gradient(560px 320px at 100% 20%, var(--accent-tint) 0%, rgba(253,238,223,0) 55%); }
.blog-hero .container { position: relative; z-index: 1; }
.blog-hero .eyebrow { margin-bottom: 18px; }
.blog-hero h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.03em; max-width: 760px; }
.blog-hero p { margin-top: 18px; font-size: 19px; color: var(--muted); max-width: 620px; }

/* Filter chips */
.blog-filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 36px 0 8px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.filter-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; letter-spacing: .02em;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.filter-chip:hover { border-color: var(--blue-tint-2); color: var(--blue); }
.filter-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Featured post */
.featured { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 40px 0 56px; background: var(--surface); transition: box-shadow .22s var(--ease), border-color .22s; }
.featured:hover { box-shadow: var(--sh-2); border-color: var(--blue-tint-2); }
.featured .f-img { background: var(--bg-deep); position: relative; min-height: 320px; display: grid; place-items: center; overflow: hidden; }
.featured .f-img::before { content: ""; position: absolute; inset: 0; opacity: .6; background: radial-gradient(400px 300px at 30% 20%, rgba(62,120,219,.5), transparent 60%), radial-gradient(360px 240px at 90% 100%, rgba(242,148,76,.4), transparent 60%); }
.featured .f-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.featured .f-img .f-ic { position: relative; z-index: 1; color: rgba(255,255,255,.5); }
.featured .f-img .f-ic svg { width: 56px; height: 56px; }
.featured .f-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.featured .f-tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.featured .f-tag .pill { background: var(--accent-tint); color: var(--orange-600); padding: 4px 10px; border-radius: var(--r-pill); }
.featured h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.12; margin-bottom: 14px; }
.featured:hover h2 { color: var(--blue); }
.featured p { font-size: 16.5px; color: var(--muted); line-height: 1.6; }
.featured .f-meta { margin-top: 22px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint); display: flex; gap: 14px; }
@media (max-width: 820px) { .featured { grid-template-columns: 1fr; } .featured .f-img { min-height: 200px; } .featured .f-body { padding: 30px; } }

/* Post grid (index) */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-grid .post-card.hide { display: none; }
@media (max-width: 920px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-empty { display: none; text-align: center; padding: 60px 0; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
