/* ==========================================================================
   AFRINIC-38 meeting statistics page (statistics.html, fr/statistics.html).

   Loaded after styles.min.css and built only from its tokens. Colour roles
   follow the site: orange for titles and the headline numbers, blue for
   structure. In the charts blue is online, orange is onsite, yellow marks
   the few people who attended both ways, green is the third series.

   The pages are generated by publish-af38.js in the meeting-reports project.
   The charts are SVG sized by attributes and classes, because the site's
   Content-Security-Policy does not allow inline styles.
   ========================================================================== */

.st-first { padding-top: clamp(2rem, 4.5vw, 3.25rem); }
.st-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 1.5rem; }

/* Panels: white, ruled in the structural blue tint. */
.st-card { border: 1px solid var(--hair); border-radius: var(--radius); padding: clamp(1.25rem, 2.4vw, 1.9rem); background: var(--white); min-width: 0; }
.st-card h3 { font-size: 1.15rem; }
.st-desc { font-size: .9rem; color: var(--muted); margin: .3rem 0 1.4rem; hyphens: manual; -webkit-hyphens: manual; }
.st-foot { font-size: .85rem; line-height: 1.5; color: var(--muted); margin: 1.25rem 0 0; max-width: 75ch; }
.st-sub { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin: 1.4rem 0 .7rem; }
.st-desc + .st-sub { margin-top: 0; }

.st-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.st-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.st-grid-wide { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

/* Headline numbers */
.st-kpi h3 { font-size: 1rem; }
.st-num { font-family: var(--font-title); font-weight: 700; font-size: clamp(2.4rem, 4vw, 3.25rem); line-height: 1; color: var(--orange); margin: .6rem 0 1.1rem; font-variant-numeric: tabular-nums; }
.st-key { font-size: .88rem; color: var(--muted); margin: .7rem 0 0; hyphens: manual; -webkit-hyphens: manual; }

/* Series colours: the same class paints an SVG shape and a legend swatch. */
.st-online { fill: var(--blue); background: var(--blue); }
.st-onsite { fill: var(--orange); background: var(--orange); }
.st-both { fill: var(--yellow); background: var(--yellow); }
.st-green { fill: var(--green); background: var(--green); }
.st-online-soft { fill: rgba(0, 20, 137, .3); background: rgba(0, 20, 137, .3); }
.st-onsite-soft { fill: rgba(209, 94, 20, .38); background: rgba(209, 94, 20, .38); }
.st-neutral { fill: rgba(0, 20, 137, .16); background: rgba(0, 20, 137, .16); }
.st-sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; flex: none; }

/* Bars */
.st-bar { display: block; height: 10px; border-radius: var(--pill); overflow: hidden; background: rgba(0, 20, 137, .06); min-width: 0; }
.st-bar svg { width: 100%; height: 100%; }
.st-bar-lg { height: 18px; background: none; }

.st-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .8rem; font-size: .9rem; }
.st-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.st-legend b { font-variant-numeric: tabular-nums; }
.st-legend small { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.st-legend-inline { margin: 0 0 1rem; }
.st-legend-rows { display: block; margin-top: 1rem; }
.st-legend-rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 3.4rem; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--hair); }
.st-legend-rows li:first-child { border-top: 0; }
.st-legend-rows small { text-align: right; }

.st-rows { display: grid; gap: .6rem; }
.st-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 5.2rem; gap: .9rem; align-items: center; font-size: .95rem; }
.st-rows-short .st-row { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) 5.2rem; }
.st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-cc { display: inline-block; min-width: 1.9rem; margin-right: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--blue); }
.st-val { display: flex; justify-content: flex-end; align-items: baseline; gap: .45rem; font-variant-numeric: tabular-nums; }
.st-val small { color: var(--muted); font-size: .82rem; min-width: 2.4rem; text-align: right; }

/* Gauge and dot grid in the headline cards */
.st-gauge { display: flex; align-items: center; gap: .9rem; font-size: .88rem; color: var(--muted); }
.st-gauge svg { width: 7rem; flex: none; }
.st-gauge path { fill: none; stroke-width: 11; stroke-linecap: round; }
.st-gauge-track { stroke: rgba(0, 20, 137, .12); }
.st-gauge-fill { stroke: var(--blue); }
.st-gauge text { font-family: var(--font-display); font-weight: 700; font-size: 17px; fill: var(--ink); }
.st-dots { width: 100%; height: auto; }
.st-dots circle { fill: rgba(209, 94, 20, .18); }
.st-dots circle.on { fill: var(--orange); }

/* Audience over time. The plot stretches with the card; labels stay HTML so they keep their size. */
.st-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: .5rem 1rem 0 0; }
.st-yaxis { display: flex; flex-direction: column-reverse; justify-content: space-between; padding-right: .7rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-yaxis span { height: 0; display: flex; align-items: center; justify-content: flex-end; }
.st-plot { height: 240px; }
.st-plot svg { width: 100%; height: 100%; overflow: visible; }
.st-plot line, .st-plot path { vector-effect: non-scaling-stroke; }
.st-gridline { stroke: var(--hair); stroke-width: 1; }
.st-area { fill: var(--blue); fill-opacity: .1; }
.st-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.st-peak { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 5 4; }
.st-xaxis { grid-column: 2; display: flex; justify-content: space-between; margin-top: 1rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-xaxis span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.st-callout { display: flex; align-items: center; gap: .5rem; margin: 1.5rem 0 0; font-weight: 700; hyphens: manual; -webkit-hyphens: manual; }

/* Time spent online */
.st-hist { height: 180px; border-bottom: 1px solid var(--hair); }
.st-hist svg { width: 100%; height: 100%; }
.st-hist-labels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: .6rem; text-align: center; }
.st-hist-labels li { display: grid; gap: .1rem; padding-inline: .15rem; }
.st-hist-labels b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.st-hist-labels span { font-size: .76rem; line-height: 1.25; color: var(--muted); }

.st-note { border-top: 1px solid var(--hair); padding-top: 2rem; max-width: 75ch; }
.st-note h2 { font-size: 1.3rem; margin-bottom: .8rem; }
.st-note p { font-size: .95rem; color: var(--muted); }

@media (max-width: 1024px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .st-grid-2, .st-grid-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .st-kpis { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .st-row { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 4.6rem; gap: .6rem; font-size: .9rem; }
  .st-rows-short .st-row { grid-template-columns: minmax(0, 5.5rem) minmax(0, 1fr) 4.6rem; }
  .st-name { white-space: normal; line-height: 1.25; }
  .st-plot { height: 190px; }
  .st-xaxis span:nth-child(even) { visibility: hidden; }
  .st-hist { height: 150px; }
  .st-gauge svg { width: 6rem; }
}
@media print {
  .st-card { break-inside: avoid; }
  .st-card, .st-bar, .st-sw, .st-plot, .st-hist, .st-dots { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
