/* Article figures (views/Article.astro): charts and diagrams drawn in HTML/CSS from numbers in the language file.
   zafgo.css tokens only; logical properties so every figure mirrors in right-to-left languages. */
.afig { margin: var(--s-2) 0 0; padding: var(--s-3); background: var(--surface); border: 1px solid var(--rail); border-radius: var(--r-2); display: grid; gap: var(--s-2); }
.afig figcaption { display: grid; gap: 4px; font: 600 15px/1.4 var(--f-display); color: var(--ink); border-block-start: 1px solid var(--rail); padding-block-start: 12px; }
.afig figcaption small { font: 400 13px/1.45 var(--f-body); color: var(--slate); }
.afig ul, .afig ol { list-style: none; margin: 0; padding: 0; }

/* bars: one row per item, value at the end */
.afig__bars { display: grid; gap: 14px; }
.afig__bars li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.afig__lbl { font: 600 14px/1.3 var(--f-body); color: var(--ink); display: grid; gap: 2px; }
.afig__lbl small { font-weight: 400; font-size: 12px; color: var(--slate); }
.afig__track { height: 22px; background: var(--skel); border-radius: 4px; overflow: hidden; }
.afig__bar { display: block; height: 100%; width: var(--w); background: var(--signal); border-radius: 4px; }
.afig__bars li.is-hl .afig__bar { background: var(--action); }
.afig__bars li.is-hl .afig__lbl { color: var(--action); }
.afig__val { font: 600 15px/1 var(--f-mono); color: var(--ink); white-space: nowrap; min-width: 5.5rem; text-align: end; }
@media (max-width: 560px) {
  .afig__bars li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .afig__track { grid-column: 1 / -1; grid-row: 2; }
}

/* steps: numbered route, vertical on phones, a grid of stops on wide screens */
.afig__steps { display: grid; gap: 12px; counter-reset: none; }
.afig__steps li { position: relative; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 2px; align-items: start; }
.afig__steps li > strong { font: 600 16px/1.35 var(--f-display); color: var(--ink); grid-column: 2; }
.afig__steps li > span:not(.afig__n) { grid-column: 2; font-size: 14px; color: var(--slate); line-height: 1.5; }
.afig__n { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--action); color: var(--on-action); font: 700 15px/1 var(--f-mono); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--rail); }
.afig__steps li:last-child .afig__n { background: var(--live); color: var(--on-live); }
.afig__steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 17px; top: 40px; bottom: -10px; border-inline-start: 2px dashed var(--rail); }
@media (min-width: 900px) {
  .afig__steps { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
  .afig__steps li { grid-template-columns: 1fr; }
  .afig__steps li > strong, .afig__steps li > span:not(.afig__n) { grid-column: 1; }
  .afig__n { grid-row: auto; margin-block-end: 8px; }
  .afig__steps li:not(:last-child)::after { inset-inline-start: 44px; inset-inline-end: -12px; top: 17px; bottom: auto; border-inline-start: 0; border-block-start: 2px dashed var(--rail); }
}

/* stack: layers of a platform, top to bottom */
.afig__stack { display: grid; gap: 8px; }
.afig__layer { border-radius: var(--r-2); padding: 12px 14px; display: grid; gap: 8px; background: var(--info-tint); border-inline-start: 6px solid var(--action); }
.afig__layer:nth-child(2) { background: var(--warn-tint); border-inline-start-color: var(--live); }
.afig__layer:nth-child(3) { background: var(--ok-tint); border-inline-start-color: var(--line-courier); }
.afig__layer:nth-child(n+4) { background: var(--paper); border-inline-start-color: var(--ink); }
.afig__layer strong { font: 600 15px/1.3 var(--f-display); color: var(--ink); }
.afig__layer ul { display: flex; flex-wrap: wrap; gap: 6px; }
.afig__layer li { font-size: 13px; line-height: 1.3; padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--rail); }

/* split: two or three columns of points */
.afig__split { display: grid; gap: 12px; }
@media (min-width: 700px) { .afig__split { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
.afig__col { border-radius: var(--r-2); padding: 14px; border: 2px solid var(--rail); display: grid; gap: 10px; align-content: start; }
.afig__col strong { font: 600 16px/1.3 var(--f-display); color: var(--ink); }
.afig__col li { position: relative; padding-inline-start: 22px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.afig__col li + li { margin-block-start: 6px; }
.afig__col li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); }
.afig__col--good { border-color: var(--action); }
.afig__col--good li::before { background: var(--action); }
.afig__col--bad li::before { background: var(--err); }

/* comparison tables: highlighted row, FAQ */
.cmp tr.is-hl th, .cmp tr.is-hl td { background: var(--info-tint); }
.afaq { border-block-start: 2px solid var(--ink); }
.afaq details { border-block-end: 1px solid var(--rail); }
.afaq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; padding-block: 12px; cursor: pointer; list-style: none; font: 600 17px/1.4 var(--f-display); color: var(--ink); }
.afaq summary::-webkit-details-marker { display: none; }
.afaq summary:hover { color: var(--action); }
.afaq summary .icon { flex: none; color: var(--action); transition: transform var(--dur-base, .2s) ease; }
.afaq details[open] summary .icon { transform: rotate(45deg); color: var(--live); }
.afaq details p { margin: 0 0 20px; color: var(--slate); max-width: 68ch; }
@media (prefers-reduced-motion: reduce) { .afaq summary .icon { transition: none; } }
@media print { .afig { break-inside: avoid; } }
.cmp th.is-hc, .cmp td.is-hc { background: var(--info-tint); }
.cmp thead th.is-hc { color: var(--action); }
.cmp--wrap thead th { white-space: normal; }
