/* where.css · Oct 9 (Josh): "Where they are" on the Audiences page, as one family of figures.
   Share of fans is always a blue column, the largest in the strong blue; affinity is always a teal dot on one 0–100 band
   beneath (the top line is 100), with its number under it. Device, age and gender share the parts, the places and the
   column width; the top cities follow as a ranked table in the same two colours. One key in the head, one note at the foot.
   The audiences table above takes the same affinity teal, so the page has one colour per measure. */
html[data-skin] { --whr-share: #3A6BFF; --whr-pale: #CBD8FF; --whr-aff: #17B8AC; --whr-aff-ink: #08777C; }

/* the key, in the head's meta slot */
html[data-skin] body .ds-whr-key { display: inline-flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; font-weight: 500; color: var(--ds-muted); white-space: nowrap; }
html[data-skin] body .ds-whr-key > span { display: inline-flex; align-items: center; gap: 8px; }
html[data-skin] body .ds-whr-key b { width: 10px; height: 10px; border-radius: 2px; background: var(--whr-share); }
html[data-skin] body .ds-whr-key .a b { border-radius: 50%; background: var(--whr-aff); }

/* the grid: device 4, age 6, gender 3 units, so a column is the same width in each figure */
html[data-skin] body .ds-whr-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 3fr); grid-template-rows: auto auto auto auto; column-gap: 48px; margin-top: 8px; }
html[data-skin] body .ds-whr-f { display: grid; grid-row: 1 / span 3; grid-template-rows: subgrid; align-content: start; min-width: 0; }
html[data-skin] body .ds-whr-f h3 { margin: 0 0 12px; font-size: var(--ds-fs-3); font-weight: 600; letter-spacing: 0; color: var(--ds-muted); }
html[data-skin] body .ds-whr-f .ds-lead { margin: 0 0 22px; align-self: start; }
html[data-skin] body .ds-whr-f .ds-lead span { max-width: 28ch; }

/* one figure */
html[data-skin] body .ds-whr { --gap: 10px; width: calc(100% * var(--n) / var(--of)); align-self: start; }
html[data-skin] body .ds-whr-cols, html[data-skin] body .ds-whr-x, html[data-skin] body .ds-whr-av { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: var(--gap); }
html[data-skin] body .ds-whr-cols { height: 150px; align-items: end; border-bottom: 1px solid var(--ds-line-strong); }
html[data-skin] body .ds-whr-c { position: relative; height: 100%; min-width: 0; }
html[data-skin] body .ds-whr-c em { position: absolute; left: 0; right: 0; bottom: calc((100% - 22px) * var(--h) + 7px); font-style: normal; font-size: 13px; font-weight: 600; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; color: var(--ds-ink-soft); }
html[data-skin] body .ds-whr-c i { position: absolute; left: 0; right: 0; bottom: 0; height: max(3px, calc((100% - 22px) * var(--h))); border-radius: 3px 3px 0 0; background: var(--whr-pale); transform-origin: 50% 100%; }
html[data-skin] body .ds-whr-c.hi i { background: var(--whr-share); }
html[data-skin] body .ds-whr-c.hi em { color: var(--ds-ink); font-weight: 700; }
html[data-skin] body .ds-whr-x { margin-top: 9px; }
html[data-skin] body .ds-whr-x span { font-size: 12.5px; line-height: 1.25; text-align: center; color: var(--ds-muted); min-width: 0; overflow-wrap: anywhere; }

/* the affinity band: 0–100, the top line is 100 */
html[data-skin] body .ds-whr-aff { position: relative; height: 34px; margin-top: 22px; }
html[data-skin] body .ds-whr-top { position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed color-mix(in srgb, var(--whr-aff) 45%, transparent); }
html[data-skin] body .ds-whr-top em { position: absolute; right: 0; bottom: 3px; font-style: normal; font-size: 10.5px; font-weight: 500; line-height: 1; color: var(--whr-aff-ink); opacity: .75; }
html[data-skin] body .ds-whr-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
html[data-skin] body .ds-whr-line polyline { fill: none; stroke: var(--whr-aff); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
html[data-skin] body .ds-whr-d { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--whr-aff); box-shadow: 0 0 0 2px var(--ds-paper, #fff); }
html[data-skin] body .ds-whr-d.hi { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: var(--whr-aff-ink); }
html[data-skin] body .ds-whr-av { margin-top: 8px; }
html[data-skin] body .ds-whr-av span { font-size: 13px; font-weight: 600; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; color: var(--whr-aff-ink); }
html[data-skin] body .ds-whr-av span.hi { font-weight: 750; }

/* the top cities: the lead in the device column, the table across age and gender */
html[data-skin] body .ds-whr-cf { grid-row: 4; grid-column: 1; grid-template-rows: auto auto; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--ds-line); }
html[data-skin] body .ds-wc-w { grid-row: 4; grid-column: 2 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--ds-line); }
html[data-skin] body .ds-wc { list-style: none; margin: 0; padding: 0; }
html[data-skin] body .ds-wc li { display: grid; grid-template-columns: 18px minmax(0, 1.2fr) minmax(0, 1.25fr) 3.2em; align-items: center; column-gap: 12px; padding: 9px 0; border-top: 1px solid var(--ds-line); }
html[data-skin] body .ds-wc li.ds-wc-h { padding: 0 0 8px; border-top: 0; font-size: 12.5px; font-weight: 600; color: var(--ds-muted); }
html[data-skin] body .ds-wc li.ds-wc-h span:last-child { text-align: right; }
html[data-skin] body .ds-wc-r { font-size: 12.5px; font-weight: 500; color: var(--ds-label, var(--ds-muted)); font-variant-numeric: tabular-nums; }
html[data-skin] body .ds-wc-n { display: flex; flex-direction: column; min-width: 0; }
html[data-skin] body .ds-wc-n b { font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-skin] body .ds-wc-n span { font-size: 12.5px; line-height: 1.3; color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-skin] body .ds-wc-f { display: grid; grid-template-columns: minmax(0, 1fr) 3.2em; align-items: center; column-gap: 10px; }
html[data-skin] body .ds-wc-b { display: block; height: 8px; border-radius: 0 3px 3px 0; background: transparent; }
html[data-skin] body .ds-wc-b i { display: block; height: 100%; min-width: 3px; border-radius: 0 3px 3px 0; background: var(--whr-pale); transform-origin: 0 50%; }
html[data-skin] body .ds-wc li.hi .ds-wc-b i { background: var(--whr-share); }
html[data-skin] body .ds-wc-f em { font-style: normal; font-size: 13.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--ds-ink); }
html[data-skin] body .ds-wc-a { font-size: 13.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--whr-aff-ink); }
html[data-skin] body .ds-wc-a.hi { font-weight: 750; }

/* the rest of the Audiences page in the same two colours: the table's people in blue and affinity in teal, and the four
   numbers' small figures likewise (people and share blue, affinity teal) */
html[data-skin] body .ds-bar.whr-aff > span { background: var(--whr-aff); }
html[data-skin] body .ds-bar.whr-share > span { background: var(--whr-share); }
html[data-skin] body .ds-audk .ds-minibars i { background: var(--whr-pale); } html[data-skin] body .ds-audk .ds-minibars i.hi { background: var(--whr-share); }
html[data-skin] body .ds-audk .ds-minicols rect { fill: color-mix(in srgb, var(--whr-aff) 26%, #fff); } html[data-skin] body .ds-audk .ds-minicols rect.hi { fill: var(--whr-aff); }
html[data-skin] body .ds-audk .ds-ring .v { stroke: var(--whr-share); }

/* the section's note sits under everything */
html[data-skin] body .ds-whr-s > .ds-basis { margin-top: 26px; }

/* motion: columns rise, bars grow, once */
.ds-anim .ds-whr-c i { animation: ds-rise .6s var(--ds-ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.ds-anim .ds-wc-b i { animation: ds-grow .55s var(--ds-ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
.ds-anim .ds-whr-line, .ds-anim .ds-whr-d { animation: ds-whr-in .5s var(--ds-ease) .3s both; }
@keyframes ds-whr-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ds-anim .ds-whr-c i, .ds-anim .ds-wc-b i, .ds-anim .ds-whr-line, .ds-anim .ds-whr-d { animation: none; } }

/* narrower: device and gender side by side, age across, then the cities */
@container (max-width: 1060px) {
  html[data-skin] body .ds-whr-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 3fr); grid-template-rows: auto auto auto auto auto auto auto; row-gap: 0; }
  html[data-skin] body .ds-whr-f:nth-child(1) { grid-column: 1; grid-row: 1 / span 3; }
  html[data-skin] body .ds-whr-f:nth-child(3) { grid-column: 2; grid-row: 1 / span 3; }
  html[data-skin] body .ds-whr-f:nth-child(2) { grid-column: 1 / -1; grid-row: 4 / span 3; margin-top: 40px; }
  html[data-skin] body .ds-whr-f:nth-child(2) .ds-whr { width: 100%; }
  html[data-skin] body .ds-whr-f:nth-child(3) .ds-whr { width: calc(100% * 2 / 3); }
  html[data-skin] body .ds-whr-cf { grid-row: 7; grid-column: 1 / -1; }
  html[data-skin] body .ds-wc-w { grid-row: 8; grid-column: 1 / -1; margin-top: 4px; padding-top: 0; border-top: 0; }
}
/* phones: one figure after another, columns no wider than they need, one list of cities */
@media (max-width: 720px) {
  html[data-skin] body .ds-whr-grid { display: block; margin-top: 4px; }
  html[data-skin] body .ds-whr-f { display: block; }
  html[data-skin] body .ds-whr-f + .ds-whr-f { margin-top: 34px; }
  html[data-skin] body .ds-whr-f .ds-lead { margin-bottom: 18px; }
  html[data-skin] body .ds-whr, html[data-skin] body .ds-whr-f:nth-child(2) .ds-whr, html[data-skin] body .ds-whr-f:nth-child(3) .ds-whr { width: min(100%, calc(var(--n) * 84px)); }
  html[data-skin] body .ds-whr-cols { height: 128px; }
  html[data-skin] body .ds-whr-cf { margin-top: 34px; padding-top: 28px; }
  html[data-skin] body .ds-wc-w { display: block; margin-top: 0; padding-top: 0; border-top: 0; }
  html[data-skin] body .ds-wc + .ds-wc .ds-wc-h { display: none; }
  html[data-skin] body .ds-wc li { grid-template-columns: 16px minmax(0, 1fr) minmax(0, .9fr) 3em; column-gap: 10px; }
  html[data-skin] body .ds-whr-key { white-space: normal; }
}
