/* ===== Article design v2 (loaded after style.css on blog posts) ===== */

.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 100; transition: width 0.08s linear;
}

/* Hero band */
.article-hero {
  background:
    radial-gradient(760px 340px at 88% -20%, rgba(0, 194, 168, 0.30), transparent 62%),
    radial-gradient(820px 420px at 0% 0%, rgba(75, 61, 245, 0.55), transparent 60%),
    #0b0c14;
  color: #fff;
  padding: 68px 0 60px;
}
.article-hero .article-header { border: 0; padding: 0; max-width: 820px; }
.article-hero .post-category {
  display: inline-block;
  background: rgba(0, 194, 168, 0.16);
  color: #5ff0d8;
  border: 1px solid rgba(95, 240, 216, 0.35);
  padding: 5px 14px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.article-hero h1 {
  color: #fff; font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.12; letter-spacing: -0.03em; font-weight: 800;
  margin: 18px 0 20px; max-width: 800px;
}
.article-hero .article-meta {
  color: rgba(255, 255, 255, 0.72); font-size: 0.92rem;
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
}
.article-hero .article-meta::before {
  content: ""; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* Layout: article + sticky sidebar */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 740px) 300px; gap: 56px;
  align-items: start; padding-top: 12px; padding-bottom: 8px;
}
.article-layout .article-body { max-width: none; padding: 36px 0 12px; font-size: 1.1rem; line-height: 1.78; color: #232634; }

.article-aside { position: sticky; top: 92px; padding-top: 40px; display: flex; flex-direction: column; gap: 20px; }
.toc-card, .aside-cta {
  border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow-sm);
}
.toc-card { padding: 20px 20px 14px; }
.toc-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--color-border);
  color: #4a5164; font-size: 0.88rem; line-height: 1.4; text-decoration: none;
}
.toc-list a:hover { color: var(--color-primary); }
.toc-list a.active { color: var(--color-primary); border-left-color: var(--color-primary); font-weight: 600; }
.aside-cta { padding: 22px; background: linear-gradient(160deg, #f4f2ff, #effffb); }
.aside-cta h4 { margin: 0 0 6px; font-size: 1rem; }
.aside-cta p { margin: 0 0 14px; font-size: 0.88rem; color: var(--color-muted); line-height: 1.55; }
.aside-cta .btn { display: block; text-align: center; padding: 11px 16px; font-size: 0.9rem; }

/* Mobile TOC */
.toc-mobile { display: none; }

/* Typography in the body */
body.article-page .article-body h2 {
  font-size: 1.65rem; letter-spacing: -0.02em; margin: 52px 0 16px; line-height: 1.25;
  padding-top: 8px; scroll-margin-top: 90px;
}
body.article-page .article-body h2::before {
  content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; margin-bottom: 14px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}
body.article-page .article-body h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.article-body > p:first-of-type { font-size: 1.22rem; line-height: 1.7; color: #14161c; }
.article-body a { text-decoration: underline; text-decoration-color: rgba(75, 61, 245, 0.35); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--color-primary); }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--color-primary); font-weight: 700; }

/* Key takeaways */
.takeaways {
  background: linear-gradient(160deg, #f4f2ff 0%, #effffb 100%);
  border: 1px solid #e0defb; border-radius: var(--radius);
  padding: 22px 26px 8px; margin: 6px 0 34px; box-shadow: var(--shadow-sm);
}
.takeaways .tk-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1rem; margin: 0 0 12px; color: #1d1a5e; }
.takeaways .tk-title::before { content: "\2605"; color: var(--color-primary); font-size: 1.1rem; }
.takeaways ul { margin: 0 0 14px; padding-left: 20px; }
.takeaways li { margin-bottom: 7px; font-size: 1rem; line-height: 1.6; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 26px 0; border-radius: var(--radius); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.table-wrap table { margin: 0; box-shadow: none; border-radius: 0; min-width: 560px; }
body.article-page .article-body th {
  background: #14122e; color: #fff; border-color: #14122e; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 14px 16px;
}
body.article-page .article-body td { padding: 14px 16px; border-color: var(--color-border); font-size: 0.96rem; vertical-align: top; }
body.article-page .article-body tbody tr:nth-child(even) td { background: #fafafd; }
body.article-page .article-body tbody td:first-child { font-weight: 700; color: #14161c; }

/* CTA callouts */
body.article-page .callout {
  position: relative; overflow: hidden; border: 0; border-radius: var(--radius);
  padding: 26px 28px; margin: 40px 0; color: #fff;
  background: linear-gradient(135deg, #2a1fb8 0%, #4b3df5 55%, #00a894 130%);
  box-shadow: var(--shadow-md);
}
body.article-page .callout::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
body.article-page .callout p { margin: 0; position: relative; z-index: 1; font-size: 1.02rem; line-height: 1.65; }
body.article-page .callout strong { display: block; font-size: 1.12rem; margin-bottom: 6px; }
body.article-page .callout a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* FAQ accordion */
.faq-list { margin: 20px 0 8px; display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--color-border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color 0.2s, box-shadow 0.2s; }
.faq-item[open] { border-color: #cfcaf9; box-shadow: var(--shadow-md); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 17px 54px 17px 20px; position: relative;
  font-weight: 700; font-size: 1.02rem; line-height: 1.45; color: #14161c;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--color-primary); font-weight: 600;
}
.faq-item[open] summary::after { content: "\2212"; background: var(--color-primary); color: #fff; }
.faq-item summary:focus-visible { outline: 3px solid rgba(75, 61, 245, 0.4); outline-offset: 2px; border-radius: 12px; }
.faq-item .faq-answer { padding: 0 20px 6px; }
.faq-item .faq-answer p { margin: 0 0 14px; font-size: 1rem; color: #3b4254; }

/* Author card */
body.article-page .author-box {
  max-width: none; background: #fff; border: 1px solid var(--color-border); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 26px; margin: 28px 0 56px; align-items: center;
}
body.article-page .author-box .author-avatar { width: 64px; height: 64px; }
body.article-page .author-box h4 { font-size: 1.08rem; }

@media (max-width: 1020px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-aside { display: none; }
  .toc-mobile { display: block; margin: 26px 0 0; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
  .toc-mobile summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 700; font-size: 0.95rem; }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after { content: "\25BE"; float: right; color: var(--color-primary); }
  .toc-mobile .toc-list { padding: 0 18px 12px; max-height: none; }
}
@media (max-width: 640px) {
  .article-hero { padding: 48px 0 42px; }
  .article-layout .article-body { font-size: 1.04rem; }
  body.article-page .article-body h2 { font-size: 1.4rem; margin-top: 42px; }
  .takeaways { padding: 18px 18px 4px; }
  body.article-page .callout { padding: 22px 20px; }
  body.article-page .author-box { flex-direction: row; padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .read-progress, .faq-item { transition: none; }
}
@media print {
  .read-progress, .article-aside, .toc-mobile, .site-header, .site-footer { display: none !important; }
  .article-hero { background: #fff; color: #000; }
  .article-hero h1, .article-hero .article-meta { color: #000; }
}
