/* ═══════════════════════════════════════════════════════════════════════════
   BLOG / TECHNICAL JOURNAL STYLESHEET — SPARSH SHARMA
   THEME: NEO-BRUTALIST CHERRY RED & ABSOLUTE BLACK
   TYPOGRAPHY: PLUS JAKARTA SANS (900/800) + JETBRAINS MONO
   ZERO BORDER RADIUS / PRECISION GRID SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.blog-hero {
  padding: clamp(7rem, 12vw, 10rem) 0 clamp(2.5rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
  background: #000000;
  border-bottom: 1px solid var(--border);
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(210, 4, 45, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blog-hero-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cherry);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-hero-tag::before {
  content: '//';
  opacity: 0.6;
}

.blog-hero-title {
  font-family: var(--sans);
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 0.95;
  color: var(--t1);
  margin: 0;
}

.blog-hero-sub {
  color: var(--t2);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 620px;
  font-weight: 400;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.blog-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0px;
  background: #000000;
  color: var(--t3);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-filter:hover {
  border-color: var(--border-strong);
  color: var(--t1);
  background: rgba(255, 255, 255, 0.03);
}

.blog-filter.active {
  border-color: var(--cherry);
  background: rgba(210, 4, 45, 0.12);
  color: #ffffff;
  box-shadow: inset 2px 0 0 var(--cherry);
}

/* ── Article Card Grid ────────────────────────────────────────────────────── */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.blog-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) 1.5rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: #000000;
  border-radius: 0px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cherry);
  opacity: 0;
  transform: scaleY(0);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  background: #080808;
  border-color: var(--border-strong);
}

.blog-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.blog-card:hover .blog-card-title {
  color: var(--cherry);
}

.blog-card:hover .blog-card-arrow {
  transform: translate(3px, -3px);
  color: var(--cherry);
  opacity: 1;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--t3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.blog-card-meta .dot {
  width: 4px;
  height: 4px;
  background: var(--cherry);
  flex-shrink: 0;
  border-radius: 0px;
}

.blog-card-title {
  font-family: var(--sans);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 800;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin: 0;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card-excerpt {
  color: var(--t2);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 680px;
  margin: 0;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.blog-card-tags span {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0px;
  background: #050505;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.blog-card:hover .blog-card-tags span {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--t2);
}

.blog-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
  padding-top: 0.25rem;
}

.blog-card-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cherry);
  letter-spacing: 0.12em;
}

.blog-card-arrow {
  color: var(--t3);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s, opacity 0.2s;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE SINGLE VIEW STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Article Toolbar ──────────────────────────────────────────────────────── */
.article-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.85rem 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.article-toolbar-inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--t2);
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.article-back:hover {
  color: var(--cherry);
}

.article-back svg {
  transition: transform 0.2s;
}

.article-back:hover svg {
  transform: translateX(-3px);
}

.article-toolbar-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: 50%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ── Reading Progress Bar ─────────────────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cherry);
  box-shadow: 0 0 8px var(--cherry);
  transition: width 0.08s linear;
}

/* ── Article Layout ───────────────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px) 1fr;
  gap: 4rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 7.5rem 1.5rem 6rem;
  position: relative;
}

/* ── Table of Contents (Sticky Sidebar) ───────────────────────────────────── */
.article-toc {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding-right: 1rem;
}

.article-toc-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--cherry);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: block;
}

.article-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
}

.article-toc-list a {
  display: block;
  padding: 0.45rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--t3);
  text-decoration: none;
  border-left: 2px solid var(--border);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.5;
}

.article-toc-list a:hover {
  color: var(--t1);
  border-left-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.article-toc-list a.active {
  color: #ffffff;
  border-left-color: var(--cherry);
  background: rgba(210, 4, 45, 0.06);
  font-weight: 600;
}

/* ── Article Header ───────────────────────────────────────────────────────── */
.article-header {
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.article-category {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cherry);
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(210, 4, 45, 0.3);
  border-radius: 0px;
  width: fit-content;
  background: rgba(210, 4, 45, 0.08);
}

.article-title {
  font-family: var(--sans);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--t1);
  margin: 0;
}

.article-subtitle {
  color: var(--t2);
  font-size: 1.12rem;
  line-height: 1.7;
  max-width: 660px;
  margin: 0;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-author-img {
  width: 32px;
  height: 32px;
  border-radius: 0px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-strong);
  filter: brightness(0.85) contrast(1.1);
}

.article-author-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.article-meta-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.article-meta-item {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--t3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Article Prose ────────────────────────────────────────────────────────── */
.article-prose {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--t2);
}

.article-prose h2 {
  font-family: var(--sans);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin-top: 3.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5.5rem;
}

.article-prose h3 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
  scroll-margin-top: 5.5rem;
}

.article-prose p {
  margin-bottom: 1.5rem;
}

.article-prose strong {
  color: var(--t1);
  font-weight: 700;
}

.article-prose a {
  color: var(--cherry);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(210, 4, 45, 0.4);
  transition: text-decoration-color 0.2s, color 0.2s;
}

.article-prose a:hover {
  text-decoration-color: var(--cherry);
  color: #ff4d6d;
}

.article-prose ul,
.article-prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-prose ul {
  list-style: none;
}

.article-prose ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
}

.article-prose ul li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--cherry);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.article-prose ol li {
  margin-bottom: 0.6rem;
}

.article-prose img {
  width: 100%;
  border-radius: 0px;
  border: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Code Blocks ──────────────────────────────────────────────────────────── */
.article-prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: #ff6b81;
  background: rgba(210, 4, 45, 0.08);
  padding: 0.18rem 0.5rem;
  border-radius: 0px;
  border: 1px solid rgba(210, 4, 45, 0.22);
}

.article-prose pre {
  background: #080808;
  border: 1px solid var(--border);
  border-radius: 0px;
  padding: 1.6rem;
  overflow-x: auto;
  margin: 2rem 0;
  position: relative;
}

.article-prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--t2);
  font-size: 0.82rem;
  line-height: 1.7;
  display: block;
}

.code-label {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--t3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ── Syntax Highlighting Colors ───────────────────────────────────────────── */
.article-prose pre .kw   { color: #ff5277; font-weight: 600; }  /* keywords */
.article-prose pre .fn   { color: #60a5fa; }                   /* functions */
.article-prose pre .str  { color: #4ade80; }                   /* strings */
.article-prose pre .num  { color: #fb923c; }                   /* numbers */
.article-prose pre .cmt  { color: #52525b; font-style: italic; }/* comments */
.article-prose pre .op   { color: #f43f5e; }                   /* operators */
.article-prose pre .cls  { color: #facc15; }                   /* class names */
.article-prose pre .dec  { color: #e879f9; }                   /* decorators */
.article-prose pre .self { color: #f87171; }                   /* self/this */
.article-prose pre .param{ color: #e4e4e7; }                   /* parameters */

/* ── Pull Quotes ──────────────────────────────────────────────────────────── */
.article-prose blockquote {
  margin: 2.5rem 0;
  padding: 1.6rem 2rem;
  border-left: 3px solid var(--cherry);
  background: rgba(210, 4, 45, 0.04);
  border-radius: 0px;
  font-size: 1.08rem;
  font-style: normal;
  color: var(--t1);
  line-height: 1.7;
}

.article-prose blockquote p {
  margin-bottom: 0;
}

/* ── Key Takeaway / Callout Box ───────────────────────────────────────────── */
.article-callout {
  margin: 2.2rem 0;
  padding: 1.6rem 2rem;
  border: 1px solid rgba(210, 4, 45, 0.25);
  border-left: 3px solid var(--cherry);
  border-radius: 0px;
  background: #080808;
}

.article-callout-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cherry);
  margin-bottom: 0.6rem;
  display: block;
}

.article-callout p {
  color: var(--t2);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0 !important;
}

/* ── Crosslink Section ────────────────────────────────────────────────────── */
.article-crosslink {
  margin-top: 2rem;
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cherry);
  border-radius: 0px;
  background: #080808;
}

.article-crosslink h3 {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.article-crosslink p {
  color: var(--t2);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-crosslink a {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cherry);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.article-crosslink a:hover {
  color: #ff4d6d;
  transform: translateX(3px);
}

/* ── Article Footer ───────────────────────────────────────────────────────── */
.article-footer {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.article-footer-author {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 0px;
  background: #080808;
}

.article-footer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 0px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-strong);
  filter: brightness(0.85) contrast(1.1);
  flex-shrink: 0;
}

.article-footer-bio {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.article-footer-name {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.article-footer-desc {
  font-size: 0.85rem;
  color: var(--t2);
  line-height: 1.5;
}

/* ── Prev / Next Article Nav ──────────────────────────────────────────────── */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.article-nav-link {
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 0px;
  background: #000000;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-nav-link:hover {
  border-color: var(--cherry);
  background: #080808;
}

.article-nav-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--cherry);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-nav-title {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.article-nav-link:hover .article-nav-title {
  color: var(--cherry);
}

.article-nav-link.next {
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    max-width: 720px;
    gap: 0;
  }
  .article-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .blog-card {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 1.8rem 1rem;
  }
  .blog-card-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .article-layout {
    padding: 5.5rem 1rem 4rem;
  }
  .article-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }
  .article-meta-row {
    flex-wrap: wrap;
    gap: 0.85rem;
  }
  .article-nav {
    grid-template-columns: 1fr;
  }
  .article-nav-link.next {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .blog-hero-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }
  .blog-card-title {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }
  .article-prose {
    font-size: 0.98rem;
  }
  .article-prose h2 {
    font-size: 1.35rem;
  }
  .article-prose pre {
    padding: 1.2rem 1rem;
    border-radius: 0px;
  }
  .article-prose blockquote {
    padding: 1.2rem 1.4rem;
  }
  .article-toolbar-title {
    display: none;
  }
}
