/* ===== BLOG POST design system =====
   Shared across all individual blog post pages (extracted from prototype).
*/

/* Reading-progress bar — pinned to the bottom of the viewport.
   Width is driven by JS via requestAnimationFrame; the CSS transition
   smooths each frame's update so scrolling feels buttery instead of steppy. */
.read-progress {
  position: fixed;
  bottom: 0; left: 0;
  height: 5px;
  width: 0;
  z-index: 110;
  background: var(--b-gradient);
  border-top-right-radius: 4px;
  box-shadow: 0 -2px 8px rgba(53,190,239,.25);
  transition: width 140ms cubic-bezier(.22,.61,.36,1),
              opacity 280ms var(--ease),
              transform 280ms var(--ease);
  pointer-events: none;
  transform: translateY(0);
}
.read-progress.is-faded {
  opacity: 0;
  transform: translateY(100%);
}

/* Compact dark band above the article — breadcrumb + dates */
.blog-head {
  background: #0b1a35;
  color: #fff;
  position: relative;
  padding: clamp(96px, 11vw, 132px) 0 clamp(24px, 3vw, 40px);
  overflow: hidden;
  isolation: isolate;
}
.blog-head::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 400px at 90% 0%, rgba(53,190,239,.18), transparent 60%),
    radial-gradient(600px 360px at 0% 100%, rgba(47,85,162,.22), transparent 60%);
  pointer-events: none;
}
.blog-head__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.6);
  font-size: 14px;
}
.breadcrumb a {
  color: rgba(255,255,255,.75);
  transition: color 180ms var(--ease);
}
.breadcrumb a:hover { color: var(--b-bright); }
.breadcrumb .sep { color: rgba(255,255,255,.3); padding: 0 4px; }
.breadcrumb .current {
  color: #fff;
  font-weight: 500;
}
.blog-dates {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.blog-dates .pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.blog-dates .pair strong { color: #fff; font-weight: 600; }

/* Article body layout */
.article-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(40px, 5vw, 72px);
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 80px) var(--pad-x);
}
@media (max-width: 980px) {
  .article-wrap { grid-template-columns: 1fr; }
}

/* Sticky TOC */
.toc {
  position: sticky;
  top: 100px;
  align-self: start;
}
@media (max-width: 980px) {
  .toc {
    position: static;
    background: var(--bg-alt);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
  }
}
.toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--b-deep);
  margin-bottom: 18px;
}
.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid var(--rule);
}
.toc__list a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.toc__list a:hover { color: var(--b-deep); }
.toc__list a.is-active {
  color: var(--b-deep);
  font-weight: 600;
  border-left-color: var(--b-bright);
}

/* Article content */
.article { min-width: 0; }
.article__hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}
.article h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 24px;
}
.article h1 .accent { color: var(--b-bright); }
.article h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 48px 0 18px;
  scroll-margin-top: 96px;
}
.article h3 {
  font-size: clamp(18px, 1.6vw, 21px);
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 12px;
}
.article p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.article p strong { color: var(--ink); font-weight: 600; }
.article p a, .article li a {
  color: var(--b-deep);
  text-decoration: underline;
  text-decoration-color: rgba(47,85,162,.3);
  text-underline-offset: 3px;
  transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease);
}
.article p a:hover, .article li a:hover {
  color: var(--b-bright);
  text-decoration-color: var(--b-bright);
}
.article p.lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}
.article ul, .article ol {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-left: 24px;
  margin: 0 0 20px;
}
.article ul li, .article ol li { margin-bottom: 10px; }
.article ul li::marker { color: var(--b-bright); }
.article ol li::marker { color: var(--b-deep); font-weight: 600; }
.article img {
  width: 100%;
  border-radius: var(--radius);
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}

/* Body photo figures — keep separate from blog-illustration SVG cards */
.article > figure.body-photo {
  margin: 28px 0;
}
.article > figure.body-photo img {
  margin: 0;
}
.article > figure.body-photo figcaption {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
}

/* Callout boxes */
.callout {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--b-bright);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 32px 0;
}
.callout__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--b-deep);
  margin-bottom: 8px;
}
.callout p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.callout--tip { border-left-color: var(--b-bright); }
.callout--stat { border-left-color: var(--b-deep); }
.callout--warn {
  border-left-color: #d97706;
  background: #fff8ed;
}
.callout--warn .callout__label { color: #b04a00; }

/* Inline blog illustrations — custom SVG diagrams for each post.
   Designed to visualize a specific concept rather than be decorative. */
.blog-illustration {
  margin: 36px 0;
  padding: 28px 24px 18px;
  background: linear-gradient(180deg, #f7fafd 0%, #ffffff 100%);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.blog-illustration svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  box-shadow: none;
  border-radius: 0;
}
.blog-illustration__caption {
  display: block;
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: .01em;
}
.blog-illustration__caption strong { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .blog-illustration { padding: 20px 16px 14px; }
}

/* Article FAQ */
.article-faq { margin-top: 56px; }
.article-faq h2 { margin-top: 0; }
.article-faq__item {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.article-faq__item[open] { border-color: var(--b-bright); box-shadow: var(--shadow-sm); }
.article-faq__item summary {
  padding: 20px 24px;
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr 22px;
  align-items: center;
  gap: 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.article-faq__item summary::-webkit-details-marker { display: none; }
.article-faq__item summary::after {
  content: "";
  width: 22px; height: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f55a2' stroke-width='2.4' stroke-linecap='round'><line x1='12' y1='5' x2='12' y2='19'/><line x1='5' y1='12' x2='19' y2='12'/></svg>");
  background-size: contain;
  transition: transform 200ms var(--ease);
}
.article-faq__item[open] summary::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f55a2' stroke-width='2.4' stroke-linecap='round'><line x1='5' y1='12' x2='19' y2='12'/></svg>");
}
.article-faq__item > p {
  padding: 0 24px 20px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

/* Article CTA at the end */
.article-cta {
  margin-top: 56px;
  padding: 36px;
  background: linear-gradient(135deg, var(--b-deep) 0%, var(--b-bright) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 50px rgba(47,85,162,.25);
}
.article-cta h2 { color: #fff; font-size: clamp(22px, 2.4vw, 28px); margin: 0 0 12px; }
.article-cta p { color: rgba(255,255,255,.85); font-size: 16px; line-height: 1.6; margin: 0 0 24px; }

/* Download card — for PDF resources inside a post */
.download-card {
  margin: 36px 0;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid #e3e7ee;
  border-left: 4px solid var(--b-bright);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: center;
  box-shadow: 0 4px 16px rgba(11, 26, 53, .06);
}
.download-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--b-deep) 0%, var(--b-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.download-card__icon svg { width: 28px; height: 28px; }
.download-card__body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.download-card__body p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft, #58607a);
  line-height: 1.5;
}
.download-card__body .meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--b-deep);
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.download-card .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .download-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px;
  }
  .download-card__icon { margin: 0 auto; }
  .download-card .btn { width: 100%; }
}

/* Related posts */
.related {
  background: var(--bg-alt);
  padding: clamp(64px, 7vw, 96px) 0;
}
.related h2 {
  text-align: center;
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.015em;
  margin: 0 auto 48px;
  max-width: 720px;
}
.related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
}
@media (max-width: 980px) { .related__grid { grid-template-columns: 1fr; } }
.related-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms var(--ease),
              box-shadow 200ms var(--ease),
              border-color 200ms var(--ease);
}
.related-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--b-bright);
}
.related-card img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
}
.related-card .body { padding: 20px 22px 24px; }
.related-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  transition: color 180ms var(--ease);
}
.related-card:hover h3 { color: var(--b-deep); }
