/* ============================================================
   Blog-specific stylesheet for Nike353.github.io
   Extends stylesheet.css — import that first, then this.
   ============================================================ */

/* ---- Base reset for blog pages ---- */
*, *::before, *::after { box-sizing: border-box; }

body.blog-body {
  background: #fafafa;
  color: #1a1a1a;
  line-height: 1.75;
}

/* ---- Site nav bar ---- */
.site-nav {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

.site-nav a { color: #333; text-decoration: none; }
.site-nav a:hover { color: #1772d0; }
.site-nav .sep { color: #bbb; }
.site-nav .nav-home { font-weight: 700; }
.site-nav .nav-current { color: #1772d0; }

/* ---- Page wrapper ---- */
.blog-page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ============================================================
   BLOG INDEX PAGE
   ============================================================ */

.blog-index-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 40px;
}

.blog-index-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
}

.blog-index-header p {
  color: #555;
  font-size: 15px;
  margin: 0;
}

.post-list { list-style: none; padding: 0; margin: 0; }

.post-card {
  padding: 28px 0;
  border-bottom: 1px solid #efefef;
}

.post-card:last-child { border-bottom: none; }

.post-card-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-card-meta .dot { color: #ccc; }

.post-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
}

.post-card h2 a { color: #1a1a1a; text-decoration: none; }
.post-card h2 a:hover { color: #1772d0; }

.post-card-excerpt {
  font-size: 15px;
  color: #444;
  margin: 0 0 12px;
  line-height: 1.6;
}

.post-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: #eef3fc;
  color: #1772d0;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 12px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
}

.read-more {
  font-size: 14px;
  color: #1772d0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-weight: 600;
}

.read-more:hover { color: #f09228; }

/* ============================================================
   BLOG POST PAGE
   ============================================================ */

/* Two-column layout: TOC left, content right */
.post-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}

/* ---- TOC (left column) ---- */
.toc-sidebar {
  position: sticky;
  top: 62px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-right: 8px;
}

.toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 10px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 2px;
}

.toc-list a {
  font-size: 13.5px;
  color: #555;
  text-decoration: none;
  display: block;
  padding: 3px 8px 3px 0;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

.toc-list a:hover { color: #1772d0; border-left-color: #ccd9f5; }
.toc-list a.active { color: #1772d0; border-left-color: #1772d0; font-weight: 600; }

.toc-list .toc-h3 a { padding-left: 12px; font-size: 12.5px; }

/* ---- Post content (right column) ---- */
.post-content-col { min-width: 0; }

/* ---- Post header ---- */
.post-header { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid #e8e8e8; }

.post-header .post-series {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1772d0;
  margin-bottom: 10px;
}

.post-header h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 12px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  color: #111;
}

.post-header .post-subtitle {
  font-size: 17px;
  color: #555;
  font-style: italic;
  margin: 0 0 16px;
  line-height: 1.5;
}

.post-header .post-meta {
  font-size: 13px;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.post-header .post-meta .sep { color: #ccc; }
.post-header .post-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }

/* ---- Post body typography ---- */
.post-body {
  font-size: 16px;
  line-height: 1.8;
  color: #222;
}

.post-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 2.4em 0 0.7em;
  padding-top: 0.4em;
  color: #111;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 6px;
}

.post-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 1.8em 0 0.5em;
  color: #222;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
}

.post-body p { margin: 0 0 1.1em; }

.post-body ul, .post-body ol {
  margin: 0 0 1.1em 1.4em;
  padding: 0;
}

.post-body li { margin-bottom: 0.35em; }

.post-body a { color: #1772d0; text-decoration: underline; text-decoration-color: #ccd9f5; }
.post-body a:hover { color: #f09228; text-decoration-color: #f09228; }

.post-body strong { font-weight: 700; }

.post-body em { font-style: italic; }

/* ---- Callout / Key Insight boxes ---- */
.callout {
  background: #eef3fc;
  border-left: 4px solid #1772d0;
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 15px;
}

.callout.warning {
  background: #fff8e8;
  border-left-color: #f09228;
}

.callout.insight {
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

.callout-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #1772d0;
}

.callout.warning .callout-label { color: #c26e00; }
.callout.insight .callout-label { color: #2e7d32; }

/* ---- Math display ---- */
.post-body .math-display {
  overflow-x: auto;
  margin: 20px 0;
  padding: 4px 0;
}

/* ---- Code blocks ---- */
.post-body code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: #c7254e;
}

.post-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- Series navigator ---- */
.series-nav {
  margin-top: 48px;
  padding: 20px 24px;
  background: #f5f7fa;
  border-radius: 8px;
  border: 1px solid #e0e4ec;
}

.series-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}

.series-nav-title {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.series-post-list { list-style: none; padding: 0; margin: 0; }

.series-post-list li {
  font-size: 14px;
  padding: 4px 0;
  color: #555;
}

.series-post-list li.current { font-weight: 700; color: #1772d0; }
.series-post-list li.current::before { content: "▶ "; }

/* ---- References ---- */
.references {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e8e8e8;
}

.references h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
}

.references ol {
  margin: 0;
  padding-left: 20px;
}

.references li {
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
  line-height: 1.5;
}

.references a { color: #1772d0; }

/* ---- Footer ---- */
.post-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #efefef;
  font-size: 13px;
  color: #999;
  text-align: right;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 800px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 32px;
    background: #f5f7fa;
    border-radius: 8px;
    padding: 16px 20px;
  }

  .toc-label { margin-bottom: 8px; }

  .toc-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .toc-list li { margin: 0; }
  .toc-list a {
    border-left: none;
    border-radius: 4px;
    background: #e8edf7;
    padding: 3px 10px;
    font-size: 12px;
  }
  .toc-list .toc-h3 { display: none; }

  .post-header h1 { font-size: 24px; }
}

@media (max-width: 500px) {
  .blog-page { padding: 0 16px 60px; }
  .site-nav-inner { padding: 0 16px; }
  .post-header h1 { font-size: 21px; }
  .post-body { font-size: 15px; }
}
