/* Article "Buy or rent in Russia" (/articles/russia-buy-or-rent/), on top of style.css and articles.css.
   Zones of the rule of thumb: under 15 years green (--home), 15–20 amber (--s4), over 20 blue (--s1).
   Classes start with .br-. */

.br-plot-bricks, .br-plot-yield, .br-plot-change { min-height: 200px; }
.br-plot-calc { min-height: 260px; }
.br-plot-bricks svg, .br-plot-yield svg, .br-plot-change svg { display: block; width: 100%; }
.br .br-set { margin-top: 4px; }

/* the zones */
.br-z-buy { fill: var(--home); } .br-z-mid { fill: var(--s4); } .br-z-rent { fill: var(--s1); }
rect.br-z-buy, rect.br-z-mid, rect.br-z-rent { fill-opacity: 0.88; }
.sw-sq.br-z-buy { background: var(--home); } .sw-sq.br-z-mid { background: var(--s4); } .sw-sq.br-z-rent { background: var(--s1); }
.br-zone-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.45; }
.br-row-on { fill: var(--hover, rgba(127, 127, 127, 0.12)); }
.br-city { fill: var(--ink-2); font: 500 12.5px/1 var(--font); }
.br-city-mil { font-weight: 650; fill: var(--ink); }
.br-city-mos { font-weight: 700; fill: var(--ink); }
.br-num { fill: var(--ink); font: 600 12px/1 var(--mono); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
@media (max-width: 640px) { .br-city { font-size: 11.5px; } .br-num { font-size: 11px; } }

/* a year of rent ÷ price against the deposit */
.br-y-bar { fill: var(--home); fill-opacity: 0.8; }
.sw-sq.br-y-sw { background: var(--home); }
.br-dep { stroke: var(--bad); stroke-width: 2; }
.br-infl { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; opacity: 0.7; }
.ln.br-dep-sw { stroke: var(--bad); stroke-width: 2; }
.ln.br-infl-sw { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; opacity: 0.7; }
.br-mark-t { font: 600 11.5px/1 var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.br-dep-t { fill: var(--bad); } .br-infl-t { fill: var(--ink-2); }

/* key numbers: the unit after the number, smaller and not monospaced */
.br .bento .num .br-unit { font: 600 0.5em/1 var(--font); letter-spacing: 0; color: var(--ink-2); }
.br .bento .dark .num .br-unit { color: inherit; opacity: 0.8; }

/* the move since the base quarter */
.br-legend svg { width: 12px; height: 12px; }
.sw-sq.br-band-sw { background: var(--s4); opacity: 0.35; }
.br-band { fill: var(--s4); opacity: 0.1; }
.br-dumb { stroke-width: 2.4; stroke-linecap: round; }
.br-dumb.br-up { stroke: var(--s1); } .br-dumb.br-down { stroke: var(--home); }
.br-c0 { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.6; }
.br-c1 { stroke: var(--surface); stroke-width: 1.4; }
.br-c1.br-up { fill: var(--s1); } .br-c1.br-down { fill: var(--home); }
.ln.br-c0-sw { stroke: var(--ink-2); stroke-width: 9; stroke-dasharray: 0 20; stroke-dashoffset: -10; stroke-linecap: round; opacity: 0.5; }
.ln.br-c1-sw { stroke: var(--ink); stroke-width: 9; stroke-dasharray: 0 20; stroke-dashoffset: -10; stroke-linecap: round; }

/* the calculator: a sentence whose blanks are the inputs */
.art > .br-calc { margin-top: 18px; padding: 24px 26px 22px; display: grid; gap: 14px; }
.br-sentence { margin: 0; }
.br-sentence .dd { padding: 0 10px; }
.br-sentence .dd > span { color: var(--muted); }
.br-sentence input, .br-sentence select { font: inherit; color: var(--ink); background: transparent; border: 0; padding: 2px 0; margin: 0; cursor: pointer; }
.br-sentence input { width: 4.4ch; cursor: text; font-variant-numeric: tabular-nums; text-align: right; }
.br-sentence input[aria-invalid="true"] { color: var(--bad); }
.br-sentence .dd:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.br-sentence input:focus, .br-sentence select:focus { outline: none; }
.br-sentence option { font: 500 16.5px var(--font); }
.br-sentence b.num { font-weight: 650; color: var(--ink); white-space: nowrap; }
.br-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.br-res { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; }
.br-res b { font: 650 clamp(22px, 2.6vw, 28px)/1.15 var(--mono); color: var(--ink); letter-spacing: -0.01em; }
.br-res-sub { color: var(--muted); font-size: 14.5px; }
.br-res-buy.win { border-color: var(--home); }
.br-res-rent.win { border-color: var(--s1); }
.br-answer { margin: 0; max-width: 78ch; color: var(--ink-2); font-size: 17.5px; line-height: 1.6; }
.br-answer b { color: var(--ink); font-weight: 650; }
.br-note { margin: 0; }
.art > .br-gap { margin-top: 14px; }
.ln.br-buy-ln { stroke: var(--home); stroke-width: 2.6; } .ln.br-rent-ln { stroke: var(--s1); stroke-width: 2.6; }
.dot.br-buy-dot { fill: var(--home); } .dot.br-rent-dot { fill: var(--s1); }
.sw-sq.br-buy-sw { background: var(--home); } .sw-sq.br-rent-sw { background: var(--s1); }
@media (max-width: 640px) {
  .art > .br-calc { padding: 18px; }
  .br-sentence { line-height: 2.1; }
  .br-out { grid-template-columns: minmax(0, 1fr); }
}

/* the capitals table */
.br-table th button { all: unset; cursor: pointer; font: inherit; color: inherit; }
.br-table th button:hover { color: var(--ink); text-decoration: underline; }
.br-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.br-table th[aria-sort="descending"] button::after { content: " ↓"; }
.br-table td:first-child { color: var(--muted); }
.br-table td.br-t-buy { color: var(--home-ink, var(--good)); font-weight: 650; }
.br-table td.br-t-rent { color: var(--s1); font-weight: 650; }
.br-mil { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 6px; background: var(--track); color: var(--muted); font: 600 10.5px/1.4 var(--mono); vertical-align: 1px; }
