/* ── Articles: index listing + long-form article ──────────────────────── */

/* Index ---------------------------------------------------------------- */
.article-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--rule);
  background: var(--rule);
}
@media (max-width: 760px) { .article-list-grid { grid-template-columns: 1fr; } }
/* A lone article would otherwise leave the grid's divider colour showing as an
   empty second cell. */
.article-list-grid:has(> :only-child) { grid-template-columns: 1fr; }

.article-card {
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  padding: clamp(24px, 2.6vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 240px;
  position: relative;
  transition: background .2s;
}
.article-card:hover { background: var(--bg-deep); }
.article-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; height: 3px; width: 0;
  background: var(--brand);
  transition: width .25s ease;
}
.article-card:hover::before { width: 100%; }
.article-card-title {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 4px 0 0;
}
.article-card-excerpt {
  margin: 0;
  flex: 1;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-3);
}
.article-card-more {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-ink);
}
.article-card-time { color: var(--ink-4); margin-left: 8px; }

/* Article -------------------------------------------------------------- */
.article { max-width: 760px; }
.article-head { border-bottom: 1px solid var(--rule); padding-bottom: clamp(20px, 2.4vw, 32px); }
.article-head .eyebrow a { color: inherit; border-bottom: 1px solid var(--rule); }
.article-head .eyebrow a:hover { border-color: var(--brand); }
.article-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 12px 0 0;
}
.article-dek {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.5;
  color: var(--ink-3);
  margin: 16px 0 0;
  max-width: 60ch;
}
.article-meta {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  margin: 18px 0 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.article-body { padding-top: clamp(24px, 3vw, 40px); }
.article-body h2 {
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: clamp(32px, 3.4vw, 48px) 0 0;
}
.article-body p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 16px 0 0;
}
.article-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.article-list li {
  position: relative;
  padding-left: 26px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.article-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 14px;
}
.article-quote {
  margin: 28px 0 0;
  padding: 18px 0 18px 22px;
  border-left: 3px solid var(--brand);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}

.article-fig {
  margin: clamp(28px, 3vw, 40px) 0 0;
  border: 1px solid var(--rule);
  background: var(--bg-deep);
}
.article-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--rule);
}
.article-fig figcaption {
  padding: 14px clamp(14px, 2vw, 20px);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.article-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: clamp(28px, 3vw, 40px) 0 0;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.article-stats > div {
  padding: 20px clamp(14px, 2vw, 22px);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.article-stats > div:last-child { border-right: none; }
@media (max-width: 720px) {
  .article-stats { grid-template-columns: repeat(2, 1fr); }
  .article-stats > div:nth-child(2n) { border-right: none; }
  .article-stats > div { border-bottom: 1px solid var(--rule); }
  .article-stats > div:last-child, .article-stats > div:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

.article-table-wrap { margin: clamp(28px, 3vw, 40px) 0 0; overflow-x: auto; }
.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 460px;
}
.article-table th, .article-table td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  vertical-align: top;
}
.article-table th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--bg-deep);
  font-weight: 500;
}
.article-table td { color: var(--ink-2); line-height: 1.55; }
/* Scores and build names read as units — never split them across lines. */
.article-table td:nth-child(-n+5) { white-space: nowrap; }
.article-table th:first-child, .article-table td:first-child { font-family: var(--mono); color: var(--ink-4); }

.article-cta {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(26px, 3vw, 40px);
  border: 1px solid var(--rule);
  background: var(--bg-deep);
}
.article-cta .section-title { font-size: clamp(22px, 2.6vw, 30px); }
.article-cta .section-lede { max-width: 58ch; }
.article-cta-actions {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ── Coloured panel: a run of blocks set off from the body ─────────────── */
.article-panel {
  margin: clamp(32px, 3.6vw, 52px) 0 0;
  padding: clamp(22px, 2.6vw, 36px);
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-left-width: 4px;
}
.article-panel > h2:first-child { margin-top: 0; }
.article-panel .article-stats { background: var(--paper); border-color: var(--brand); }
.article-panel .article-stats > div { border-color: var(--brand); }
.article-panel .article-stats .stat-num { color: var(--brand-ink); }
.article-panel p { color: var(--ink); }
.article-panel p strong { color: var(--brand-ink); }

/* ── Newsletter sign-up (plugin form, restyled to the site) ─────────────── */
.article-newsletter { margin-top: clamp(40px, 5vw, 64px); }
.article-newsletter .apigoat-nl {
  max-width: none;
  margin: 0;
  padding: clamp(24px, 2.6vw, 36px);
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
  position: relative;
}
.article-newsletter .apigoat-nl::before {
  content: "";
  position: absolute;
  left: 0; top: 0; height: 3px; width: 100%;
  background: var(--brand);
}
.article-newsletter .apigoat-nl__title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.article-newsletter .apigoat-nl__subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 58ch;
  margin: 0 0 18px;
}
.article-newsletter .apigoat-nl__label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.article-newsletter .apigoat-nl__input {
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg-deep);
}
.article-newsletter .apigoat-nl__input:focus {
  border-color: var(--brand);
  box-shadow: none;
  background: var(--paper);
}
.article-newsletter .apigoat-nl__consent { font-size: 13.5px; color: var(--ink-3); }
.article-newsletter .apigoat-nl__submit {
  padding: 13px 20px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  transition: all .18s;
}
.article-newsletter .apigoat-nl__submit:hover,
.article-newsletter .apigoat-nl__submit:focus {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
}
.article-newsletter .apigoat-nl__notice { border-radius: 0; font-family: var(--mono); font-size: 13px; }
/* Name and email side by side on wide screens; everything else spans. */
.article-newsletter .apigoat-nl { display: grid; grid-template-columns: 1fr; column-gap: 12px; }
.article-newsletter .apigoat-nl > * { grid-column: 1 / -1; }
.article-newsletter .apigoat-nl__row { margin: 8px 0; }
@media (min-width: 700px) {
  .article-newsletter .apigoat-nl { grid-template-columns: 1fr 1fr; }
  .article-newsletter .apigoat-nl__row:not(.apigoat-nl__consent):not(.apigoat-nl__actions):not(.apigoat-nl__captcha) { grid-column: auto; }
}

/* ── Rules: the pass/fail criteria, set as a numbered ledger ────────────── */
.article-rules {
  list-style: none;
  counter-reset: rule;
  margin: 22px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.article-rules li {
  counter-increment: rule;
  position: relative;
  padding: 18px 0 18px 56px;
  border-bottom: 1px solid var(--rule);
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.article-rules li::before {
  content: "0" counter(rule);
  position: absolute;
  left: 0;
  top: 21px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--brand-ink);
}
.article-rules li strong { color: var(--ink); font-weight: 600; }
@media (max-width: 600px) {
  .article-rules li { padding-left: 40px; font-size: 16.5px; }
}

/* ── Flag: a status badge above a paragraph (e.g. "In production testing") ── */
.article-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: clamp(28px, 3vw, 40px) 0 0;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article-flag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(45, 202, 61, .55);
  animation: article-flag-pulse 1.8s ease-out infinite;
}
@keyframes article-flag-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45, 202, 61, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(45, 202, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 202, 61, 0); }
}
@media (prefers-reduced-motion: reduce) { .article-flag-dot { animation: none; } }
.article-body p.has-flag { margin-top: 10px; }
