:root {
  --bg: #06080d;
  --bg-soft: #0a0d14;
  --text: #ebeff6;
  --muted: #a7afbf;
  --card: #0d1017;
  --brand: #6405fc;
  --brand-strong: #6405fc;
  --border: #1a1f2a;
  --paper: #efeee9;
  --ink: #0d1420;
  --ink-soft: #2c3748;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  padding-top: 100px;
}

/* Shared stylesheet also adds navbar offset; reset it here to avoid double top gap */
header.navbar + * {
  padding-top: 0 !important;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.post-content a {
  font-size: 1.08em;
  font-weight: 600;
}

.blog-main,
.blog-post-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.blog-listing-head {
  background: linear-gradient(140deg, #0b1427 0%, #0a1122 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
}

.blog-listing-head h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.blog-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin: 16px 0;
}

.blog-search input,
.blog-search select,
.blog-search button {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a1222;
  color: var(--text);
}

.blog-search button {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.tag {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted);
}

.tag.active {
  background: #0e2138;
  color: #7bbdff;
  border-color: #245080;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.blog-card {
  background: linear-gradient(160deg, #0c1426 0%, #0a1020 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: #284679;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.blog-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.blog-card-body { padding: 14px; }
.meta { color: var(--muted); font-size: 1rem; }

.blog-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.blog-meta-tags span {
  font-size: 0.8rem;
  background: #111b29;
  border-radius: 14px;
  padding: 4px 10px;
  color: #a9ceff;
}

.pagination {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 26px 0;
}

.blog-post {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #06090f;
  border: 0;
  border-radius: 0;
  padding: 0;
}

/* Prevent shared site CSS from breaking article structure */
.blog-post > header,
.blog-post > .post-header {
  display: block !important;
  height: auto;
  background: transparent;
  border: 0;
  margin: 0 0 12px;
  padding: 0;
  width: 100%;
  align-items: initial;
  justify-content: initial;
}

.post-header {
  display: block !important;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  margin-bottom: 0 !important;
  overflow: hidden;
}

.post-hero {
  position: relative;
  min-height: clamp(460px, 62vh, 760px);
  border-bottom: 1px solid #171c27;
  border-radius: 0;
  overflow: hidden;
  background: #070b11;
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(2, 4, 10, 0.95) 8%, rgba(2, 4, 10, 0.72) 32%, rgba(2, 4, 10, 0.28) 56%, rgba(2, 4, 10, 0) 80%),
    linear-gradient(to right, rgba(2, 4, 10, 0.6) 8%, rgba(2, 4, 10, 0.12) 56%, rgba(2, 4, 10, 0.4) 100%);
  z-index: 1;
}

.post-hero-content {
  position: absolute;
  left: clamp(20px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(18px, 4vh, 42px);
  z-index: 2;
  max-width: 760px;
}

.post-hero-content h1,
.post-hero-content .lead,
.post-hero-content .author,
.post-hero-content .meta {
  color: #ffffff;
}

.post-hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.author-badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6405fc;
  color: #0b0f17;
  font-size: 0.9rem;
  font-weight: 700;
}

.meta-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #99a3b7;
  font-size: 0.97rem;
}

.blog-post h1,
.blog-post h2,
.blog-post h3,
.blog-post p {
  margin: 0 10px 12px;
}

.blog-post h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.6vw, 3.8rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-left: 0;
  margin-right: 0;
  max-width: 22ch;
}

.blog-post .post-hero-content h1,
.blog-post .post-hero-content .lead,
.blog-post .post-hero-content .author,
.blog-post .post-hero-content .meta {
  color: #ffffff !important;
}

h1.post-hero-title {
  color: #ffffff !important;
}

.blog-post .lead {
  font-size: clamp(1.06rem, 1.6vw, 1.55rem);
  color: #c2cbda;
  max-width: 58ch;
  margin-left: 0;
  margin-right: 0;
}

.blog-post .author {
  color: #c7cedd;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

.blog-post .meta {
  color: #d4deee;
  margin-left: 0;
  margin-right: 0;
}

.blog-post .meta,
.blog-post .lead,
.blog-post .author,
.blog-post .post-cover {
  display: block !important;
  float: none !important;
  max-width: 100%;
}

.post-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  border: 0;
}

.toc {
  background: transparent;
  border: 0;
  padding: 24px 28px;
  border-radius: 0;
  margin: 0;
}

.toc h2 {
  margin-bottom: 18px;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #586175;
  font-weight: 500;
}
.toc ul { margin: 0; padding-left: 0; list-style: none; counter-reset: toc; }
.toc li { margin: 12px 0; counter-increment: toc; }
.toc a {
  color: #8f98aa;
  font-size: 1.06rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: #6405fc;
  font-weight: 700;
  min-width: 26px;
}
.toc a:hover {
  color: #e8edf7;
}

.post-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  background: #05080d;
}

.post-layout .toc {
  position: sticky;
  top: 120px;
  width: 260px;
  height: calc(100vh - 120px);
  max-height: calc(100vh - 120px);
  overflow: hidden;
  border-right: 1px solid #171c27;
  scrollbar-width: thin;
  scrollbar-color: #2b3342 transparent;
}

.post-layout .toc::-webkit-scrollbar {
  width: 8px;
}

.post-layout .toc::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.post-layout .toc::-webkit-scrollbar-thumb {
  background: #2b3342;
  border-radius: 999px;
}

.post-content {
  color: var(--ink-soft);
  font-size: 1.3rem;
  background: var(--paper);
  padding: clamp(26px, 4vw, 52px);
  min-height: 78vh;
}

.post-content h2,
.post-content h3 {
  scroll-margin-top: 84px;
}

.post-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--ink);
}

.post-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  margin-top: 22px;
  margin-bottom: 10px;
  color: var(--ink);
}

.post-content p,
.post-content li { color: var(--ink-soft); }

.post-content ul li::marker,
.post-content ol li::marker {
  color: #6405fc;
}

.post-content ul,
.post-content ol { padding-left: 22px; }

.post-content blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid #6405fc;
  background: #e5e6df;
  border-radius: 10px;
  color: #2f3847;
}

.post-content pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #0f141b;
  border: 1px solid #1d2530;
}

.cta {
  margin: 0;
  border: 0;
  border-top: 1px solid #d5d7ce;
  background: var(--paper);
  border-radius: 0;
  padding: 24px clamp(26px, 4vw, 52px) 8px;
  color: var(--ink-soft);
}
.cta h2{
  font-size:2rem;
}
.cta p{
  font-size:1.4rem;
}

.cta-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #111722;
  color: #f3f6fc;
  font-weight: 600;
}

.cta-btn:hover {
  background: #1d2738;
  text-decoration: none;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  background: var(--paper);
  padding: 10px clamp(26px, 4vw, 52px) 28px;
}

.share-row button,
.share-row a {
  padding: 8px 12px;
  border: 1px solid #d2d6df;
  border-radius: 8px;
  background: #f7f8fb;
  color: #222d3e;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--brand);
  z-index: 45;
}

.related {
  margin-top: 0;
  padding: 30px 24px;
  background: #05080d;
}

.related h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

header.navbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1200;
}

.blog-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-layout { grid-template-columns: 1fr; }
  .post-layout .toc {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #171c27;
    padding: 18px 16px;
  }
  .post-content {
    padding: 24px 16px;
    min-height: auto;
  }
  .post-hero { min-height: clamp(320px, 48vh, 520px); }
}

@media (max-width: 680px) {
  .blog-search { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-main,
  .blog-post-wrap { padding: 0; }
  .blog-post { padding: 0; }
  .post-hero-content {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .blog-post h1 {
    font-size: clamp(1.85rem, 9vw, 2.4rem);
    max-width: 100%;
  }
  .blog-post .lead {
    font-size: 1.03rem;
  }
  .author-badge {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }
  body {
    padding-top: 80px;
  }
}
