/* ============================================================
   Shared sticky sidebar — blog posts + SEO pages
   Desktop: sticky column beside content. Mobile: cards reorder,
   related links move inline into the article.
   (Layout pattern shared with crazygktrick reference design)
   ============================================================ */

.mf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
.mf-main { min-width: 0; }

/* Sidebar stays fixed while content scrolls. No scrollbar of its own —
   only the TOC list (which can grow long) scrolls internally. */
.mf-side {
  position: sticky;
  top: 95px;              /* below the fixed navbar */
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 10px;
}

.side-card {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}
.side-card h4 {
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 700;
  color: #0f2a5c;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding-bottom: 9px;
  border-bottom: 2px solid #eaf1ff;
}

/* ---- Lists ---- */
.side-list { list-style: none; padding: 0; margin: 0; }
.side-list li { padding: 9px 0; border-bottom: 1px dashed #eef2f8; }
.side-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.side-list a {
  color: #33415c;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.5;
  display: block;
  position: relative;
  padding-left: 16px;
  transition: color .15s ease;
}
.side-list a::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--mf-primary, #2563eb);
  font-weight: 700;
}
.side-list a:hover { color: var(--mf-primary, #2563eb); }

/* ---- Table of contents (JS-filled) ---- */
.toc-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-list::-webkit-scrollbar { width: 4px; }
.toc-list::-webkit-scrollbar-thumb { background: #d7e0ee; border-radius: 6px; }
.toc-list a {
  display: block;
  color: #475569;
  text-decoration: none;
  font-size: .87rem;
  line-height: 1.45;
  padding: 7px 0 7px 14px;
  border-left: 2px solid #e6ecf5;
  transition: all .15s ease;
}
.toc-list a:hover,
.toc-list a.active {
  color: var(--mf-primary, #2563eb);
  border-left-color: var(--mf-primary, #2563eb);
  background: #f6f9ff;
}

/* ---- Advisor CTA card ---- */
.side-cta {
  background: linear-gradient(160deg, #f0f7ff, #fff);
  border-color: #bfdbfe;
}
.side-cta h4 { color: #1e3a8a; border-bottom-color: #dbeafe; }
.sc-name { margin: 0 0 8px; font-weight: 700; color: #1a1a2e; font-size: .95rem; line-height: 1.4; }
.sc-note { margin: 0 0 14px; font-size: .84rem; color: #64748b; line-height: 1.5; }
.sc-btn {
  display: block;
  text-align: center;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: 11px 16px;
  border-radius: 26px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, .3);
  transition: transform .15s ease;
}
.sc-btn:hover { transform: translateY(-2px); color: #fff; }
.sc-btn.sc-btn-blue {
  background: var(--mf-primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
  margin-top: 10px;
}
.sc-link { display: block; text-align: center; margin-top: 10px; font-size: .82rem; color: #64748b; text-decoration: none; }
.sc-link:hover { color: var(--mf-primary, #2563eb); }

/* ---- Inline related (shown on mobile only — nobody scrolls to a bottom rail) ---- */
.inline-related {
  display: none;
  background: #f7f9fc;
  border: 1px solid #e6ecf5;
  border-left: 4px solid var(--mf-primary, #2563eb);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 26px 0;
}
.inline-related h3 { margin: 0 0 12px; font-size: 1.02rem; color: #0f2a5c; }
.inline-related ul { list-style: none; padding: 0; margin: 0; }
.inline-related li { padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.inline-related li:last-child { border-bottom: 0; }
.inline-related a { color: #33415c; text-decoration: none; font-size: .92rem; line-height: 1.5; font-weight: 500; }
.inline-related a:hover { color: var(--mf-primary, #2563eb); }

/* ============================================================
   Tablet / mobile
   ============================================================ */
@media (max-width: 1024px) {
  .mf-layout { grid-template-columns: 1fr; gap: 26px; }
  .mf-side {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  /* TOC and duplicate related hidden on mobile — related is inline instead */
  .side-toc, .side-related { display: none; }
  .side-cta { grid-column: 1 / -1; order: -1; }   /* CTA card on top */
  .inline-related { display: block; }
}

@media (max-width: 640px) {
  .mf-side { grid-template-columns: 1fr; }
  .side-card { padding: 16px 18px; }
}
