/* ==========================================================================
   BLOG & SINGLE POST STYLES (REFINED - IBM CANVAS INSPIRED)
   ========================================================================== */

/* Blog Hero Layout */
.section-blog-hero {
  position: relative;
  padding-top: 12rem;
  padding-bottom: 6rem;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.section-blog-hero .hero-glow-1 {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 60%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

.section-blog-hero .container {
  position: relative;
  z-index: 2;
}

.section-blog-hero .hero-content {
  max-width: 920px;
  margin-inline: auto;
  text-align: center;
}

@media (max-width: 767px) {
  .section-blog-hero {
    padding-top: 82px;
    padding-bottom: 72px;
  }

  .section-blog-hero .hero-glow-1 {
    top: -12%;
    width: 520px;
    height: 520px;
    filter: blur(64px);
  }

  .section-blog-hero .display-md {
    font-size: clamp(36px, 10vw, 44px);
    line-height: 1.08;
  }

  .section-blog-hero .body-lg {
    font-size: 17px;
    line-height: 1.58;
  }

  .blog-grid {
    gap: 1.5rem;
  }
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

/* Base Post Card */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

/* ZERO float animation per brand lock. Only subtle border/shadow/filter */
.blog-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-soft);
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.blog-layout__main .blog-grid .blog-card:not(:first-child):not(:nth-child(n + 6)) .blog-card-image {
  height: clamp(180px, 18vw, 230px);
  aspect-ratio: auto;
}

.blog-card:hover .blog-card-image img {
  opacity: 0.9;
}

.blog-card-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-meta {
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.72rem;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.65rem;
}

.blog-meta > * {
  min-width: 0;
}

.blog-card-category {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid rgba(70, 95, 255, 0.32);
  border-radius: 999px;
  background: rgba(70, 95, 255, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.blog-card-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink);
  margin: 0 0 0.75rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--brand-accent);
}

.blog-card-excerpt {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.94rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blog-card-excerpt p {
  margin: 0;
}

.blog-card-footer {
  margin-top: auto;
  border-top: 1px dashed var(--hairline);
  padding-top: 0.9rem;
}

.blog-card-footer .btn-link {
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.blog-card-footer .btn-link svg {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-card-footer .btn-link {
  color: var(--brand-accent);
}

.blog-card:hover .blog-card-footer .btn-link svg {
  transform: translateX(4px);
}

.blog-layout__main .blog-grid .blog-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 320px;
}

.blog-layout__main .blog-grid .blog-card:first-child .blog-card-image {
  height: 100%;
  aspect-ratio: auto;
  border-right: 1px solid var(--hairline);
  border-bottom: 0;
}

.blog-layout__main .blog-grid .blog-card:first-child .blog-card-content {
  padding: 2.25rem;
  justify-content: center;
}

.blog-layout__main .blog-grid .blog-card:first-child .blog-card-title {
  max-width: 760px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.blog-layout__main .blog-grid .blog-card:first-child .blog-card-excerpt {
  max-width: 680px;
  font-size: 1.04rem;
  -webkit-line-clamp: 3;
}

.blog-layout__main .blog-grid .blog-card:nth-child(n + 6) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 130px;
}

.blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-image {
  height: 100%;
  aspect-ratio: auto;
  border-right: 1px solid var(--hairline);
  border-bottom: 0;
}

.blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-content {
  padding: 1.15rem 1.35rem;
}

.blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-title {
  font-size: 1.12rem;
  margin-bottom: 0.5rem;
}

.blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-excerpt {
  margin-bottom: 0.75rem;
  -webkit-line-clamp: 1;
}

@media (max-width: 767px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-layout__main .blog-grid .blog-card:first-child,
  .blog-layout__main .blog-grid .blog-card:nth-child(n + 6) {
    display: flex;
    grid-column: auto;
    min-height: 0;
  }

  .blog-layout__main .blog-grid .blog-card:first-child .blog-card-image,
  .blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-image {
    height: auto;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .blog-layout__main .blog-grid .blog-card:first-child .blog-card-content {
    padding: 1.35rem;
  }

  .blog-layout__main .blog-grid .blog-card:first-child .blog-card-title {
    font-size: 1.35rem;
  }

  .blog-layout__main .blog-grid .blog-card:nth-child(n + 6) .blog-card-title {
    font-size: 1.15rem;
  }

  .blog-card-excerpt {
    font-size: 0.92rem;
  }
}

/* Pagination Details */
.blog-pagination {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: center;
}

.blog-pagination .nav-links {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.blog-pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--hairline);
  transition: all 0.2s ease;
}

.blog-pagination .page-numbers:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

.blog-pagination .page-numbers.current {
  background: var(--brand-accent);
  color: var(--on-primary);
  border-color: var(--brand-accent);
}

/* Single Post Specific Variables */
.single-post-wrapper {
  background: var(--canvas);
}

.single-post-header {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(70, 95, 255, 0.22), transparent 34%),
    linear-gradient(135deg, var(--blue-80) 0%, var(--primary) 58%, var(--inverse-surface-1) 100%);
  padding-top: 9rem;
  padding-bottom: 7rem;
  overflow: hidden;
  text-align: left;
  color: var(--inverse-ink);
  isolation: isolate;
}

.single-post-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 15, 35, 0.62) 0%, rgba(5, 15, 35, 0.42) 48%, rgba(5, 15, 35, 0.18) 100%),
    linear-gradient(180deg, rgba(5, 15, 35, 0.04) 0%, rgba(5, 15, 35, 0.48) 100%);
}

.single-post-header__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.single-post-header__media-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0.9;
  filter: saturate(1.08) contrast(1.02);
}

.single-post-header .hero-glow-1 {
  position: absolute;
  top: -42%;
  right: -14%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(70, 95, 255, 0.34) 0%, transparent 64%);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

.single-post-header .hero-glow-2 {
  position: absolute;
  bottom: -36%;
  left: -12%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 62%);
  filter: blur(64px);
  z-index: 1;
  pointer-events: none;
}

.single-post-header__inner {
  position: relative;
  z-index: 2;
}

.single-post-eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.single-post-badge,
.single-post-category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.single-post-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--inverse-ink);
}

.single-post-category-pill {
  background: var(--canvas);
  color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.single-post-title {
  width: min(100%, 1040px);
  max-width: 1040px;
  color: var(--inverse-ink);
  font-size: clamp(44px, 5.8vw, 78px);
  line-height: 1.03;
  letter-spacing: -0.055em;
  text-wrap: balance;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.36);
}

.single-meta-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  z-index: 2;
}

.single-meta-chip,
.single-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
}

.single-meta-chip {
  background: var(--canvas);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.single-meta-chip--category {
  color: var(--blue-hover);
}

.single-meta-item {
  padding-right: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.24);
}

.single-meta-item:last-child {
  border-right: 0;
  padding-right: 0;
}

/* Formatted Content Typography */
.single-post-shell {
  width: min(100%, 930px);
  display: block;
  margin-inline: auto;
  padding-top: 4.5rem;
  padding-bottom: 8rem;
}

.single-post-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 0;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(70, 95, 255, 0.25) transparent;
}

.single-post-toc::-webkit-scrollbar {
  width: 5px;
}

.single-post-toc::-webkit-scrollbar-track {
  background: transparent;
}

.single-post-toc::-webkit-scrollbar-thumb {
  background: rgba(70, 95, 255, 0.25);
  border-radius: 999px;
}

.single-post-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(70, 95, 255, 0.45);
}

.toc-card {
  position: relative;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  backdrop-filter: blur(12px);
}

.toc-card::before {
  content: none;
}

.toc-card a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.2rem 0;
  color: var(--primary);
  font-size: 0.94rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 0 5px rgba(70, 95, 255, 0.12);
  flex: 0 0 auto;
}

.toc-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-item;
}

.toc-card li {
  counter-increment: toc-item;
  padding: 0.2rem 0;
}

.toc-card a {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.72rem;
  align-items: start;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.62rem 0 0.62rem 0.78rem;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.toc-card a::after {
  content: "";
  position: absolute;
  top: 0.58rem;
  bottom: 0.58rem;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.toc-card a::before {
  content: counter(toc-item, decimal-leading-zero);
  color: rgba(70, 95, 255, 0.78);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.85;
}

.toc-card a:hover,
.toc-card a:focus-visible {
  color: var(--primary);
}

.toc-card a.is-active {
  color: #3641f5;
}

.toc-card a.is-active::after {
  background: rgba(70, 95, 255, 0.9);
}

.toc-card a.is-active::before {
  color: var(--brand-accent);
  font-weight: 700;
}

.toc-level-3 {
  padding-left: 0.85rem !important;
}

.toc-level-3 a {
  grid-template-columns: 0.9rem minmax(0, 1fr);
  gap: 0.6rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding-block: 0.48rem;
}

.toc-level-3 a::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: rgba(70, 95, 255, 0.54);
}

.single-post-content {
  max-width: none;
  margin: 0;
  padding: 0;
}

.content-formatted {
  font-size: 1.14rem;
  line-height: 1.82;
  color: var(--ink-muted);
}

.content-formatted p {
  margin-bottom: 1.75rem;
}

.content-formatted h2 {
  scroll-margin-top: 110px;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  color: var(--primary);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  padding-left: 1rem;
  border-left: 5px solid var(--brand-accent);
}

.content-formatted h3 {
  scroll-margin-top: 110px;
  font-size: clamp(1.42rem, 2vw, 1.7rem);
  font-weight: 750;
  color: var(--ink);
  margin-top: 2.65rem;
  margin-bottom: 1.25rem;
  line-height: 1.32;
  padding-top: 1rem;
  border-top: 1px solid rgba(16, 24, 40, 0.1);
}

.content-formatted h4, 
.content-formatted h5, 
.content-formatted h6 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-formatted ul, 
.content-formatted ol {
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.content-formatted li {
  margin-bottom: 0.75rem;
}

.content-formatted li::marker {
  color: var(--brand-accent);
}

.content-formatted a {
  color: var(--brand-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(70, 95, 255, 0.3);
  transition: border-bottom-color 0.2s ease;
}

.content-formatted a:hover {
  border-bottom-color: var(--brand-accent);
}

.content-formatted blockquote {
  border-left: 0;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--canvas) 100%);
  padding: 1.75rem 2rem;
  margin: 2.75rem 0;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--primary);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.content-formatted blockquote::before {
  content: "“";
  position: absolute;
  top: -0.6rem;
  left: 1.35rem;
  color: var(--brand-accent);
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 800;
  opacity: 0.28;
}

.content-formatted blockquote p:last-child {
  margin-bottom: 0;
}

.content-formatted img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 3rem 0;
  display: block;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}

.content-formatted figure {
  margin: 3rem 0;
}

.content-formatted figcaption {
  text-align: center;
  font-size: 0.875rem;
  font-family: 'DM Mono', monospace;
  color: var(--ink-subtle);
  margin-top: 1rem;
}

.content-formatted pre,
.content-formatted code {
  background: var(--ink);
  color: var(--inverse-ink);
  font-family: 'DM Mono', monospace;
  border-radius: var(--r-sm);
}

.content-formatted pre {
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 2rem;
}

.content-formatted code {
  padding: 0.2em 0.4em;
  font-size: 0.875em;
}

.content-formatted pre code {
  padding: 0;
  background: transparent;
}

.content-formatted details,
.content-formatted .wp-block-details {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.content-formatted details[open],
.content-formatted .wp-block-details[open] {
  background: transparent;
}

.content-formatted summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.4;
  list-style: none;
  padding: 1.5rem 3rem 1.5rem 0;
  transition: color 0.2s ease;
}

.content-formatted summary::-webkit-details-marker {
  display: none;
}

.content-formatted summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 1px solid var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 22px;
  transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}

.content-formatted details[open] summary::after,
.content-formatted .wp-block-details[open] summary::after {
  content: "-";
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--canvas);
}

.content-formatted .article-faq-body {
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: height, opacity, transform;
}

.content-formatted details[open] .article-faq-body,
.content-formatted .wp-block-details[open] .article-faq-body {
  opacity: 1;
  transform: translateY(0);
}

.content-formatted .article-faq-body > * {
  margin-top: 0;
  padding: 0 3rem 1.5rem 0;
}

.content-formatted details > :not(summary),
.content-formatted .wp-block-details > :not(summary) {
  padding-right: 0;
}

.content-formatted details:last-of-type,
.content-formatted .wp-block-details:last-of-type {
  border-bottom: 1px solid var(--hairline);
}

@media (prefers-reduced-motion: reduce) {
  .content-formatted summary,
  .content-formatted summary::after,
  .content-formatted .article-faq-body {
    transition: none;
  }
}

.single-post-footer-nav {
  border-top: 1px solid var(--hairline);
  margin-top: 3.25rem;
  padding-top: 2rem;
  text-align: left;
}

@media (max-width: 1023px) {
  .single-post-shell {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .single-post-toc {
    position: static;
    order: -1;
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
    padding-right: 0;
    scrollbar-width: auto;
  }

  .toc-card {
    overflow: visible;
    background: var(--surface-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 1.45rem 1.65rem;
    box-shadow: var(--shadow-soft);
  }

  .toc-card ol {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 1.5rem;
  }
}

@media (max-width: 767px) {
  .single-post-header {
    padding-top: 7rem;
    padding-bottom: 4.75rem;
  }

  .single-post-title {
    font-size: clamp(36px, 11vw, 48px);
    line-height: 1.08;
  }

  .single-meta-bar {
    gap: 0.7rem;
  }

  .single-meta-chip,
  .single-meta-item {
    width: 100%;
    justify-content: flex-start;
  }

  .single-meta-item {
    border-right: 0;
    padding-right: 0;
  }

  .single-post-shell {
    padding-top: 3rem;
    padding-bottom: 5rem;
  }

  .toc-card {
    border-radius: var(--r-md);
  }

  .single-post-toc {
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
    padding-right: 0;
    scrollbar-width: auto;
  }

  .toc-card {
    padding: 1.2rem 1.35rem;
  }

  .toc-card ol {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc-card li {
    padding: 0.12rem 0;
  }

  .toc-card a {
    font-size: 0.96rem;
    line-height: 1.48;
    padding: 0.48rem 0 0.48rem 0.65rem;
  }

  .toc-level-3 a {
    font-size: 0.92rem;
    padding-block: 0.38rem;
  }

  .content-formatted {
    font-size: 1.05rem;
    line-height: 1.76;
  }

  .content-formatted h2 {
    margin-top: 2.5rem;
    padding-left: 0.82rem;
  }

  .content-formatted blockquote {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   CONTENT FORMATTED — Tables, HR, H1, Lists refinement
   ========================================================================== */

/* H1 inside content — demote visually since page title already shows in hero */
.content-formatted h1 {
  scroll-margin-top: 110px;
  font-size: clamp(2.25rem, 3.2vw, 3rem);
  font-weight: 800;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 2rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

/* Tables — IBM Canvas style: clean, airy, accent header */
.content-formatted table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.75rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--canvas);
}

.content-formatted thead {
  background: var(--primary);
}

.content-formatted thead th {
  color: var(--inverse-ink);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 2px solid var(--brand-accent);
}

.content-formatted thead th:first-child {
  border-top-left-radius: var(--r-md);
}

.content-formatted thead th:last-child {
  border-top-right-radius: var(--r-md);
}

.content-formatted tbody td {
  padding: 0.85rem 1.25rem;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  transition: background-color 0.15s ease;
}

.content-formatted tbody tr:last-child td {
  border-bottom: none;
}

.content-formatted tbody tr:hover td {
  background: var(--surface-1);
}

/* First column in body rows — bolder, serves as row label */
.content-formatted tbody td:first-child {
  font-weight: 600;
  color: var(--ink);
}

.content-formatted tbody td strong {
  color: var(--primary);
  font-weight: 700;
}

/* Zebra striping */
.content-formatted tbody tr:nth-child(even) td {
  background: var(--surface-1);
}

.content-formatted tbody tr:nth-child(even):hover td {
  background: var(--surface-2);
}

/* HR — subtle brand-accent divider */
.content-formatted hr {
  border: none;
  height: 2px;
  margin: 3.5rem auto;
  max-width: 120px;
  background: linear-gradient(90deg, transparent 0%, var(--brand-accent) 50%, transparent 100%);
  border-radius: 999px;
}

/* OL — numbered list with brand accent */
.content-formatted ol {
  counter-reset: content-ol;
  list-style: none;
  padding-left: 0;
  margin-bottom: 2rem;
}

.content-formatted ol > li {
  counter-increment: content-ol;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
}

.content-formatted ol > li::before {
  content: counter(content-ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-accent);
  background: var(--surface-1);
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  letter-spacing: 0.04em;
}

.content-formatted ol > li::marker {
  content: none;
}

/* UL — refined bullet list */
.content-formatted ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2rem;
}

.content-formatted ul > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.85rem;
}

.content-formatted ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.15);
}

.content-formatted ul > li::marker {
  content: none;
}

/* Nested lists */
.content-formatted ul ul,
.content-formatted ol ol,
.content-formatted ul ol,
.content-formatted ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.content-formatted ul ul > li::before {
  width: 5px;
  height: 5px;
  background: transparent;
  border: 1.5px solid var(--brand-accent);
  box-shadow: none;
}

.content-formatted ol ol > li::before {
  font-size: 0.72rem;
  width: 1.5rem;
  height: 1.5rem;
}

/* Inline code in body text */
.content-formatted p code,
.content-formatted li code {
  background: var(--surface-1);
  color: var(--primary);
  border: 1px solid var(--hairline);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'DM Mono', monospace;
}

/* Code block — dark terminal look */
.content-formatted pre {
  position: relative;
  padding: 1.75rem 1.5rem;
  margin: 2.75rem 0;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-strong);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.content-formatted pre::before {
  content: "";
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
}

.content-formatted pre code {
  padding-top: 1.5rem;
  display: block;
}

/* Pygments codehilite adjustment */
.content-formatted .codehilite {
  margin: 2.75rem 0;
  border-radius: var(--r-md);
  overflow: hidden;
}

.content-formatted .codehilite pre {
  margin: 0;
}

/* Responsive table — inline-table preserves proper layout, no whitespace gap */
.content-formatted > table {
  display: inline-table;
  width: 100%;
}

/* Allow horizontal scroll for wide tables within content area */
.content-formatted {
  overflow-x: auto;
}

@media (max-width: 767px) {
  .content-formatted > table {
    font-size: 0.88rem;
  }

  .content-formatted thead th {
    font-size: 0.72rem;
    padding: 0.75rem 0.85rem;
  }

  .content-formatted tbody td {
    padding: 0.65rem 0.85rem;
  }

  .content-formatted ol > li {
    padding-left: 2.25rem;
  }

  .content-formatted ol > li::before {
    font-size: 0.72rem;
    width: 1.65rem;
    height: 1.65rem;
  }

  .content-formatted ul > li {
    padding-left: 1.5rem;
  }

  .content-formatted pre {
    padding: 1.5rem 1rem;
    font-size: 0.82rem;
  }

  .content-formatted pre::before {
    top: 0.75rem;
    left: 0.85rem;
  }
}

/* Checklist — styled checkbox items (replaces raw [ ] markup) */
.content-formatted ul.checklist {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2rem;
}

.content-formatted ul.checklist > li.checklist-item {
  position: relative;
  padding-left: 0;
  margin-bottom: 0.85rem;
  line-height: 1.7;
  display: flex;
  align-items: center;
  gap: 0;
}

.content-formatted ul.checklist > li.checklist-item::before {
  content: none;
}

.content-formatted .checklist-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--hairline);
  border-radius: 4px;
  background: var(--canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  margin-top: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.content-formatted .checklist-box::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--brand-accent);
  opacity: 0.2;
  transition: opacity 0.2s ease;
}

.content-formatted .checklist-text {
  color: var(--ink-muted);
  font-size: 0.97rem;
  flex: 1;
  min-width: 0;
  line-height: 1.6;
}

.content-formatted .checklist-text strong {
  color: var(--ink);
}

@media (max-width: 767px) {
  .content-formatted ul.checklist > li.checklist-item {
    padding-left: 2rem;
    margin-bottom: 0.75rem;
  }

  .content-formatted .checklist-box {
    width: 16px;
    height: 16px;
    top: 0.35em;
  }

  .content-formatted .checklist-box::after {
    width: 8px;
    height: 8px;
  }
}

/* ==========================================================================
   END CONTENT FORMATTING ADDITIONS
   ========================================================================== */

/* ==========================================================================
   BLOG LAYOUT — Sidebar + Main Grid
   ========================================================================== */

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

@media (min-width: 1024px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (min-width: 1200px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* Main content area */
.blog-layout__main {
  min-width: 0;
}

/* Sidebar */
.blog-layout__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Sidebar Cards */
.blog-sidebar-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.blog-sidebar-card:hover {
  border-color: rgba(70, 95, 255, 0.28);
}

.blog-sidebar-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-sidebar-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  flex-shrink: 0;
}

/* Category list */
.blog-sidebar-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-sidebar-categories li {
  margin-bottom: 0;
}

.blog-sidebar-categories li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.62rem 0;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.blog-sidebar-categories li:last-child a {
  border-bottom: 0;
}

.blog-sidebar-categories li a:hover {
  color: var(--primary);
  padding-left: 0.35rem;
}

.blog-sidebar-cat-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-accent);
  background: rgba(70, 95, 255, 0.08);
  border: 1px solid rgba(70, 95, 255, 0.22);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  min-width: 1.5rem;
  text-align: center;
}

/* Recent posts */
.blog-sidebar-recent {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-sidebar-recent li {
  margin-bottom: 0;
}

.blog-sidebar-recent li a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.2s ease;
}

.blog-sidebar-recent li:last-child a {
  border-bottom: 0;
}

.blog-sidebar-recent li a:hover {
  color: var(--primary);
}

.blog-sidebar-recent-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.blog-sidebar-recent li a:hover .blog-sidebar-recent-title {
  color: var(--primary);
}

.blog-sidebar-recent-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* CTA Card */
.blog-sidebar-cta {
  background: linear-gradient(135deg, rgba(70, 95, 255, 0.06) 0%, rgba(16, 24, 40, 0.04) 100%);
  border-color: rgba(70, 95, 255, 0.18);
  text-align: center;
}

.blog-sidebar-cta-text {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.blog-sidebar-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* Mobile: sidebar below grid */
@media (max-width: 1023px) {
  .blog-layout__sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .blog-sidebar-cta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .blog-layout__sidebar {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   END BLOG LAYOUT SIDEBAR
   ========================================================================== */

/* Default Post Thumbnail */
.default-thumbnail {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(70, 95, 255, 0.05) 0%, rgba(16, 24, 40, 0.08) 100%);
}

.default-thumb-icon {
  width: 56px !important;
  height: 56px !important;
  opacity: 0.2;
  filter: grayscale(100%);
  object-fit: contain;
}
