/* Article "Private investors on the Russian exchange" (/articles/russia-retail-investors/), on top of style.css
   and articles.css. Classes start with .ri-. All charts are plain HTML bars drawn when the site is built. */

.ri .art-sec ul { margin: 0 0 16px; padding-left: 22px; }
.ri .art-sec li { margin: 0 0 9px; text-wrap: pretty; }
.ri .art-sec h3 { margin-top: 26px; }
.art > .ri-more { margin-top: 18px; }
.art > .ri-foot { max-width: var(--wide); margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.art > .ri-narrow { max-width: var(--col); }
.ri-note { background: var(--surface-2); border-left: 4px solid var(--s4); border-radius: 8px; padding: 12px 16px; font-size: 16.5px; }
.ri-table td, .ri-table thead th { text-align: right; white-space: nowrap; }
.ri-table thead th:first-child { text-align: left; }
.ri-table th[scope="row"] { white-space: normal; min-width: 150px; }
.ri-table th small { font-weight: 500; color: var(--muted); }
.ri-total th, .ri-total td { font-weight: 650; color: var(--ink); }
.ri-src { font-size: 14.5px; padding-left: 22px; }
.ri-src li { margin: 0 0 4px; }

/* colours of the series */
.ri-k0 { background: var(--line-gray); } .ri-k1 { background: var(--spx); } .ri-k2 { background: var(--ndq); }
.ri-k3 { background: var(--bad); } .ri-k4 { background: var(--home); }
.ri-s-gov { background: var(--spx); } .ri-s-bank { background: var(--ndq); } .ri-s-corp { background: var(--bond); }
.ri-s-fund { background: var(--home); } .ri-s-share { background: var(--bad); } .ri-s-fshare { background: var(--s4); }
.ri-s-fbond { background: var(--btc); } .ri-s-cash { background: var(--muted); } .ri-s-other { background: var(--line-gray); }
.ri-s-deriv { background: var(--gold); }
.ri-legend { margin: 2px 0 12px; }

/* people by year: one column a year */
.ri-years { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 260px; }
.ri-y { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.ri-y b { font: 650 15px/1.2 var(--mono); color: var(--ink); padding-bottom: 5px; white-space: nowrap; }
.ri-y i { display: block; flex: none; width: 72%; max-width: 70px; height: calc((100% - 50px) * var(--h)); min-height: 2px; background: var(--spx); border-radius: 6px 6px 0 0; }
.ri-y span { font: 500 13.5px/1.2 var(--font); color: var(--muted); padding-top: 6px; white-space: nowrap; }
.ri-est i { background: repeating-linear-gradient(45deg, var(--spx) 0 3px, transparent 3px 7px); outline: 1px solid var(--spx); outline-offset: -1px; }

/* horizontal bars: label, bar, value */
.ri-rows { display: grid; gap: 8px; }
.ri-row { display: grid; grid-template-columns: minmax(150px, 330px) minmax(60px, 1fr) 110px; gap: 12px; align-items: center; }
.ri-lab { font: 500 15px/1.25 var(--font); color: var(--ink-2); }
.ri-bar { display: block; height: 22px; background: var(--track); border-radius: 6px; overflow: hidden; }
.ri-bar i { display: block; height: 100%; border-radius: 6px; }
.ri-row b { font: 650 15.5px/1.2 var(--mono); color: var(--ink); white-space: nowrap; }

/* 100% stacked rows */
.ri-stacks { display: grid; gap: 8px; }
.ri-srow { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.ri-slab { font: 600 14.5px/1.2 var(--mono); color: var(--ink-2); white-space: nowrap; }
.ri-stack { display: flex; height: 30px; border-radius: 6px; overflow: hidden; gap: 1px; }
.ri-stack i { display: flex; align-items: center; justify-content: center; font: 650 13px/1 var(--mono); font-style: normal; color: var(--surface); min-width: 0; overflow: hidden; }

/* a share with its bar inside a table cell */
.ri-share td, .ri-share thead th { min-width: 104px; text-align: left; }
.ri-cell { display: grid; gap: 4px; justify-items: start; }
.ri-cell b { font: 650 15px/1.1 var(--mono); color: var(--ink); }
.ri-cell i { display: block; height: 5px; border-radius: 3px; justify-self: start; }
.ri-na { color: var(--muted); font-size: 13.5px; white-space: normal !important; }

/* distribution: clients and assets side by side */
.ri-dist { display: grid; gap: 6px; }
.ri-drow { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 1fr; gap: 14px; align-items: center; }
.ri-dhead span { font: 650 14.5px/1.2 var(--font); color: var(--ink); }
.ri-dbar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ri-dbar i { display: block; height: 18px; border-radius: 4px; flex: none; max-width: calc(100% - 78px); }
.ri-dbar b { font: 650 14.5px/1.1 var(--mono); color: var(--ink); white-space: nowrap; }

@media (max-width: 640px) {
  .ri-years { gap: 4px; height: 220px; }
  .ri-y b { font-size: 12px; } .ri-y i { width: 84%; height: calc((100% - 58px) * var(--h)); }
  .ri-y span { font-size: 10.5px; white-space: normal; text-align: center; line-height: 1.15; min-height: 30px; }
  .ri-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .ri-row .ri-lab { grid-column: 1 / -1; }
  .ri-srow { grid-template-columns: 74px 1fr; gap: 6px; }
  .ri-slab { font-size: 10.5px; }
  .ri-stack i { font-size: 11px; }
  .ri-drow { grid-template-columns: 92px 1fr 1fr; gap: 8px; }
  .ri-drow .ri-lab { font-size: 13px; }
  .ri-dbar b { font-size: 12.5px; }
  .ri-dbar i { max-width: calc(100% - 62px); }
}
