/* ===== Blog Post Layout ===== */
.blog-article{
  max-width: 880px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
}
.blog-header{
  text-align: center;
  margin: 1rem 0 1rem;
}
.blog-header h1{
  margin: 0 0 .4rem;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: .1em;
}
.blog-header .meta{
  color: #475569;         /* slate-600 */
  font-size: .95rem;
}

/* Hero image */
.blog-image{
  margin: 0 auto 1.25rem;
  display: flex;
  justify-content: center;
}
.blog-image img{
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 12px;
  background: #0b1220;    /* avoids flash on slow nets */
  box-shadow: 0 6px 18px rgba(2,6,23,.18);
}

/* Body content */
.blog-content{
  background: #ffffff;
  color: #0f172a;         /* slate-900 */
  border: 1px solid rgba(2,6,23,.06);
  border-radius: 12px;
  padding: 1.25rem 1.25rem;
}

/* Typography inside article */
.blog-content h2{ font-size: 1.35rem; margin: 1.25rem 0 .5rem; letter-spacing: 0.1em; }
.blog-content h3{ font-size: 1.15rem; margin: 1rem 0 .4rem; }
.blog-content p{ line-height: 1.7; margin: .8rem 0; }
.blog-content ul, .blog-content ol{ padding-left: 1.25rem; margin: .6rem 0; }
.blog-content li{ margin: .35rem 0; }
.blog-content a{ color: #1f6feb; text-decoration: none; }
.blog-content a:hover{ text-decoration: underline; }
.blog-content blockquote{
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid #93c5fd;
  background: #f1f5f9;
  border-radius: 8px;
}
.blog-content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
  padding: .1rem .3rem;
  border-radius: 4px;
  background: #f3f4f6;
  border: 1px solid rgba(0,0,0,.06);
}
.blog-content pre{
  overflow: auto;
  padding: .75rem 1rem;
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 10px;
  border: 1px solid #1f2937;
}
.back-link{
  margin: 1rem 0 0;
  text-align: left;
}
.back-link a{ color: #1f6feb; }

/* ===== Dark Mode (OS) ===== */
@media (prefers-color-scheme: dark){
  .blog-header .meta{ color: #9aa4b2; }
  .blog-content{
    background: #0f172a;
    color: #e5e7eb;
    border-color: #1e293b;
  }
  .blog-content a{ color: #93c5fd; }
  .blog-content blockquote{
    background: #0b1220;
    border-left-color: #3b82f6;
  }
  .blog-content code{
    background: #0b1220;
    border-color: #1e293b;
    color: #e5e7eb;
  }
  .back-link a{ color: #93c5fd; }
  .blog-image img{ box-shadow: 0 6px 18px rgba(0,0,0,.45); }
}

/* ===== Dark Mode (explicit toggle via html.dark-mode) ===== */
html.dark-mode .blog-header .meta{ color: #9aa4b2; }
html.dark-mode .blog-content{
  background: #0f172a;
  color: #e5e7eb;
  border-color: #1e293b;
}
html.dark-mode .blog-content a{ color: #93c5fd; }
html.dark-mode .blog-content blockquote{
  background: #0b1220;
  border-left-color: #3b82f6;
}
html.dark-mode .blog-content code{
  background: #0b1220;
  border-color: #1e293b;
  color: #e5e7eb;
}
html.dark-mode .back-link a{ color: #93c5fd; }
html.dark-mode .blog-image img{ box-shadow: 0 6px 18px rgba(0,0,0,.45); }
