/* ==========================================================================
   Blog enhancements — layered on top of each post's inline styles.
   Loaded AFTER the inline <style> so these rules win where they overlap.
   Covers: sticky scrollspy TOC sidebar, author/share footer, related cards.
   ========================================================================== */

/* --- Desktop: turn the inline TOC into a sticky left rail beside the prose --- */
@media (min-width: 1000px) {
  .article-wrap > .container {
    max-width: 1060px;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }
  /* everything flows into the content column by default... */
  .article-wrap > .container > * { grid-column: 2; }
  /* ...except the TOC, which owns the left rail and spans the rows */
  .article-wrap > .container > .toc {
    grid-column: 1;
    grid-row: 1 / 1000;
    position: sticky;
    top: 92px;
    align-self: start;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
  }
  .article-wrap > .container > .toc ol {
    list-style: none;
    padding-left: 0;
    border-left: 2px solid var(--rule);
    gap: 2px;
  }
  .article-wrap > .container > .toc li { margin: 0; }
  .article-wrap > .container > .toc a {
    display: block;
    padding: 7px 0 7px 16px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--ink-dim);
    font-size: 13.5px;
    line-height: 1.4;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .article-wrap > .container > .toc a:hover { color: var(--ink-2); }
  .article-wrap > .container > .toc a.is-active {
    color: var(--accent-deep);
    border-left-color: var(--accent-2);
    font-weight: 600;
  }
}

/* --- Quick answer box: the labeled, self-contained answer to the post's
       headline question — the prime featured-snippet / AI Overview target --- */
.quick-answer {
  border: 1px solid rgba(99,102,241,0.2);
  background: linear-gradient(135deg, var(--accent-soft), #f3f0ff);
  border-radius: var(--radius-lg);
  padding: 22px 26px; margin: 0 0 30px;
}
.quick-answer .qa-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 9px;
}
.quick-answer .qa-label::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
}
.quick-answer p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); font-weight: 500; }
.quick-answer p strong { font-weight: 700; }

/* --- Author / share / updated footer (all viewports) --- */
.post-foot { max-width: 768px; margin: 0 auto; }
.post-author {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  background: var(--bg-1); padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.post-author .pa-avatar {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  display: inline-flex; align-items: center; justify-content: center;
}
.post-author .pa-avatar svg { width: 24px; height: 24px; }
.post-author .pa-name { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 16px; }
.post-author .pa-bio { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 4px; }
.post-author .pa-meta { color: var(--ink-dim); font-size: 12.5px; margin-top: 8px; }
.post-share { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.post-share .ps-label { font-size: 12.5px; color: var(--ink-dim); margin-right: 2px; }
.post-share a, .post-share button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--rule); background: white; color: var(--ink-2);
  font-family: var(--body); font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all 0.15s ease;
}
.post-share a:hover, .post-share button:hover { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; transform: translateY(-1px); }
.post-share svg { width: 15px; height: 15px; }
.post-share .ps-copied { color: #047857; }

/* --- Rich related-post cards --- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related-card {
  display: flex; flex-direction: column; gap: 8px;
  background: white; border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--rule-2); }
.related-card .rc-cat { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); }
.related-card h3 { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; color: var(--ink); margin: 0; }
.related-card p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr; } }
