/* sec-data.css: what Cavalry tracks (sec_data_facts.py). Namespace sd-.
 *
 * Two places wear it:
 *   /sec-data          templates/sec_data.html, a public page (home.css .public-main, world.css tokens)
 *   the front page     the band between the benchmark and the team (templates/_world.html, .sd-band)
 * Loaded after world.css in both. Tokens only (tests/test_palette_tokens.py); no boxes, no stripes: the
 * figures stand on the page ground and hairlines are the stone ones the footer and the tables use.
 *
 * THE FIGURE (.sd-n) is words, not a bare number ("1.4 million+"), so it is sized from the width of the
 * grid that holds it (container units), never from the window: the longest figure we print fits its column
 * at every width, and it is never cut or wrapped. A px size comes first for a browser without the units.
 */

.sd-n{
  display:block;
  font-family:var(--font-display); font-weight:300;
  line-height:1; letter-spacing:-0.04em;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  color:var(--text-primary);
}
.sd-c{ display:block; color:var(--cv-ink-2); text-wrap:balance; }

/* ── The front page's band ────────────────────────────────────────────────
   The team section's own grid (world.css .hw-team: 5fr / 7fr, the same column gap) and, inside the right
   column, the portraits' own two columns and gap, so the heading sits on the "Team" heading's left edge and
   each figure on a portrait's left edge. The team's top pad is the gap below, so the band has none. */
.sd-band.cv-sec{ padding-bottom:0; }
.sd-band .cv-wrap{
  display:grid; grid-template-columns:minmax(0, 5fr) minmax(0, 7fr);
  column-gap:clamp(24px, 4vw, 96px); align-items:start;
}
.sd-band .cv-sec-head{ margin:0; }
.sd-more{
  display:inline-flex; align-items:center; min-height:44px;
  margin-top:clamp(12px, 1.2vw, 28px);
  font-size:var(--cv-t-body); font-weight:500;
  text-decoration:underline; text-underline-offset:0.2em; text-decoration-thickness:1px;
  transition:color var(--dur-fast) ease;
}
.hw a.sd-more{ color:var(--cv-ink-2); }
.hw a.sd-more:hover{ color:var(--text-primary); }
.sd-more:focus-visible{ outline:2px solid var(--text-primary); outline-offset:3px; border-radius:2px; }
.sd-stats{
  list-style:none; margin:0; padding:0;
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:clamp(32px, 3.4vw, 76px) clamp(16px, 1.7vw, 36px);
  container-type:inline-size;
}
html.hw-js .sd-stat.hw-reveal{ transition-delay:calc(var(--i, 0) * 70ms); }
.sd-stat .sd-n{ font-size:30px; font-size:clamp(28px, 7.6cqi, 84px); }
.sd-stat .sd-c{ margin-top:clamp(10px, 0.9vw, 18px); font-size:var(--cv-t-lead); line-height:1.4; }
@media (max-width:1024px){
  .sd-band .cv-wrap{ grid-template-columns:minmax(0, 1fr); }
  .sd-band .cv-sec-head{ margin-bottom:clamp(28px, 4vw, 48px); }
}
@media (max-width:560px){ .sd-stat .sd-n{ font-size:clamp(24px, 8.6cqi, 44px); } }
@media (max-width:420px){ .sd-stats{ column-gap:14px; } }
@media (prefers-reduced-motion:reduce){ html.hw-js .sd-stat.hw-reveal{ transition-delay:0ms; } }

/* ── /sec-data ────────────────────────────────────────────────────────────
   The article takes the whole content column (the guides keep theirs at 42rem); running text keeps a
   readable measure of its own. */
.sec-data .public-main article{ max-width:none; }
.sec-data .public-main h1{ font-size:clamp(1.9rem, 3.1vw, 3rem); font-weight:400; letter-spacing:-0.025em; max-width:20em; }
.sec-data .public-main h2{ font-size:1.35rem; font-weight:500; margin:0 0 .4rem; }
.sec-data .public-main section{ margin-top:clamp(3rem, 5.2vw, 5.5rem); }
.sec-data .public-main .sd-lead{ max-width:40rem; margin:1.1rem 0 0; font-size:1.1rem; line-height:1.6; color:var(--text-secondary); }

/* the tiles: one hairline above each, the figure, its label */
.sec-data .public-main .sd-tiles{
  list-style:none; margin:clamp(2.4rem, 4vw, 4rem) 0 0; padding:0;
  display:grid; grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:clamp(2rem, 3.2vw, 3.6rem) clamp(24px, 3vw, 64px);
  container-type:inline-size;
}
.sec-data .public-main .sd-tiles[data-n="1"]{ grid-template-columns:minmax(0, 1fr); }
.sec-data .public-main .sd-tiles[data-n="2"],
.sec-data .public-main .sd-tiles[data-n="4"]{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.sec-data .public-main .sd-tile{
  margin:0; padding:1.15rem 0 0;
  border-top:1px solid var(--cv-ring);
  font-size:1rem; line-height:1.45;
}
.sd-tile .sd-n{ font-size:44px; font-size:clamp(34px, 5.4cqi, 84px); }
.sd-tiles[data-n="1"] .sd-n,
.sd-tiles[data-n="2"] .sd-n,
.sd-tiles[data-n="4"] .sd-n{ font-size:clamp(34px, 6.6cqi, 84px); }
.sd-tile .sd-c{ margin-top:.75rem; }
.sec-data .public-main .sd-note{ margin:1.6rem 0 0; font-size:.8rem; line-height:1.6; color:var(--text-muted); }

/* the coverage table: three columns, hairlines between rows, nothing else */
.sd-table{ width:100%; margin:1.2rem 0 0; border-collapse:collapse; table-layout:fixed; }
.sd-table th, .sd-table td{
  padding:1.05rem 1.6rem 1.05rem 0;
  border-bottom:1px solid var(--border-subtle);
  text-align:left; vertical-align:top;
  font-size:.9rem; line-height:1.55; font-weight:400;
  color:var(--text-primary);
}
.sd-table th:last-child, .sd-table td:last-child{ padding-right:0; }
.sd-table thead th{
  padding-top:0; padding-bottom:.7rem;
  border-bottom-color:var(--cv-ring);
  font-size:.8rem; font-weight:500; color:var(--text-muted);
}
.sd-table .sd-col-what{ width:46%; }
.sd-table .sd-col-source{ width:30%; }
.sd-what{ display:block; font-size:1rem; font-weight:500; line-height:1.4; }
.sd-plain{ display:block; margin-top:.2rem; max-width:32rem; color:var(--text-secondary); text-wrap:pretty; }
.sd-table a, .sd-facts a{
  color:var(--text-primary);
  text-decoration:underline; text-underline-offset:.18em; text-decoration-thickness:1px;
}
.sd-table a:hover, .sd-facts a:hover{ color:var(--accent); }
.sd-table a:focus-visible, .sd-facts a:focus-visible{ outline:2px solid var(--text-primary); outline-offset:2px; border-radius:2px; }

/* how the data is kept: three plain lines */
.sec-data .public-main .sd-facts{ list-style:none; max-width:46rem; margin:1.2rem 0 0; padding:0; }
.sec-data .public-main .sd-facts li{
  margin:0; padding:.95rem 0;
  border-bottom:1px solid var(--border-subtle);
  font-size:.95rem; line-height:1.6; color:var(--text-primary);
  overflow-wrap:anywhere;
}
.sec-data .public-main .sd-facts li:first-child{ border-top:1px solid var(--cv-ring); }
.sec-data .public-main .public-product{ margin:clamp(2.4rem, 4vw, 4rem) 0 0; }

@media (max-width:900px){
  .sec-data .public-main .sd-tiles,
  .sec-data .public-main .sd-tiles[data-n="4"]{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .sd-tile .sd-n,
  .sd-tiles[data-n="2"] .sd-n,
  .sd-tiles[data-n="4"] .sd-n{ font-size:clamp(28px, 7.6cqi, 72px); }
}
/* Phones: one tile to a row, so the figure can stay large. */
@media (max-width:560px){
  .sec-data .public-main h1{ font-size:1.6rem; }
  .sec-data .public-main .sd-lead{ font-size:1rem; }
  .sec-data .public-main .sd-tiles,
  .sec-data .public-main .sd-tiles[data-n="2"],
  .sec-data .public-main .sd-tiles[data-n="4"]{ grid-template-columns:minmax(0, 1fr); row-gap:1.5rem; }
  .sd-tile .sd-n,
  .sd-tiles[data-n="2"] .sd-n,
  .sd-tiles[data-n="4"] .sd-n{ font-size:clamp(36px, 12.4cqi, 60px); }
}
/* Phones: each coverage row becomes its own block, the two facts under the name with their column's
   words in front, so nothing is squeezed into a 90px column. The header row is kept for assistive tech. */
@media (max-width:760px){
  .sd-table, .sd-table tbody, .sd-table tr, .sd-table th, .sd-table td{ display:block; width:auto; }
  .sd-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .sd-table tbody tr{ padding:1.1rem 0; border-bottom:1px solid var(--border-subtle); }
  .sd-table tbody tr:first-child{ border-top:1px solid var(--cv-ring); }
  .sd-table tbody th, .sd-table tbody td{ padding:0; border:0; }
  .sd-table tbody td{
    display:grid; grid-template-columns:5.8rem minmax(0, 1fr); column-gap:.7rem;
    margin-top:.55rem;
  }
  .sd-table tbody td::before{ content:attr(data-label); font-size:.8rem; line-height:1.75; color:var(--text-muted); }
}
