/* mineral.watch — the editorial layer of the mineral dossiers (tools/editorial.py links it on every one)
 *
 * Loaded right after each page's own <style>, so it wins over the page's rules of equal weight. It sets the
 * dossiers like an edited feature rather than a stack of widgets:
 *   - serif display heads (h1, section h2s, the paywall box), from the reader's own system serifs: no webfont
 *   - each section opens on a hairline rule, and from 1180px its kicker and h2 sit to the left of the lede
 *     (div.sec-head), so a lede no longer runs 640px into a 1050px column with the rest left blank
 *   - the timeline reads as a chronology: date and headline in a left column, the entry beside them
 *   - card and timeline text a step larger, and paired cards no longer stretch into empty boxes
 * Tokens only (--txt, --muted, --line, --accent), so every dossier keeps its colour in both themes. */

:root{--serif:"Iowan Old Style","Charter","Sitka Text","Source Serif Pro","Source Serif 4",Georgia,"Noto Serif",serif}

/* ---------- type ---------- */
.hero h1,section h2,.mw-wall h2{font-family:var(--serif);font-weight:700;letter-spacing:-.012em;text-wrap:balance}
.hero h1{letter-spacing:-.018em;line-height:1.08}
section h2{font-size:clamp(1.6rem,1.15rem + 1.5vw,2.25rem);line-height:1.12;margin-bottom:12px}
h3,h4{text-wrap:balance}
section p,.hero p,.mw-wall p{text-wrap:pretty}
.stat b,.big,.callout b{font-variant-numeric:tabular-nums lining-nums}

/* the hero dek is a standfirst: a short paragraph a step up from body text */
.hero p{font-size:1.09rem;line-height:1.6;max-width:620px}
@media(max-width:599px){.hero p{font-size:1.02rem}}

/* ---------- section heads ---------- */
section>.kicker:first-child,section>.sec-head{border-top:1px solid var(--line);padding-top:16px}
.sec-head{margin-bottom:24px}
.sec-head>h2{margin-bottom:12px}
.sec-head>.lede{margin-bottom:0}
.lede{font-size:1rem;line-height:1.62;color:color-mix(in srgb,var(--txt) 70%,var(--muted))}
@media(min-width:1180px){
  .sec-head{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-rows:auto 1fr;column-gap:clamp(36px,4vw,64px);align-items:start;margin-bottom:28px}
  .sec-head>.kicker{grid-column:1;grid-row:1}
  .sec-head>h2{grid-column:1;grid-row:2;margin-bottom:0}
  .sec-head>.lede{grid-column:2;grid-row:1/span 2;max-width:62ch;padding-top:2px}
}

/* ---------- timeline as a chronology ---------- */
.tl-item h4{font-size:.98rem}
.tl-item p{font-size:.86rem;line-height:1.6}
@media(min-width:860px){
  .tl-item{display:grid;grid-template-columns:minmax(150px,12.5rem) minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:32px;padding-bottom:26px}
  .tl-date{grid-column:1;grid-row:1}
  .tl-item h4{grid-column:1;grid-row:2;margin:4px 0 0;font-family:var(--serif);font-size:1.04rem;line-height:1.3}
  .tl-item p{grid-column:2;grid-row:1/span 2;max-width:72ch}
}

/* ---------- cards ---------- */
.mini p{font-size:.82rem;line-height:1.58}
.jcard p{font-size:.84rem;line-height:1.58}
.card .sub{line-height:1.45}
/* a chart beside a taller card grows into the height instead of leaving the box empty under it;
   a text card beside a taller one keeps its own height */
.grid2>.card{display:flex;flex-direction:column}
.grid2>.card>.chartbox{flex:1 0 auto;min-height:280px}
.grid2>.card:not(:has(>.chartbox)){align-self:start}
/* a card of small cards (trade's "three prices", demand's forces) gets the full width and sets them in one row
   rather than a 2×2 squeezed into half the page; the text card after it, left alone, runs full width in two columns */
@media(min-width:1000px){
  .grid2>.card:has(>.mini-grid:not([style])){grid-column:1/-1}
  .grid2>.card:has(>.mini-grid:not([style]))+.card:last-child{grid-column:1/-1;align-self:stretch}
  .grid2>.card:has(>.mini-grid:not([style]))+.card:last-child>p{columns:2;column-gap:40px}
}
/* the full-width refining bars (China vs the rest, two to four bars) don't need the 280px box */
.card>.chartbox:has(>#chConv,>#chExp){height:190px}
@media(min-width:1180px){
  .grid2>.card>.mini-grid:not([style]){grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
  .mini-grid:has(>.mini:nth-child(6):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
}
