/* Article pages. Progress, sidebar, and the three CTAs. */

.read-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  background: var(--ink-strong);
  transform: scaleX(0);
  transform-origin: left center;
}

.post-masthead,
.post-body-section,
.related-wrap {
  width: min(1140px, calc(100% - 60px));
  margin: 0 auto;
}

.post-masthead {
  padding: 2.4rem 0 1.2rem;
}

.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.2rem;
  color: var(--kicker);
  font-size: 0.92rem;
}

.post-breadcrumb a {
  color: var(--ink);
  text-decoration: none;
}

.bc-current {
  color: var(--ink-strong);
}

.post-meta-top {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.8rem;
  color: var(--kicker);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.post-masthead h1 {
  margin: 0 0 0.9rem;
  max-width: 18em;
  color: var(--ink-strong);
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.22;
}

.post-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.12rem;
  font-weight: 300;
  line-height: 1.7;
}

.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1.2rem;
  color: var(--kicker);
  font-size: 0.92rem;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3rem;
  align-items: start;
  padding-bottom: 3rem;
}

.article-content h2 {
  margin: 2.2rem 0 0.6rem;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 400;
}

.article-content h3 {
  margin: 1.3rem 0 0.4rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 400;
}

.article-content p,
.article-content li {
  color: var(--muted);
}

.article-content ul,
.article-content ol {
  padding-left: 1.15rem;
}

.article-content code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.callout,
.tip,
.warning {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--line);
  color: var(--ink);
}

.warning {
  border-left-color: #8d3b3b;
}

.data-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
  color: var(--ink);
}

.data-table th {
  color: var(--kicker);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.metric-card {
  padding: 0.9rem 0.2rem;
  border-top: 1px solid var(--line);
}

.metric-card b {
  display: block;
  color: var(--ink-strong);
  font-size: 1.35rem;
  font-weight: 400;
}

.metric-card span {
  color: var(--kicker);
  font-size: 0.86rem;
}

.step-list {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-item {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.6rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.step-item::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  color: var(--kicker);
  letter-spacing: 0.08em;
}

.panel-card {
  position: sticky;
  top: calc(var(--nav-h) + 1.2rem);
}

.toc-list {
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}

.toc-list a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.4rem;
  padding: 0.35rem 0;
  color: var(--kicker);
  text-decoration: none;
}

.toc-list a.is-on,
.toc-list a[aria-current="true"] {
  color: var(--ink-strong);
}

.sidebar-cta,
.article-cta-section {
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
}

.sidebar-cta p,
.article-cta-section p {
  margin: 0.35rem 0;
}

.cta-price,
.fc-price {
  color: var(--ink-strong);
  font-size: 1.35rem;
}

.btn-cta,
.btn-cta-primary,
.fc-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 0.6rem;
  padding: 0 1rem;
  border-radius: 6px;
  background: var(--ink-strong);
  color: #fff;
  text-decoration: none;
}

.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin: 0.6rem 0 0 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.cta-spec-card {
  margin-top: 1rem;
  color: var(--kicker);
  font-size: 0.92rem;
}

.article-cta-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 400;
}

.related-wrap {
  padding: 0 0 4rem;
}

.related-wrap h2 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 400;
}

.related-list {
  display: grid;
  gap: 0.2rem;
}

.related-card {
  display: block;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.related-card b {
  display: block;
  margin: 0.2rem 0;
  color: var(--ink-strong);
  font-weight: 400;
  font-size: 1.15rem;
}

.related-card span,
.related-card p {
  margin: 0;
  color: var(--kicker);
}

.floating-cta {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 40;
  width: min(240px, calc(100% - 2rem));
  padding: 1rem 1rem 0.9rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(25, 25, 25, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.floating-cta.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.floating-cta p {
  margin: 0;
}

#floatingCtaClose {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .post-masthead,
  .post-body-section,
  .related-wrap {
    width: min(1140px, calc(100% - 32px));
  }

  .post-layout,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .panel-card {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .read-progress-bar,
  .floating-cta {
    transition: none;
  }
}
