/* ==========================================================================
   Run Playgrounds — article-components.css
   Elements inside .article-content (the CMS %%article_content%% body):
   headings, paragraphs, lists, tables, quotes, code, figures, CTA banner.
   H2s are numbered like drawing sheets (outline index dot, §0 motif ①).
   ========================================================================== */

.article-content { counter-reset: art-h2; font-size: var(--t-17); line-height: 1.7; color: var(--char); }
.article-content > *:first-child { margin-top: 0; }

.article-content h2 {
  counter-increment: art-h2;
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; align-items: start;
  margin: 64px 0 20px; padding-top: 24px; border-top: 1px solid var(--char);
  font-size: var(--t-30); font-weight: 700; line-height: 1.15; color: var(--green);
  scroll-margin-top: 148px;
}
.article-content h2::before {
  content: counter(art-h2, decimal-leading-zero);
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--char);
  display: grid; place-items: center; margin-top: -2px;
  font-family: var(--f-mono); font-size: var(--t-13); font-weight: 500; letter-spacing: 0; color: var(--char);
}
.article-content h3 {
  margin: 36px 0 12px; font-size: var(--t-23); font-weight: 600; line-height: 1.25; color: var(--char);
  scroll-margin-top: 148px;
}
.article-content h4 {
  margin: 28px 0 10px; font-family: var(--f-mono); font-size: var(--t-13); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); scroll-margin-top: 148px;
}

.article-content p,
.article-content ul,
.article-content ol { margin: 0 0 20px; }
.article-content ul,
.article-content ol { padding-left: 24px; }
.article-content li + li { margin-top: 8px; }
.article-content li::marker { color: var(--green); font-family: var(--f-mono); }
.article-content strong { font-weight: 700; color: var(--char); }
.article-content a { color: var(--green); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; }
.article-content a:hover { text-decoration-thickness: 2px; }

/* checklist: square boxes, like a drawing check column */
.article-content ul.checklist { list-style: none; padding: 0; border-top: 1px solid var(--line-white); }
.article-content ul.checklist li { position: relative; margin: 0; padding: 12px 0 12px 36px; border-bottom: 1px solid var(--line-white); }
.article-content ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: 15px; width: 18px; height: 18px;
  border: 1.5px solid var(--char); border-radius: var(--radius);
}
.article-content ul.checklist li::after {
  content: ""; position: absolute; left: 5px; top: 18px; width: 8px; height: 5px;
  border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg);
}

/* ---------- tables ---------- */
.article-content table {
  width: 100%; border-collapse: collapse; margin: 0 0 24px; background: #FFFFFF;
  border-top: 1.5px solid var(--char); border-bottom: 1.5px solid var(--char); font-size: var(--t-17);
}
.article-content thead th {
  padding: 12px 14px; text-align: left; vertical-align: bottom; background: var(--char); color: #FFFFFF;
  font-family: var(--f-mono); font-size: var(--t-13); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
.article-content tbody td,
.article-content tbody th { padding: 12px 14px; vertical-align: top; text-align: left; border-top: 1px solid var(--line-white); line-height: 1.5; }
.article-content tbody th { font-weight: 600; }
.article-content tbody tr:nth-child(even) td,
.article-content tbody tr:nth-child(even) th { background: #F4F1EA; }
.article-content td.num-col, .article-content td code { font-family: var(--f-mono); }
.article-content caption { caption-side: bottom; padding-top: 10px; text-align: left; font-family: var(--f-mono); font-size: var(--t-13); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- quotes ---------- */
.article-content blockquote {
  margin: 0 0 24px; padding: 20px 24px; background: #F4F1EA; border-left: 4px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--t-23); line-height: 1.45; font-weight: 500; color: var(--char);
}
.article-content blockquote > *:last-child { margin-bottom: 0; }
.article-content blockquote cite { display: block; margin-top: 12px; font-style: normal; font-family: var(--f-mono); font-size: var(--t-13); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- code ---------- */
.article-content code { padding: 2px 6px; border-radius: var(--radius); background: #F4F1EA; color: var(--green); font-family: var(--f-mono); font-size: .9em; }
.article-content pre { margin: 0 0 24px; padding: 16px 20px; border-radius: var(--radius); background: var(--char); color: #FFFFFF; overflow-x: auto; }
.article-content pre code { padding: 0; background: transparent; color: inherit; }

/* ---------- figures (part-number caption, §0 motif ③) ---------- */
.article-content img { max-width: 100%; height: auto; display: block; border-radius: 0; }
.article-content figure { margin: 32px 0; }
.article-content figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-content figcaption { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; margin-top: 10px; color: var(--muted); font-size: var(--t-17); line-height: 1.5; }
.article-content figcaption b { flex: 0 0 auto; border: 1px solid var(--char); padding: 2px 8px; color: var(--char);
  font-family: var(--f-mono); font-size: var(--t-13); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

.article-content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line-white); }

/* ---------- key figure row inside an article ---------- */
.article-content .fact-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 24px; border-top: 1px solid var(--char); border-bottom: 1px solid var(--char); }
.article-content .fact-row > div { padding: 16px 16px 16px 0; }
.article-content .fact-row > div + div { padding-left: 16px; border-left: 1px solid var(--line-white); }
.article-content .fact-row b { display: block; font-family: var(--f-mono); font-size: var(--t-40); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; color: var(--char); }
.article-content .fact-row b small { font-size: var(--t-13); letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.article-content .fact-row span { display: block; margin-top: 6px; font-size: var(--t-17); line-height: 1.4; color: var(--muted); }

/* ---------- CTA banner (inline, inside the article) ---------- */
.cta-banner {
  margin: 40px 0; padding: 32px; border-radius: var(--radius); background: var(--green); color: var(--on-dark-2);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: center;
}
.cta-banner-title { grid-column: 1; margin: 0; font-size: var(--t-23); font-weight: 700; line-height: 1.25; color: #FFFFFF; }
.cta-banner-body { grid-column: 1; margin: 0; font-size: var(--t-17); color: var(--on-dark-2); }
.cta-banner-button,
.article-content a.cta-banner-button {
  grid-column: 2; grid-row: 1 / span 2;
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border-radius: var(--radius); background: var(--yellow); color: var(--char);
  font-weight: 700; font-size: var(--t-17); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  transition: filter .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cta-banner-button:hover,
.article-content a.cta-banner-button:hover { filter: brightness(.94); box-shadow: 6px 6px 0 var(--char); transform: translate(-2px, -2px); color: var(--char); }
.cta-banner-button:focus-visible { outline-color: var(--yellow); }

@media (max-width: 767.98px) {
  .article-content h2 { font-size: var(--t-23); grid-template-columns: 32px minmax(0, 1fr); gap: 12px; margin-top: 48px; }
  .article-content h2::before { width: 32px; height: 32px; }
  .article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-content .fact-row { grid-template-columns: 1fr; }
  .article-content .fact-row > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-white); }
  .cta-banner { grid-template-columns: 1fr; padding: 24px 20px; }
  .cta-banner-button, .article-content a.cta-banner-button { grid-column: 1; grid-row: auto; justify-self: start; }
}
