/* Blog article page ("Blog details page"). Builds on blog.css (chip, post-card) and components.css. */

/* ---------- Layout: sticky sidebar + article ---------- */
.article-layout {
  display: grid;
  /* 363 / 153 / 750 at full width (1266 total); columns shrink in proportion below that */
  grid-template-columns: minmax(200px, 363fr) minmax(0, 750fr);
  column-gap: clamp(40px, 8vw, 153px);
  max-width: 1266px;
  margin-inline: auto;
  padding-top: clamp(120px, 10vw, 192px); /* clears the fixed header */
}

/* Like the reference: the sidebar column stretches with the article, and its
   inner block sticks just below the header while the article scrolls. */
.article-aside__inner {
  position: sticky;
  top: 144px;
  display: grid;
  gap: 24px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 20px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
.article-back__icon {
  width: 24px;
  height: 24px;
  fill: transparent;
  stroke: var(--navy);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.article-back:hover { color: var(--navy); }
.article-back:hover .article-back__icon { fill: rgba(12, 20, 29, 0.1); transform: translateX(-3px); }

.article-toc {
  display: grid;
  gap: 16px;
  padding-block: 24px;
  border-block: 1px solid var(--border);
}
.article-toc a {
  position: relative;
  font-size: 1rem;
  line-height: 24px;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
/* Teal marker slides in for the section currently being read */
.article-toc a::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--teal);
  transform: scaleY(0);
  transition: transform var(--t-fast) var(--ease);
}
.article-toc a:hover { color: var(--navy); }
.article-toc a.is-active { color: var(--navy); font-weight: 600; }
.article-toc a.is-active::before { transform: scaleY(1); }

.article-share { display: flex; gap: 8px; }
.share-btn {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #000;
}
.share-btn svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1; transition: fill var(--t-fast) var(--ease); }
.share-btn svg .fill { fill: currentColor; stroke: none; transition: fill var(--t-fast) var(--ease); }
.share-btn:hover svg { fill: var(--navy); }
.share-btn:hover svg .fill { fill: var(--white); }
.share-btn__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  line-height: 16px;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
}
.share-btn__tip:not(:empty) { opacity: 1; }

/* ---------- Article ---------- */
.article__head { display: grid; gap: 48px; }
.article__intro { display: grid; gap: 16px; }
.article__intro .chip { justify-self: start; }
.article__title {
  font-size: var(--fs-h2); /* 40 */
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.article__media { aspect-ratio: 750 / 470; }
.article [data-hero-step] { animation: rise 800ms var(--ease) both; animation-delay: calc(var(--i, 0) * 100ms + 100ms); }

.article__body {
  display: grid;
  gap: 60px;
  margin-top: 48px;
  font-size: var(--fs-lead);
  line-height: 1.5; /* 20 / 30 */
}
.article__body section { display: grid; gap: 20px; }
.article__paras { display: grid; gap: 8px; } /* paragraphs inside one Figma text block: 8px paragraph spacing */
.article__body h2 {
  font-size: var(--fs-h3); /* 24 */
  line-height: 1.33;
  font-weight: 600;
}
.article__body ul { display: grid; gap: 16px; padding-left: 1.4em; list-style: disc; }
.article__body li { font-weight: 500; }
.article__body li::marker { color: var(--teal); }
.article__cta-link {
  font-weight: 600;
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.article__cta-link:hover { text-decoration-color: currentColor; }

/* ---------- More like this ---------- */
.more-posts__title { font-size: var(--fs-h2); line-height: 1.2; }
.more-posts .blog__grid { margin-top: 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  /* On small screens the table of contents is dropped, as in the reference;
     Back and the share buttons sit in one row above the article. */
  .article-aside__inner { position: static; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .article-toc { display: none; }
  .article__body { gap: 44px; }
}
@media (max-width: 639px) {
  .article__head { gap: 32px; }
  .article__body { margin-top: 32px; gap: 36px; }
  .article__body section { gap: 14px; }
  .article__body ul { gap: 12px; }
}
