/* ==========================================================================
   HOMAVERSE — one look for every number on the site
   Loaded last (after each page's own stylesheet) so it is the single source of truth.
   The reference is the home page "About HOMAVERSE" strip: a small label on top, the figure underneath
   in the body face (Inter / Vazirmatn), heavy, gold, with tabular digits, thin dividers between columns
   ========================================================================== */

/* ---------- 0. lining figures everywhere ----------
   Cormorant (the display face) draws old-style digits by default, so a "4" or "9" inside a title dips below the line
   ("online course (4 sessions)"). The font ships lining figures (lnum): switch them on for the whole page.
   Inter and Vazirmatn already draw lining digits, so body text does not change */
html{font-variant-numeric:lining-nums}

/* ---------- tokens ---------- */
:root{
  --num-weight:900;
  --num-size:clamp(28px,4vw,42px);
  --num-size-sm:clamp(19px,2.2vw,24px);
  --num-label:13px;
}

/* ---------- 1. counter strips ----------
   .stats         home · About HOMAVERSE
   .ab-numbers dl about
   .nx-stats      NFT index hero
   .au-stats      auctions index
   .ax-counters   artists index hero
   .px-stats      collections + exhibitions (.ex-nums)
   .ar-stats      artist page
   .cs-stats      collection page hero */
:is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats){font-variant-numeric:tabular-nums lining-nums}
/* every figure cell: label on top, figure underneath, centred */
:is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats)>div{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;min-width:0;text-align:center}

/* the strips that were not built as a divided row yet (artists hero, collection hero, artist page) take the
   same row as the home page: equal columns, thin dividers, a rule above and below.
   (home, about, NFT, auctions, collections and exhibitions already have that row, with their own responsive
   column counts, so only their figures and labels are restyled) */
:is(.ax-counters,.cs-stats,.ar-stats){
  --n-line:rgba(201,160,90,.28);
  display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none;
  gap:0;padding:0;border-block:1px solid var(--n-line)}
.ar-stats{--n-line:var(--line)}
:is(.ax-counters,.cs-stats,.ar-stats)>div{margin:0;padding:18px 10px;border:0;border-radius:0;background:none;box-shadow:none}
:is(.ax-counters,.cs-stats,.ar-stats)>div+div{border-inline-start:1px solid var(--n-line)}

/* label on top */
:is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats)>div>dt{
  order:0;margin:0;font-family:var(--font);font-size:var(--num-label);font-weight:400;line-height:1.35;
  letter-spacing:0;text-transform:none;
}
/* figure underneath, all figures of a row on one baseline even when a label wraps */
:is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats)>div>dd{
  order:1;margin:auto 0 0;font-family:var(--font);font-weight:var(--num-weight);font-size:var(--num-size);
  line-height:1.2;letter-spacing:0;font-style:normal;
  font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;
}
.lang-fa :is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats)>div>dd,
.lang-ar :is(.stats,.ab-numbers dl,.nx-stats,.au-stats,.ax-counters,.px-stats,.ar-stats,.cs-stats)>div>dd{
  font-family:var(--font);font-weight:var(--num-weight);font-size:var(--num-size);
}

/* label colours: muted on light surfaces, soft cream on the dark heroes */
:is(.px-stats,.au-stats,.ar-stats)>div>dt{color:var(--muted)}
:is(.ab-numbers dl,.cs-stats)>div>dt{color:#CDBFA8}
.ax-counters>div>dt{color:var(--ax-soft,#B8AA94)}
.nx-stats>div>dt{display:grid;gap:2px;color:#E3D6BF}
.nx-stats>div>dt small{font-size:11px;font-weight:400;line-height:1.35;color:#B9AB94}

/* figure colours (gold, readable on each surface) */
:is(.px-stats,.au-stats,.ar-stats)>div>dd{color:var(--gold-d)}
[data-theme=light] :is(.px-stats,.au-stats,.ar-stats)>div>dd{color:#7A5518}
:is(.ab-numbers dl,.cs-stats,.nx-stats,.ax-counters)>div>dd{color:#E6C886}

/* strips that sit inside a hero text column stay at a readable width */
.ax-counters,.cs-stats{max-width:620px;margin-top:clamp(24px,4vw,40px)}
.nx-stats{max-width:560px}
/* strips that sit on a page background become a soft panel with the same inner layout */
.ar-stats{padding:0 6px;border:1px solid var(--line);border-radius:20px;background:var(--paper);box-shadow:0 20px 40px -28px rgba(22,18,14,.55)}
.ar-stats>div[data-reveal]{transition-delay:0s}

/* ---------- phones: four or more figures fold into two neat columns ---------- */
@media (max-width:560px){
  :is(.ax-counters,.cs-stats,.ar-stats)>div{padding:14px 6px}
  :is(.ax-counters,.cs-stats,.ar-stats):has(>div:nth-child(4)){grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr))}
  :is(.ax-counters,.cs-stats,.ar-stats):has(>div:nth-child(4))>div:nth-child(odd){border-inline-start:0}
  :is(.ax-counters,.cs-stats,.ar-stats):has(>div:nth-child(4))>div:nth-child(n+3){border-top:1px solid var(--n-line)}
  :is(.ax-counters,.cs-stats,.ar-stats):has(>div:nth-child(4))>div:last-child:nth-child(odd){grid-column:1/-1}
}
/* about: an odd last figure on the two-column phone layout takes the full row */
@media (max-width:520px){.ab-numbers dl>div:last-child:nth-child(odd){grid-column:1/-1;border-inline-start:0}}
@media (max-width:360px){
  :root{--num-size:26px;--num-label:12px}
}

/* ---------- 2. compact figures inside panels and tiles: same face, same weight, same gold ----------
   .bid-stats    auction / NFT buying panel
   .au-spot-facts auction spotlight
   .ed-stats     edition box on an artwork page
   .salon-stats  collector dashboard tiles
   .kpi          account summary */
:is(.bid-stats,.ed-stats)>div{display:flex;flex-direction:column;gap:4px}
:is(.bid-stats,.ed-stats)>div>dt{order:0;font-size:12px;font-weight:400;letter-spacing:0;text-transform:none}
:is(.bid-stats,.ed-stats)>div>dd,.au-panel .bid-stats>div>dd,.page-artwork .ed-stats>div>dd{order:1;margin:auto 0 0;font-family:var(--font);font-weight:var(--num-weight);font-size:var(--num-size-sm);line-height:1.2;
  font-variant-numeric:tabular-nums lining-nums;color:var(--gold-d)}
[data-theme=light] :is(.bid-stats,.ed-stats)>div>dd{color:#7A5518}
/* the leading figure of a buying panel (current bid / price) is a full-size figure */
.au-panel .bid-stats>div:first-child>dd,
.lang-fa .au-panel .bid-stats>div:first-child>dd,.lang-ar .au-panel .bid-stats>div:first-child>dd{font-family:var(--font);font-weight:var(--num-weight);font-size:clamp(22px,2.6vw,28px);line-height:1.15}
/* status words keep their meaning colours */
.bid-stats dd.is-ok,.au-panel .bid-stats .is-ok{color:var(--au-ok,var(--ok,#2E7D4F))}
.bid-stats dd.is-warn,.au-panel .bid-stats .is-warn{color:var(--au-warn,#9A5B00)}
.bid-stats dd[data-a-reserve]{font-size:14px;font-weight:800;line-height:1.35;white-space:normal}

.au-spot-facts small{order:0;font-size:12.5px;letter-spacing:0;text-transform:none}
.au-spot-facts b{font-family:var(--font);font-weight:var(--num-weight);font-variant-numeric:tabular-nums lining-nums}
.au-spot-facts .au-big,.lang-fa .au-spot-facts .au-big,.lang-ar .au-spot-facts .au-big{font-family:var(--font);font-weight:var(--num-weight);font-size:var(--num-size);line-height:1.15;color:#E6C886}

.salon-stats .st b,.st-tier-in b,.kpi b{font-family:var(--font);font-weight:var(--num-weight);font-variant-numeric:tabular-nums lining-nums;color:var(--gold-d)}
[data-theme=light] :is(.salon-stats .st b,.st-tier-in b,.kpi b){color:#7A5518}
.kpi{align-content:start}
.kpi span{order:0}.kpi b{order:1;font-size:var(--num-size-sm);line-height:1.2}

/* ---------- 3. digits never jump while they count up ---------- */
[data-count]{font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1}

/* ---------- 4. figures that were set in the display face (Cormorant draws old-style digits that dip below the line):
   step numbers, years, dates, countdown units, prices and counters use the same heavy, lining body face ---------- */
:is(.step-n,.au-step-n,.hx-step-n,.ab-step-n,.cl-no,.vg-room-n,.ex-year,.ex-hl-year,.xt-ytitle span,.ab-year,.pr-year-label,
  .date-chip b,.clock,.price-xl,.au-unit b,.ev-cd-u b,.ev-price,.ev-pdate b,.ev-cal-item time,.hs-date b,.gx-amount,.au-next b),
.page-home .ex-year,.ar-ex-list .ex-year,
.lang-fa :is(.page-home .ex-year,.ar-ex-list .ex-year,.step-n,.ex-hl-year,.xt-ytitle span),
.lang-ar :is(.page-home .ex-year,.ar-ex-list .ex-year,.step-n,.ex-hl-year,.xt-ytitle span){
  font-family:var(--font);font-weight:var(--num-weight);font-style:normal;letter-spacing:0;
  font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1}
/* the body face is wider than Cormorant: the large ones come down a step so they keep their place */
.step-n{font-size:28px}
.au-step-n{font-size:34px}
.ex-hl-year{font-size:38px}
.xt-ytitle span{font-size:clamp(34px,4.6vw,52px)}
.page-home .ex-year,.ar-ex-list .ex-year{font-size:20px}
.ab-year,.pr-year-label{font-size:26px}
.hs-date b,.lang-fa .hs-date b,.lang-ar .hs-date b{font-family:var(--font);font-weight:var(--num-weight);font-size:clamp(92px,10vw,140px);line-height:1}


/* ---------- 5. auctions ---------- */
/* spotlight (auctions index): every fact sits on one baseline, the secondary figures share one size and colour */
.au-spot-facts{align-items:flex-end;align-items:last baseline}
.au-spot-facts>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.au-spot-facts b{font-size:var(--num-size-sm);line-height:1.15;color:#E6C886}
.au-spot-facts b.is-ok,.au-spot-facts b.is-warn{font-family:var(--font);font-size:16px;font-weight:800;line-height:1.3}
.au-spot-facts .is-ok{color:#8FD3A8}.au-spot-facts .is-warn{color:#F0C27A}
/* buying panel: the current bid gets the whole first row so a long amount never breaks inside the number;
   bids and reserve share the row below */
.au-panel .bid-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
.au-panel .bid-stats>div:first-child{grid-column:1/-1;border-inline-start:0!important;border-bottom:1px solid var(--line)}
.au-panel .bid-stats>div:nth-child(2){border-inline-start:0!important}
.au-panel .bid-stats>div>dd{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.au-panel .bid-stats>div:first-child>dd,
.lang-fa .au-panel .bid-stats>div:first-child>dd,.lang-ar .au-panel .bid-stats>div:first-child>dd{font-size:clamp(28px,3.2vw,36px);overflow:hidden;text-overflow:ellipsis;max-width:100%}
.au-panel .bid-stats dd[data-a-reserve]{white-space:normal}
.au-next b,.lang-fa .au-next b,.lang-ar .au-next b{font-size:22px;line-height:1.15;color:var(--gold-d);white-space:nowrap}
[data-theme=light] .au-next b{color:#7A5518}
