/* Article "Apartment prices in Russia" (/articles/russia-apartment-prices/),
   on top of style.css and articles.css. New apartments green (--home), existing orange (c2). */

.rh-plot-price { min-height: 300px; }
.rh-plot-oil { min-height: 300px; }
.rh-plot-reg { min-height: 220px; }

/* one price, five rulers: small multiples */
.rh-rulers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.rh-rulers:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1279px) { .rh-rulers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1099px) { .rh-rulers, .rh-rulers:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rh-rulers, .rh-rulers:has(> :nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }
.rh-ruler { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.rh-ruler-name { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 14.5px/1.2 var(--font); color: var(--ink-2); }
.rh-ruler-now { margin: 0; font: 600 15.5px/1.1 var(--font); color: var(--ink-2); white-space: nowrap; }
.rh-ruler-now b { font: 650 26px/1.1 var(--mono); color: var(--ink); letter-spacing: -0.01em; }
.rh-spark { height: 72px; margin: 2px 0 4px; }
.rh-spark svg { display: block; width: 100%; height: 72px; overflow: visible; }
.rh-thin { stroke-width: 1.3 !important; opacity: 0.75; }
.rh-ruler-head, .rh-ruler dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: baseline; }
.rh-ruler-head { font: 500 12.5px/1.2 var(--font); color: var(--muted); }
.rh-ruler-head span, .rh-ruler dd span { min-width: 48px; text-align: right; }
.rh-ruler dl { margin: 0; display: grid; gap: 4px; }
.rh-ruler dt { font: 500 13.5px/1.3 var(--font); color: var(--ink-2); overflow-wrap: break-word; }
.rh-ruler dd { margin: 0; display: contents; font: 600 13.5px/1.3 var(--mono); }
.rh-ruler dd .up { color: var(--good); } .rh-ruler dd .down { color: var(--bad); }

/* the oil years */
.rh-bar-a { fill: var(--home); fill-opacity: 0.85; }
.rh-bar-b { fill: var(--ink); fill-opacity: 0.38; }
.rh-bar-a.on { fill-opacity: 1; } .rh-bar-b.on { fill-opacity: 0.6; }
.rh-net { fill: var(--ink); stroke: var(--surface); stroke-width: 1.6; }
.rh-net.on { stroke: var(--ink); stroke-width: 3; }
.sw-sq.rh-oil-sw, .sw-sq.rh-bar-b-sw { background: var(--ink); opacity: 0.45; }
.sw-sq.rh-bar-a-sw { background: var(--home); }
.ln.rh-net-sw { stroke: var(--ink); stroke-width: 8; stroke-dasharray: 0 20; stroke-dashoffset: -10; stroke-linecap: round; }

/* every region as a dot */
.rh-dot { stroke: var(--surface); stroke-width: 1.2; fill-opacity: 0.82; }
.rh-dot.a-home { fill: var(--home); } .rh-dot.c2 { fill: var(--s2); }
.rh-dot.on { stroke: var(--ink); stroke-width: 2; fill-opacity: 1; }
.rh-avg { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; opacity: 0.7; }
.ln.rh-avg-sw { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; opacity: 0.7; }
.rh-row-label { fill: var(--ink-2); font: 600 12px/1 var(--font); }
.rh-dot-label { fill: var(--ink-2); font: 600 11px/1 var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }

/* the regions table */
.rh-table th button { all: unset; cursor: pointer; font: inherit; color: inherit; }
.rh-table th button:hover { color: var(--ink); text-decoration: underline; }
.rh-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.rh-table th[aria-sort="descending"] button::after { content: " ↓"; }
.rh-table td:first-child { color: var(--muted); }
.rh-table td.up { color: var(--good); } .rh-table td.down { color: var(--bad); }

/* then and now: five cards */
.rh-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
@media (max-width: 1099px) { .rh-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rh-cards > .rh-now { grid-column: span 2; } }
.rh-card { padding: 16px; }
.rh-y { margin: 0 0 10px; font: 650 17.5px/1.2 var(--mono); color: var(--ink); }
.rh-card dl { margin: 0; display: grid; gap: 8px; }
.rh-card dt { font: 500 12.5px/1.2 var(--font); color: var(--muted); }
.rh-card dd { margin: 2px 0 0; font: 600 15.5px/1.2 var(--mono); color: var(--ink); }
.rh-card.dark .rh-y, .rh-card.dark dd { color: inherit; }
.rh-card.dark dt { color: inherit; opacity: 0.7; }
