/* GraphSlice blog — layout + markdown typography.
   Builds on the design tokens in styles.css; no external assets. */

/* ---------- Page backdrop (static twin of the landing page gradient) ---------- */
.blog-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 70% -10%, #101b2e 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.blog-main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.dot-sep { color: var(--muted-2); padding: 0 2px; }

/* ---------- Post navigation bar (newer / all / older) ----------
   Floats at the bottom of the viewport while reading, then settles in
   place above the footer once you reach the end of the stream. */
.post-nav {
  position: sticky;
  bottom: 0;
  z-index: 15;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 23, .9);
  backdrop-filter: blur(8px);
  box-shadow: 0 -10px 28px -16px rgba(0, 0, 0, .7);
}
.post-nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pn-slot { display: flex; min-width: 0; flex: 1; }
.pn-slot-older { justify-content: flex-end; }
.pn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s var(--ease);
}
.pn-link:hover { color: var(--text); }
.pn-link:hover .pn-arrow { color: var(--accent); }
.pn-arrow { color: var(--muted-2); font-size: 16px; transition: color .15s; }
.pn-text { display: flex; flex-direction: column; min-width: 0; }
.pn-slot-older .pn-text { text-align: right; }
.pn-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
}
.pn-title {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pn-disabled { opacity: .35; }
.pn-all {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  transition: color .15s, border-color .15s;
}
.pn-all:hover { color: var(--text); border-color: var(--accent); }

@media (max-width: 720px) {
  .pn-title { display: none; }
  .pn-text { flex-direction: row; }
}

/* ---------- Two-column post layout ---------- */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 56px;
  align-items: start;
  padding: 40px 0 80px;
}
.post-stream { min-width: 0; max-width: 72ch; }

/* Right column: floating table of contents */
.post-aside {
  position: sticky;
  top: 88px;              /* just below the sticky site header */
  display: grid;
  gap: 20px;
}
.toc {
  border-left: 1px solid var(--border);
  padding-left: 18px;
  font-size: 13.5px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-post-title {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.toc-title {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  margin: 0 0 12px;
}
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list ol { padding-left: 14px; margin-top: 7px; }
.toc-list li { margin-bottom: 8px; }
.toc-list a {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  transition: color .15s var(--ease);
}
.toc-list a:hover { color: var(--text); }
.toc-list a.active { color: var(--accent); }
.aside-links { display: grid; gap: 8px; padding-left: 18px; }
.aside-link { color: var(--muted-2); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.aside-link:hover { color: var(--text); }

/* Inline (mobile) TOC */
.toc-inline { display: none; }

@media (max-width: 1023px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-aside { display: none; }
  .toc-inline {
    display: block;
    margin: 0 0 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    padding: 12px 16px;
    font-size: 14px;
  }
  .toc-inline summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11.5px;
  }
  .toc-inline .toc-list { margin-top: 12px; }
}

/* ---------- Post header ---------- */
.post-head { margin-bottom: 28px; }
.post-title { font-size: clamp(30px, 4.6vw, 44px); margin: 12px 0 16px; }
.post-meta { color: var(--muted-2); font-size: 14px; }
.post-meta a { color: var(--muted-2); text-decoration: underline; text-underline-offset: 2px; }
.post-meta a:hover { color: var(--text); }
.post-lede { color: var(--muted); font-size: 19px; margin-top: 14px; max-width: 60ch; }

/* ---------- Markdown body typography ---------- */
.post-body { color: var(--muted); font-size: 17.5px; line-height: 1.75; }
.post-body h2 {
  color: var(--text);
  font-size: 27px;
  margin: 46px 0 14px;
  scroll-margin-top: 88px;
}
.post-body h3 {
  color: var(--text);
  font-size: 20px;
  margin: 34px 0 10px;
  scroll-margin-top: 88px;
}
.post-body h4 { color: var(--text); font-size: 17.5px; margin: 28px 0 8px; }
.post-body p { margin: 0 0 18px; }
.post-body strong { color: var(--text); }
.post-body em strong, .post-body strong em { color: var(--text); }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--accent-3); }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 26px; }
.post-body li { margin-bottom: 8px; }
.post-body li::marker { color: var(--accent); }
.post-body code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: .86em;
  color: var(--text);
  background: rgba(77, 139, 255, .10);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
.post-body pre {
  background: #05080e;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin: 0 0 22px;
  overflow-x: auto;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #c7d2e3;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 18px;
  padding: 4px 0 4px 18px;
  color: var(--muted);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 15px;
}
.post-body th, .post-body td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.post-body th { color: var(--text); background: var(--panel-2); font-weight: 600; }
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* ---------- Continuous reading ---------- */
.post-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 64px 0;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.post-divider::before, .post-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
/* ---------- Blog index ---------- */
.blog-hero { padding: 56px 0 40px; max-width: 720px; }
.blog-hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 12px 0 18px; }
.post-cards { display: grid; gap: 18px; max-width: 780px; padding-bottom: 80px; }
.post-card {
  display: block;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.post-card:hover { border-color: var(--border-2); transform: translateY(-3px); }
.post-card-meta { color: var(--muted-2); font-size: 13.5px; margin-bottom: 8px; }
.post-card-title { font-size: 22px; color: var(--text); margin-bottom: 10px; }
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-desc { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.post-card-more {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.cards-sentinel { height: 1px; }
