/* =====================================================================
   Stats — figure cards. Markup: Widgets/Stats_Cards.php; count-up: js/stats.js.
   Every Style control writes a custom property on .sz-stats; the defaults
   below are the design (desktop; the phone sizes are responsive defaults).
   ===================================================================== */

.sz-stats{
  --szs-gap:10px; --szs-radius:22px; --szs-pad:16px; --szs-tile:28px; --szs-num:44px; --szs-max:100%;
  --szs-bg:var(--sz-card); --szs-ink:var(--sz-ink); --szs-accent:var(--sz-orange); --szs-label:var(--sz-t2); --szs-detail:var(--sz-t3);
  --szs-hi-bg:radial-gradient(120% 120% at 100% 0%,#22395A 0%,var(--sz-navy) 65%); --szs-hi-ink:#fff; --szs-hi-label:#AEB8C4; --szs-hi-detail:#7F8C9B; --szs-hi-glow:rgba(255,138,85,.22);
}
.sz-stats__grid{display:grid;grid-template-columns:repeat(var(--szs-cols,var(--szs-n,3)),minmax(0,1fr));gap:var(--szs-gap);width:100%;max-width:var(--szs-max)}

/* a card; container, so the number can follow its width */
.sz-stats .sz-stat{position:relative;container-type:inline-size;display:flex;flex-direction:column;min-width:0;padding:var(--szs-pad) var(--szs-pad) calc(var(--szs-pad) - 1px);border-radius:var(--szs-radius);
  background:var(--szs-bg);box-shadow:var(--sz-s1),inset 0 0 0 1px rgba(13,27,42,.04);overflow:hidden;isolation:isolate;color:var(--szs-ink);text-decoration:none;
  transition:transform .4s var(--sz-spring),box-shadow .35s}
.sz-stat__tile{width:var(--szs-tile);height:var(--szs-tile);border-radius:29%;font-size:calc(var(--szs-tile) * .5);transition:transform .45s var(--sz-spring)}

/* the number: as large as the design asks, smaller when the card is narrow (37% of its width: 44px exactly at the design's 118px) */
.sz-stat__num{display:flex;align-items:flex-start;margin-top:22px;font-size:min(var(--szs-num),37cqw);font-weight:600;line-height:.95;letter-spacing:-.05em;white-space:nowrap;font-variant-numeric:tabular-nums}
.sz-stat__tile + .sz-stat__num{margin-top:calc(var(--szs-pad) + 6px)}
.sz-stat__num > *{flex:none}
.sz-stat__d{display:inline-block;text-align:left}
.sz-stat__pre{margin-right:.04em}
/* the plus is drawn: stems as heavy as the digits', its top on their cap height (0.092em below the line top: measured with Inter at this line height) */
.sz-stat__plus{display:block;width:.34em;height:.34em;margin:.092em 0 0 .06em;font-style:normal;color:var(--szs-accent);transform-origin:30% 70%}
.sz-stat__plus svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round}
/* any other suffix (%, k, ×): text, on the cap height too, a step smaller */
.sz-stat__suf{margin:.06em 0 0 .05em;font-size:.56em;font-style:normal;font-weight:600;line-height:1;letter-spacing:-.02em;color:var(--szs-accent);transform-origin:30% 70%}
.sz-stat__plus.is-pop,.sz-stat__suf.is-pop{animation:szs-pop .5s var(--sz-spring)}
@keyframes szs-pop{0%{transform:scale(.3);opacity:0}100%{transform:none;opacity:1}}

.sz-stat__label{display:block;margin-top:8px;font-size:13px;font-weight:500;line-height:1.3;color:var(--szs-label);text-wrap:balance}
.sz-stat__detail{display:block;margin-top:3px;font-size:11.5px;font-weight:500;line-height:1.3;color:var(--szs-detail)}
@container (max-width:150px){.sz-stat__label{font-size:12px}.sz-stat__detail{font-size:11px}}
.sz-stat__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* the highlighted card, and the light that follows the pointer over it */
.sz-stats .sz-stat.is-hi{background:var(--szs-hi-bg);box-shadow:var(--sz-s2);color:var(--szs-hi-ink)}
.sz-stat.is-hi .sz-stat__label{color:var(--szs-hi-label)}
.sz-stat.is-hi .sz-stat__detail{color:var(--szs-hi-detail)}
.sz-stat.is-hi::before{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(180px circle at var(--mx,70%) var(--my,0%),var(--szs-hi-glow),transparent 60%);opacity:0;transition:opacity .4s;pointer-events:none}

/* a card with a link: ↗ on hover */
.sz-stat.is-link::after{content:"";position:absolute;right:14px;top:16px;width:14px;height:14px;background:currentColor;opacity:0;transform:translate(-3px,3px);transition:opacity .25s,transform .35s var(--sz-spring);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
  color:var(--szs-detail)}
.sz-stat.is-hi.is-link::after{color:var(--szs-hi-label)}
.sz-stats .sz-stat.is-link:focus-visible{outline:2.5px solid rgba(255,107,44,.85);outline-offset:3px}
.sz-stats .sz-stat.is-link:active{transform:scale(.98)}

@media (hover:hover){
  .sz-stats .sz-stat:hover{transform:translateY(-2px);box-shadow:var(--sz-s2)}
  .sz-stat:hover .sz-stat__tile{transform:rotate(-8deg) scale(1.06)}
  .sz-stat.is-hi:hover::before{opacity:1}
  .sz-stat.is-link:hover::after{opacity:1;transform:none}
}

@media (prefers-reduced-motion:reduce){
  .sz-stats .sz-stat,.sz-stat__tile,.sz-stat::before,.sz-stat::after{transition:none}
  .sz-stat__plus.is-pop,.sz-stat__suf.is-pop{animation:none}
}
