/* Foundable: components used inside insight articles.
   Loaded on pages with "css: article". Builds on the tokens and classes in
   site.css (.report, .table-wrap, .status--*, .steps, .stats). */

/* ---- Figures and screenshots -------------------------------------------- */

.figure { margin: 2.75rem 0; }
.figure figcaption { margin-top: 0.9rem; font-family: var(--sans); font-size: 0.88rem; line-height: 1.5; color: var(--slate); }
.shot { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--r-card); }

/* ---- Do and don't -------------------------------------------------------- */

.do-dont { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 2rem 0 2.5rem; }
@media (min-width: 40rem) { .do-dont { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.do-dont__col { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem 1.25rem 1.4rem; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--paper); }
.do-dont__col--dont { border-top-color: var(--differs); }
.do-dont__label { display: flex; align-items: center; gap: 0.5em; margin: 0; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; line-height: 1.3; color: var(--green); }
.do-dont__col--dont .do-dont__label { color: var(--differs); }
.do-dont__label::before { content: "\2713"; flex: none; display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; font-size: 0.85em; color: var(--paper); background: var(--green); }
.do-dont__col--dont .do-dont__label::before { content: "\2715"; background: var(--differs); }
.do-dont__sample { margin: 0; font-family: var(--sans); font-size: 1.08rem; line-height: 1.5; padding: 0.75rem 0.9rem; background: var(--wash); }
.prose pre.do-dont__sample { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.82rem; border: 0; margin: 0; padding: 0.75rem 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.do-dont__why { margin: 0; font-family: var(--sans); font-size: 0.95rem; line-height: 1.5; color: var(--slate); }

/* ---- Example data figures (builds on .report in site.css) ---------------- */

.figure .report { max-width: none; }
.report__bar .flag { color: var(--old); }
.report .report__label { font-family: var(--mono); font-size: 0.78rem; color: var(--slate); margin-bottom: 1rem; }
.report .report__read { margin: 0; padding: 1rem 1.5rem 1.15rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.98rem; line-height: 1.5; }
.report__read strong { display: block; margin-bottom: 0.2rem; font-family: var(--mono); font-size: 0.75rem; font-weight: 400;  color: var(--slate); }
.report > .table-wrap { margin: 0 1.5rem 1rem; border-top: 0; }
@media (max-width: 30rem) {
  .report > .table-wrap { margin-inline: 1rem; }
  .report .report__read { padding-inline: 1rem; }
  .report__bar { padding-inline: 1rem; }
}

/* Side-by-side tables in one figure */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 40rem) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair .table-wrap { margin: 0; }

/* ---- Data tables --------------------------------------------------------- */

.data th small { display: block; margin-top: 0.2rem; font-size: 0.75rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--slate); }
.data .group th { padding: 1.1rem 0 0.4rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 400;  color: var(--slate); border-bottom-color: var(--rule-strong); }
.data td, .data thead th:not(:first-child) { white-space: nowrap; }
.data tbody th { font-weight: 400; min-width: 11rem; }
.data .best { font-weight: 600; color: var(--green); }
.data .best::after { content: " \2713"; font-size: 0.85em; }
.data .status { font-size: 0.74rem; }
.data .match > * { background: var(--tint); }
.data .match > :first-child { box-shadow: inset 3px 0 0 var(--green); padding-left: 0.6rem; }
.data .match > :last-child, .data th.num, .data td.num { padding-right: 0.6rem; }

/* ---- Bars (width set by data-w, in steps of 5, so no inline styles) ------ */

.bar { display: block; height: 4px; margin-top: 0.4rem; background: var(--rule-strong); width: 0; }
.match .bar { background: var(--green); }
.bar[data-w="5"] { width: 5%; } .bar[data-w="10"] { width: 10%; } .bar[data-w="15"] { width: 15%; } .bar[data-w="20"] { width: 20%; }
.bar[data-w="25"] { width: 25%; } .bar[data-w="30"] { width: 30%; } .bar[data-w="35"] { width: 35%; } .bar[data-w="40"] { width: 40%; }
.bar[data-w="45"] { width: 45%; } .bar[data-w="50"] { width: 50%; } .bar[data-w="55"] { width: 55%; } .bar[data-w="60"] { width: 60%; }
.bar[data-w="65"] { width: 65%; } .bar[data-w="70"] { width: 70%; } .bar[data-w="75"] { width: 75%; } .bar[data-w="80"] { width: 80%; }
.bar[data-w="85"] { width: 85%; } .bar[data-w="90"] { width: 90%; } .bar[data-w="95"] { width: 95%; } .bar[data-w="100"] { width: 100%; }

/* ---- Figures as numbers (the Wikipedia scan) ----------------------------- */

.prose .stats { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.prose .stat { padding-right: 1.25rem; }
.prose .stat__n { font-size: clamp(2.2rem, 4vw, 2.8rem); }

/* ---- Short numbered checklists ------------------------------------------- */

.prose .steps { margin: 1.5rem 0 2rem; }
.steps.steps--short > li { grid-template-columns: 2.75rem minmax(0, 1fr); padding: 0.9rem 0; font-family: var(--sans); font-size: 1.02rem; }
.steps--short > li::before { padding-top: 0.15rem; }

/* ---- Code ---------------------------------------------------------------- */

.prose pre.code-block { margin: 1.5rem 0 2rem; }

/* ---- Small print --------------------------------------------------------- */

.checked { font-family: var(--mono); font-size: 0.8rem; color: var(--slate); }
.report .stat p { font-family: var(--sans); font-size: 0.98rem; }
.data td:first-child { white-space: normal; }
