/* Article "Warren Buffett in numbers" (/articles/warren-buffett/), on top of style.css and
   articles.css. Classes start with .wb-. Colors come from the palette's variables only, so the
   four themes work. Every plot keeps its height from the first paint (nothing jumps when the
   charts are drawn). */

/* the snowball */
.wb-plot-snow { min-height: 400px; }
@media (max-width: 640px) { .wb-plot-snow { min-height: 300px; } }
.wb-switches { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 2px; }
.wb-switches .seg { margin-top: 0; }

/* a hundred squares: the decades of his life, light to dark */
/* 20 x 5 squares of at most 46px on a wide screen; 10 x 10 on a phone, as tall as it is wide */
.wb-plot-ages { min-height: 254px; }
@media (max-width: 672px) { .wb-plot-ages { min-height: 0; aspect-ratio: 1 / 1.0124; } }
.wb-g0 { --wb: var(--s6); }
.wb-g1 { --wb: var(--s3); }
.wb-g2 { --wb: var(--s4); }
.wb-g3 { --wb: var(--s2); }
.wb-g4 { --wb: var(--s5); }
.wb-g5 { --wb: var(--s1); }
.wb-sq { fill: var(--wb); transition: opacity .12s; }
.wb-sq.off { opacity: 0.28; }
.sw-sq.wb-g0, .sw-sq.wb-g1, .sw-sq.wb-g2, .sw-sq.wb-g3, .sw-sq.wb-g4, .sw-sq.wb-g5 { background: var(--wb); }
.wb-ages-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 10px; padding: 2px 44px 0 10px; }
.wb-ages-list li { display: inline-flex; gap: 6px; align-items: center; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.wb-ages-list b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }

/* the 13F portfolio */
.wb-plot-pf { min-height: 420px; }
@media (max-width: 640px) { .wb-plot-pf { min-height: 320px; } }
.wb-p0 { --wb: var(--s1); }
.wb-p1 { --wb: var(--s2); }
.wb-p2 { --wb: var(--s3); }
.wb-p3 { --wb: var(--s5); }
.wb-p4 { --wb: var(--s4); }
.wb-p5 { --wb: var(--home); }
.wb-p6 { --wb: var(--cash); }
.wb-p-other { --wb: var(--s6); }
.wb-area { fill: var(--wb); stroke: var(--surface); stroke-width: 0.8; }
.wb-area.wb-p-other { fill-opacity: 0.45; }
.sw-sq.wb-p0, .sw-sq.wb-p1, .sw-sq.wb-p2, .sw-sq.wb-p3, .sw-sq.wb-p4, .sw-sq.wb-p5, .sw-sq.wb-p6, .sw-sq.wb-p-other { background: var(--wb); }
.sw-sq.wb-p-other { opacity: 0.45; }
.wb-grid-over { stroke: var(--surface); opacity: 0.35; }
.wb-plot-pf .cross { stroke: var(--ink); stroke-width: 1; }

/* then and now: a stock bought decades ago */
.wb-pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 8px 0 18px; }
.wb-pairs .card { padding: 18px 20px; margin: 0; }
.wb-pairs .label { margin: 0 0 6px; }
.wb-pairs .mid { margin: 0; }
.wb-pairs .art-sub { margin: 6px 0 0; }
.wb-pairs .wb-then { color: var(--ink-2); font-size: 15.5px; margin: 0 0 4px; }
@media (max-width: 860px) { .wb-pairs { grid-template-columns: minmax(0, 1fr); } }

/* cash, gifts, the bet */
.wb-plot-cash, .wb-plot-gifts { min-height: 320px; }
.wb-plot-bet { min-height: 400px; }
@media (max-width: 640px) { .wb-plot-cash, .wb-plot-gifts { min-height: 260px; } .wb-plot-bet { min-height: 300px; } }

/* the mistakes */
.wb-plot-err { min-height: 264px; }
@media (max-width: 640px) { .wb-plot-err { min-height: 334px; } }
.wb-err-name { fill: var(--ink); font: 600 13px/1 var(--font); }
.wb-err-y { fill: var(--muted); font-weight: 500; }
.wb-err-v { fill: var(--ink); font: 600 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; }
.wb-row-hover { fill: var(--hover); }
.wb-k-paid { --wb: var(--s5); }
.wb-k-charge { --wb: var(--s2); }
.wb-k-loss { --wb: var(--bad); }
.wb-err-bar { fill: var(--wb); }
.sw-sq.wb-k-paid, .sw-sq.wb-k-charge, .sw-sq.wb-k-loss { background: var(--wb); }
.wb-tip-note { margin-top: 6px; max-width: 300px; color: var(--ink-2); white-space: normal; }

/* the four falls of the share: a row of bars drawn in HTML */
.wb-falls { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 10px; }
.wb-falls li { display: grid; grid-template-columns: minmax(150px, 230px) 1fr auto; gap: 12px; align-items: center; font-size: 15.5px; color: var(--ink-2); }
.wb-falls .wb-fall-bar { height: 16px; border-radius: 4px; background: var(--track); position: relative; overflow: hidden; }
.wb-falls .wb-fall-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--bad); opacity: 0.85; border-radius: 4px; }
.wb-falls b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .wb-falls li { grid-template-columns: 1fr auto; } .wb-falls .wb-fall-bar { grid-column: 1 / -1; order: 3; } }

/* short quotes */
.wb-quote { margin: 14px auto; padding: 4px 0 4px 16px; border-left: 3px solid var(--s1); color: var(--ink); font-size: 18.5px; line-height: 1.5; }
.wb-quote cite { display: block; margin-top: 4px; font-size: 14.5px; font-style: normal; color: var(--muted); }

/* the plain list of what the numbers say */
.wb-points { margin: 6px 0 0; padding-left: 22px; }
.wb-points li { margin: 0 0 10px; }
