/* ============================================================
   MIGRATLY — Blog styles
   Loaded after style.css; reuses its variables.
   ============================================================ */

/* Blog pages have no dark hero behind the fixed navbar,
   so the navbar is solid from the top rather than on scroll. */
#navbar.solid {
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── Shared dark header band ── */
.blog-hero {
  background: var(--gradient-hero);
  padding: calc(var(--nav-height) + 64px) 0 64px;
  position: relative;
  overflow: hidden;
}
.blog-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 120%, rgba(99, 102, 241, 0.25), transparent 55%),
    radial-gradient(circle at 85% -20%, rgba(139, 92, 246, 0.2), transparent 50%);
  pointer-events: none;
}
.blog-hero > .container { position: relative; z-index: 1; }

.blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light-muted);
  margin-bottom: 18px;
}
.blog-eyebrow .series-chip {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: 999px;
}

.blog-hero h1 {
  color: var(--color-text-light);
  max-width: 20ch;
}
.blog-hero .lede {
  color: var(--color-text-light-muted);
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 62ch;
  margin-top: 20px;
}
.blog-meta {
  margin-top: 26px;
  font-size: 0.875rem;
  color: var(--color-text-light-muted);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.blog-meta .dot { opacity: 0.45; }

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light-muted);
  margin-bottom: 22px;
  transition: color 0.2s;
}
.blog-back:hover { color: #c7d2fe; }

/* ── Index listing ── */
.blog-list { padding: 72px 0 96px; background: var(--color-bg-white); }

.post-card {
  display: block;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  margin-bottom: 20px;
  background: var(--color-bg-white);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.post-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-3px);
}
.post-card .card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.post-card h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.post-card p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 68ch;
}
.post-card .card-meta {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.post-card.upcoming {
  background: #fbfbfe;
  border-style: dashed;
  cursor: default;
}
.post-card.upcoming:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-light);
}
.post-card.upcoming h2 { color: #64748b; }
.post-card.upcoming .card-eyebrow { color: #94a3b8; }

.list-divider {
  margin: 52px 0 26px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 16px;
}
.list-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

/* ── Article body ── */
.post { padding: 60px 0 40px; background: var(--color-bg-white); }

.post-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #1e293b;
}

.post-body > p { margin-bottom: 24px; }

.post-body h2 {
  font-size: 1.75rem;
  margin: 56px 0 20px;
  letter-spacing: -0.025em;
}
.post-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 36px 0 12px;
  letter-spacing: -0.015em;
}
.post-body h2 + p, .post-body h3 + p { margin-top: 0; }

.post-body strong { font-weight: 650; color: #0f172a; }
.post-body em { font-style: italic; }

.post-body a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(99, 102, 241, 0.4);
}
.post-body a:hover { text-decoration-color: var(--color-primary); }

.post-body ul { margin: 0 0 26px; padding: 0; }
.post-body ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
}
.post-body ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.55;
}

/* Numbered capability blocks */
.capability {
  border-left: 3px solid rgba(99, 102, 241, 0.3);
  padding: 2px 0 2px 22px;
  margin: 0 0 30px;
}
.capability h3 { margin: 0 0 8px; }
.capability h3 .num {
  font-family: var(--font-mono);
  color: var(--color-primary);
  margin-right: 8px;
  font-weight: 500;
}
.capability p { margin: 0 0 12px; }
.capability p:last-child { margin-bottom: 0; }

/* Pull quote */
.post-body blockquote {
  margin: 32px 0;
  padding: 20px 26px;
  background: #f8f9ff;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.05rem;
  color: #334155;
}
.post-body blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.table-wrap {
  margin: 32px 0;
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 520px;
}
.post-body thead th {
  text-align: left;
  background: #f8f9ff;
  font-weight: 650;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  padding: 13px 18px;
  border-bottom: 1px solid var(--color-border-light);
}
.post-body tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  line-height: 1.6;
}
.post-body tbody tr:last-child td { border-bottom: none; }
.post-body tbody tr:hover td { background: #fcfcff; }

/* ── Diagram shell ── */
.diagram {
  margin: 44px 0;
  padding: 32px 26px 26px;
  background: linear-gradient(180deg, #fcfcff 0%, #f7f8ff 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}
.diagram figcaption {
  margin-top: 22px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94a3b8;
}
/* Full-bleed the diagram past the reading column on wide screens.
   .post-body is 720px wide with 24px padding and border-box sizing,
   so the content box the figure sits in is 672px — centre against that. */
@media (min-width: 1040px) {
  .diagram { width: 960px; margin-left: calc((672px - 960px) / 2); }
}

/* ── High-level architecture diagram (pure HTML/CSS) ── */
.hld-main {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.hld-col {
  flex: 0 0 156px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hld-node {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.hld-node strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--color-text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.hld-node .hld-sub {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
}
.hld-node .hld-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 6px;
}

/* Endpoint systems read as "outside our boundary" */
.hld-system {
  background: #f1f5f9;
  border-style: dashed;
  border-color: #cbd5e1;
  box-shadow: none;
}
.hld-desc { border-color: rgba(99, 102, 241, 0.35); }

/* Arrows */
.hld-arrow { flex: 0 0 auto; position: relative; }
.hld-arrow.right {
  align-self: center;
  width: 38px;
  height: 2px;
  margin: 0 6px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.6));
}
.hld-arrow.right::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 9px solid rgba(99, 102, 241, 0.7);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.hld-arrow.down {
  width: 2px;
  height: 24px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.6));
}
.hld-arrow.down::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  border-top: 9px solid rgba(99, 102, 241, 0.7);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

/* Engine */
.hld-engine {
  flex: 1 1 auto;
  min-width: 0;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  background: var(--color-bg-white);
  padding: 18px 20px 20px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}
.hld-engine-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 16px;
}
/* At the full-bleed width the engine gets ~456px of content box,
   which lands this on 3 columns — steps 01-03, then 04-05. */
.hld-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}
.hld-step {
  background: #f5f6ff;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-sm);
  padding: 11px 12px 11px 13px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.hld-step .n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-primary);
  flex-shrink: 0;
  padding-top: 1px;
}
.hld-engine-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border-light);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #94a3b8;
  text-align: center;
}

/* Supporting layer */
.hld-support {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
  position: relative;
  padding-top: 26px;
}
.hld-support::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  border-top: 2px dashed rgba(148, 163, 184, 0.45);
}
.hld-aux { text-align: left; }
.hld-aux strong { font-size: 0.875rem; }
.hld-aux .hld-sub { text-align: left; }

/* Below the full-bleed breakpoint the diagram is only ~672px wide, which is
   too narrow for three columns plus the engine — collapse to a vertical flow.
   Breakpoint deliberately mirrors the 1040px full-bleed rule above. */
@media (max-width: 1039px) {
  .hld-main { flex-direction: column; align-items: stretch; gap: 0; }
  .hld-col { flex: 1 1 auto; }
  .hld-arrow.right {
    width: 2px;
    height: 24px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.6));
  }
  .hld-arrow.right::after {
    right: auto;
    top: auto;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 9px solid rgba(99, 102, 241, 0.7);
    border-bottom: none;
  }
  /* Target column reads description → system on mobile too */
  .hld-support { grid-template-columns: 1fr; }
  .hld-support::before { left: 30%; right: 30%; }
}

/* Article foot CTA */
.post-cta {
  background: var(--color-bg-light);
  border-top: 1px solid var(--color-border-light);
  padding: 60px 0 72px;
  margin-top: 60px;
}
.post-cta-inner { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.post-cta h3 { font-size: 1.35rem; margin-bottom: 10px; }
.post-cta p { color: var(--color-text-secondary); margin-bottom: 26px; max-width: 60ch; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-ghost {
  background: var(--color-bg-white);
  color: var(--color-primary-dark);
  border: 1.5px solid rgba(99, 102, 241, 0.35);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  background: #f5f6ff;
  transform: translateY(-2px);
}

.next-up {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}
.next-up strong { color: var(--color-text-primary); }

@media (max-width: 720px) {
  .blog-hero { padding: calc(var(--nav-height) + 44px) 0 48px; }
  .post { padding: 44px 0 24px; }
  .post-body { font-size: 1rem; }
  .post-body h2 { font-size: 1.5rem; margin: 44px 0 16px; }
  .post-card { padding: 24px 22px; }
  .post-card h2 { font-size: 1.25rem; }
  .diagram { padding: 18px 12px; }
}
