/* ═══════════════════════════════════════════════════════════════════
   IQ HEALTHSPAN — ARTICLE STYLES
   Include on article pages: <link rel="stylesheet" href="../css/article-styles.css">
   Must be loaded AFTER shared-styles.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── BREADCRUMB ── */
.breadcrumb-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  margin-top: calc(var(--nav-height) + 3px);
}
.breadcrumb {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-dark); }

/* ── ARTICLE LAYOUT — with sticky TOC ── */
.article-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem var(--page-pad) 4rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}

/* ── TABLE OF CONTENTS (sticky sidebar) ── */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.toc-label {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.6rem;
}
.toc-list {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.toc-link {
  display: block; font-size: 0.75rem; color: var(--muted);
  text-decoration: none; padding: 0.35rem 0.6rem;
  border-left: 2px solid var(--border);
  transition: all 0.15s; line-height: 1.35;
}
.toc-link:hover {
  color: var(--terracotta);
  border-left-color: var(--terracotta);
}
.toc-link.active {
  color: var(--terracotta);
  border-left-color: var(--terracotta);
  font-weight: 600;
  background: rgba(196,103,58,0.04);
}
.toc-time {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.7rem; color: var(--muted);
  margin-top: 1rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.toc-tool-cta {
  display: block; margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(196,103,58,0.06);
  border: 1px solid rgba(196,103,58,0.15);
  border-radius: 10px; text-decoration: none;
  transition: all 0.15s;
}
.toc-tool-cta:hover {
  border-color: var(--terracotta);
  background: rgba(196,103,58,0.1);
}
.toc-tool-cta .tt-label {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 0.2rem;
}
.toc-tool-cta .tt-name {
  font-size: 0.78rem; font-weight: 600;
  color: var(--ink); line-height: 1.3;
}

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc-sidebar {
    position: static;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
  }
}

/* ── ARTICLE CONTENT ── */
.article-main { max-width: 720px; min-width: 0; }

/* Pills / tags */
.article-pills { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pill {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 100px;
}
.pill-num { background: var(--ink); color: var(--amber); }
.pill-cat { background: rgba(196,103,58,0.1); border: 1px solid rgba(196,103,58,0.2); color: var(--terracotta); }
.pill-type { background: var(--cream); border: 1px solid var(--border); color: var(--earth); }
.pill-meta { background: var(--cream); border: 1px solid var(--border); color: var(--earth); }

/* Title */
.article-main h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 800; line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink); margin-bottom: 1rem;
}
.article-main h1 em { font-style: italic; color: var(--terracotta); }

/* Lede */
.article-lede {
  font-family: 'Lora', serif;
  font-size: 1rem; color: var(--earth);
  line-height: 1.8; font-style: italic;
  margin-bottom: 1.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* Byline */
.byline { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; flex-wrap: wrap; }
.byline-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.byline-name { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.byline-role { font-size: 0.68rem; color: var(--muted); }
.byline-sep { width: 1px; height: 24px; background: var(--border); }
.byline-date-val { font-size: 0.8rem; font-weight: 600; color: var(--warm-dark); }
.byline-date-label { font-size: 0.58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.byline-cited {
  display: flex; align-items: center; gap: 4px;
  background: rgba(107,140,110,0.1);
  border: 1px solid rgba(107,140,110,0.2);
  color: var(--sage);
  font-size: 0.68rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 100px;
}

/* Body typography */
.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25;
  color: var(--ink);
  margin: 2.5rem 0 0.8rem;
  scroll-margin-top: calc(var(--nav-height) + 20px);
}
.article-body p {
  font-family: 'Lora', serif;
  font-size: 0.98rem; line-height: 1.85;
  color: #2a2820; margin-bottom: 1.3rem;
}
.article-body p strong {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: 0.95em; color: var(--ink);
}
.article-body a {
  color: var(--terracotta); text-decoration: none;
  border-bottom: 1px solid rgba(196,103,58,0.3);
}
.article-body a:hover { border-bottom-color: var(--terracotta); }
.article-body ul { padding-left: 1.5rem; margin-bottom: 1.3rem; }
.article-body li {
  font-family: 'Lora', serif;
  font-size: 0.95rem; line-height: 1.8;
  color: #2a2820; margin-bottom: 0.4rem;
}
sup {
  font-size: 0.6rem; font-weight: 700;
  color: var(--terracotta); margin-left: 1px;
}

/* ── KEY TAKEAWAYS ── */
.key-takeaways {
  background: linear-gradient(135deg, var(--warm-dark), #3d3020);
  border-radius: 13px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}
.kt-label {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 7px;
}
.kt-label::before { content: ''; width: 16px; height: 2px; background: var(--amber); }
.key-takeaways ul { display: flex; flex-direction: column; gap: 0.55rem; }
.key-takeaways li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.82rem; line-height: 1.6;
  color: rgba(245,240,232,0.85); font-weight: 300;
}
.key-takeaways li::before {
  content: '→'; color: var(--amber);
  font-weight: 700; flex-shrink: 0; margin-top: 1px;
}

/* ── INLINE TOOL CTA (within article body) ── */
.inline-tool-cta {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: rgba(196,103,58,0.04);
  border: 1px solid rgba(196,103,58,0.15);
  border-left: 3px solid var(--terracotta);
  border-radius: 0 12px 12px 0;
  margin: 2rem 0;
  text-decoration: none;
  transition: all 0.15s;
}
.inline-tool-cta:hover {
  background: rgba(196,103,58,0.08);
  border-color: rgba(196,103,58,0.3);
}
.itc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(196,103,58,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.itc-text { flex: 1; min-width: 0; }
.itc-label {
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 0.15rem;
}
.itc-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.itc-desc { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.itc-arrow { color: var(--terracotta); font-size: 1rem; flex-shrink: 0; }

/* ── REFERENCES ── */
.refs {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}
.refs h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 700;
  color: var(--ink); margin-bottom: 1rem;
}
.ref-list { display: flex; flex-direction: column; gap: 0.45rem; }
.ref-list li {
  font-size: 0.75rem; color: var(--muted);
  line-height: 1.55; display: flex; gap: 0.6rem;
}
.ref-num {
  flex-shrink: 0; font-size: 0.65rem; font-weight: 700;
  color: var(--terracotta); background: rgba(196,103,58,0.1);
  border-radius: 4px; padding: 0.1rem 0.35rem; margin-top: 2px;
}
.ref-list a {
  color: var(--terracotta); text-decoration: none; font-weight: 600;
}

/* ── AUTHOR CARD ── */
.author-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 1.5rem;
  margin-top: 2rem;
}
.ac-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.75rem; }
.ac-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ac-name { font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; }
.ac-role { font-size: 0.72rem; color: var(--muted); }
.ac-bio { font-size: 0.8rem; color: var(--earth); line-height: 1.65; font-weight: 300; }

/* ── RELATED ARTICLES ── */
.related-section {
  margin-top: 2.5rem; padding-top: 2rem;
  border-top: 2px solid var(--border);
}
.related-label {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.related-label::before { content: ''; width: 16px; height: 2px; background: var(--terracotta); }
.related-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.related-card {
  display: block; padding: 1rem 1.1rem;
  background: white; border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  transition: all 0.15s; min-height: 44px;
}
.related-card:hover {
  border-color: var(--terracotta);
  box-shadow: 0 4px 16px rgba(196,103,58,0.08);
}
.related-cat {
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 0.2rem;
}
.related-title {
  font-size: 0.82rem; font-weight: 600;
  color: var(--ink); line-height: 1.3;
}
.related-meta {
  font-size: 0.65rem; color: var(--muted); margin-top: 0.3rem;
}
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ── DISCLAIMER ── */
.article-disclaimer {
  max-width: 720px;
  margin: 2rem 0 0;
  padding: 1.1rem 1.3rem;
  background: rgba(212,160,67,0.07);
  border: 1px solid rgba(212,160,67,0.18);
  border-radius: 10px;
  font-size: 0.78rem; line-height: 1.6;
  color: var(--earth);
}
.article-disclaimer a {
  color: var(--terracotta); font-weight: 600; text-decoration: none;
}
