/* ── Base Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 18px;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'SF Pro Text', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: hsl(0, 0%, 98%);
  color: hsl(240, 12%, 27%);
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  padding-top: 88px !important; /* Space for fixed navigation */
}

  /* ─── HERO ─── */
  .hero {
    width: 100%;
    margin: 0;
    margin-top: 0 !important; /* Prevent double spacing */
    background: linear-gradient(165deg, hsl(240, 12%, 27%) 0%, hsl(224, 48%, 16%) 100%);
    color: hsl(0, 0%, 100%);
    padding: 80px 24px 90px;
    position: relative;
    overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 80%, hsl(355, 78%, 56%, 0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, hsl(31, 53%, 64%, 0.10) 0%, transparent 50%);
  }
  .hero-inner {
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }
  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: hsl(0, 0%, 100%, 0.08);
    border: 1px solid hsl(0, 0%, 100%, 0.12);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(41, 61%, 56%);
    margin-bottom: 28px;
  }
  .hero-badge .dot {
    width: 6px;
    height: 6px;
    background: hsl(41, 61%, 56%);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
  }
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }
  .hero h1 {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
  }
  .hero h1 em {
    color: hsl(355, 78%, 56%);
    font-style: italic;
  }
  .hero-sub {
    font-size: 18px;
    color: hsl(0, 0%, 100%, 0.7);
    max-width: 600px;
    line-height: 1.65;
    margin-bottom: 36px;
  }
  .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 12px;
    color: hsl(0, 0%, 100%, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* ─── NAV BAR (sticky TOC) ─── */
  .toc-bar {
    position: sticky;
    top: 72px;
    z-index: 100;
    background: hsl(0, 0%, 100%, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(218, 31%, 93%);
    padding: 0 2rem;
    transition: box-shadow 0.3s;
  }
  .toc-bar.scrolled { box-shadow: 0 2px 20px hsl(0, 0%, 0%, 0.06); }
  .toc-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .toc-inner::-webkit-scrollbar { display: none; }
  .toc-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate-400);
    white-space: nowrap;
    padding: 1rem 0;
    flex-shrink: 0;
  }
  .toc-inner a {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-600);
    text-decoration: none;
    white-space: nowrap;
    padding: 1rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
  }
  .toc-inner a:hover, .toc-inner a.active {
    color: var(--amber-500);
    border-bottom-color: var(--amber-500);
  }

  /* ─── ARTICLE CONTENT ─── */
  .article h2 {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 900;
    margin: 56px 0 20px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: hsl(240, 12%, 27%);
    scroll-margin-top: 80px;
  }
  .article h2:first-of-type {
    margin-top: 0;
  }
  .article h2 .point-num {
    color: hsl(355, 78%, 56%);
    font-style: italic;
  }

  .article h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 40px 0 14px;
    color: hsl(240, 12%, 35%);
    scroll-margin-top: 80px;
  }

  .article h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: hsl(240, 12%, 27%);
  }

  .article p {
    margin-bottom: 20px;
    color: hsl(240, 12%, 35%);
    font-size: 16px;
    line-height: 1.8;
  }

  .article strong {
    color: hsl(240, 12%, 27%);
    font-weight: 700;
  }

  .article ul {
    margin: 24px 0;
    padding-left: 32px;
  }
  .article ul li {
    margin-bottom: 12px;
    color: hsl(240, 12%, 35%);
    font-size: 16px;
    line-height: 1.8;
  }
  .article ul li::marker {
    color: hsl(355, 78%, 56%);
  }

  .article a {
    color: hsl(355, 78%, 56%);
    text-decoration: underline;
    text-decoration-color: hsl(355, 78%, 56%, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
  }
  .article a:hover {
    text-decoration-color: hsl(355, 78%, 56%);
  }

  /* ─── LEAD / INTRO PARAGRAPH ─── */
  .lead {
    font-size: 1.15rem;
    color: var(--slate-600);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-weight: 300;
  }

  /* ─── DROP CAP ─── */
  .drop-cap {
    float: left;
    font-size: 4.5rem;
    line-height: 0.85;
    font-weight: 700;
    color: var(--primary-600);
    font-family: var(--font-display);
    margin-right: 0.1em;
    margin-top: 0.08em;
  }

  /* ─── POINT CARD ─── */
  .point-section {
    border-top: 1px solid var(--slate-100);
    padding-top: 3rem;
    margin-top: 3rem;
  }

  /* ─── CALLOUT BOX ─── */
  .callout {
    background: var(--amber-50);
    border-left: 4px solid var(--amber-400);
    padding: 1.3rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.8rem 0;
  }
  .callout-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber-500);
    font-weight: 500;
    margin-bottom: 0.5rem;
  }
  .callout p { margin-bottom: 0; color: var(--slate-700); font-size: 0.95rem; }

  /* ─── ZIVVY HIGHLIGHT ─── */
  .zivvy-box {
    background: var(--slate-950);
    color: var(--slate-200);
    padding: 1.4rem 1.6rem;
    border-radius: 10px;
    margin: 1.8rem 0;
    position: relative;
    overflow: hidden;
  }
  .zivvy-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--amber-400), var(--amber-500), transparent);
  }
  .zivvy-box strong { color: var(--amber-300); }
  .zivvy-box p { color: var(--slate-300); margin-bottom: 0; font-size: 0.95rem; }

  /* ─── OVERVIEW TABLE ─── */
  .overview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.92rem;
  }
  .overview-table thead th {
    background: var(--slate-950);
    color: var(--white);
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .overview-table thead th:first-child { border-radius: 8px 0 0 0; }
  .overview-table thead th:last-child { border-radius: 0 8px 0 0; }
  .overview-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: top;
  }
  .overview-table tbody tr:nth-child(even) td { background: var(--slate-50); }
  .overview-table tbody tr:last-child td:first-child { border-radius: 0 0 0 8px; }
  .overview-table tbody tr:last-child td:last-child { border-radius: 0 0 8px 0; }
  .overview-table .pt-num {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--amber-500);
    white-space: nowrap;
  }

  /* ─── FAQ ─── */
  .faq-item {
    border-bottom: 1px solid var(--slate-100);
    padding: 1.3rem 0;
  }
  .faq-item:last-child { border-bottom: none; }
  .faq-q {
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
  }
  .faq-a { color: var(--slate-600); margin-bottom: 0; }

  /* ─── CTA BANNER ─── */
  .cta-section {
    background: linear-gradient(135deg, hsl(261, 49%, 21%) 0%, hsl(262, 39%, 40%) 100%);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    margin: 48px auto;
    max-width: var(--content-width);
    position: relative;
    overflow: hidden;
  }
  .cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, hsl(41, 61%, 56%, 0.15) 0%, transparent 70%);
  }
  .cta-section h3 {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 28px;
    color: hsl(0, 0%, 100%);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
  }
  .cta-section p {
    color: hsl(265, 33%, 57%);
    margin-bottom: 24px;
    font-size: 17px;
    position: relative;
    z-index: 1;
  }
  .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, hsl(41, 61%, 56%) 0%, hsl(43, 71%, 69%) 100%);
    color: hsl(261, 49%, 21%);
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: transform 0.2s;
  }
  .cta-button:hover { transform: translateY(-2px); }
  .cta-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
  }

  /* ─── RELATED ARTICLES ─── */
  .related-section {
    background: hsl(260, 23%, 97%);
    padding: 60px 40px;
  }
  .related-inner {
    max-width: 1000px;
    margin: 0 auto;
  }
  .related-section h3 {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--slate-800);
  }
  .related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .related-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px hsl(223, 23%, 15%, 0.1);
  }
  .related-card .tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }
  .related-card.retention .tag { color: hsl(262, 39%, 40%); }
  .related-card.reactivation .tag { color: hsl(212, 80%, 42%); }
  .related-card.conversion .tag { color: hsl(21, 100%, 45%); }
  .related-card.recovery .tag { color: hsl(142, 76%, 36%); }
  .related-card h4 {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    color: var(--slate-800);
    line-height: 1.3;
  }

  /* ─── CLUSTER LINKS ─── */
  .cluster-links {
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
    border-radius: 10px;
    padding: 1.4rem 1.6rem;
    margin: 2.5rem 0;
  }
  .cluster-links-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-400);
    margin-bottom: 0.8rem;
  }
  .cluster-links ul { list-style: none; padding: 0; margin: 0; }
  .cluster-links li {
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
  }
  .cluster-links li::before {
    content: '→';
    color: var(--amber-500);
    margin-right: 0.5rem;
    font-weight: 600;
  }
  .cluster-links a {
    color: var(--slate-700);
    text-decoration: none;
    border-bottom: 1px dashed var(--slate-300);
    transition: all 0.2s;
  }
  .cluster-links a:hover { color: var(--amber-500); border-bottom-color: var(--amber-500); }

  /* ─── FOOTER ─── */
  /* Footer styles now in centralized blog-footer.js component */

  /* ─── RESPONSIVE ─── */
  @media (max-width: 768px) {
    .related-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 640px) {
    html { font-size: 16px; }
    .hero { padding: 3rem 1.5rem 3rem; }
    .content { padding: 2.5rem 1.5rem 4rem; }
    .hero-meta { gap: 1rem; }
    .toc-bar { padding: 0 1rem; }
  }

  /* ─── ANIMATE IN ─── */
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.6s ease forwards;
  }
  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }
  .fade-in:nth-child(2) { animation-delay: 0.1s; }
  .fade-in:nth-child(3) { animation-delay: 0.18s; }
  .fade-in:nth-child(4) { animation-delay: 0.26s; }

/* Top bar styles moved to components/blog-top-bar.css */

/* ── Article Wrap (sidebar + content) ── */
.article-wrap {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 48px 24px 80px;
  align-items: start;
}

@media (max-width: 860px) {
  .article-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.article {
  max-width: 780px;
}

/* Remove old TOC bar styles - now using sidebar TOC component */
.toc-bar {
  display: none;
}

/* Adjust body padding for top bar */
body {
  padding-top: calc(88px + 32px) !important; /* Navigation + top bar */
}
