/* The audience dashboard's look, which every version links: page, script, vanilla and React, on
   either map. */
/* Each genre's colour, its badge's ground: white letters read on each at 4.5:1 or more. */
[data-genre="Action"] {
  --genre: #6d28d9;
}
[data-genre="Fantasy"] {
  --genre: #0f766e;
}
[data-genre="Documentary"] {
  --genre: #b45309;
}
[data-genre="Comedy"] {
  --genre: #be123c;
}
/* A region on the map: its top genre's letter, the genre, and the viewers in the period. */
.audience-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem 0.375rem 0.375rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #111;
  font:
    0.75rem / 1.2 system-ui,
    sans-serif;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
  white-space: nowrap;
}
.audience-badge {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--genre);
  color: #fff;
  font-weight: 700;
}
.audience-card-text {
  display: grid;
}
.audience-genre {
  color: #55554f;
}
.audience-viewers {
  font-weight: 700;
}
/* A card pointed at, or picked: ringed, the picked one in its genre's colour. */
.audience-card[data-hovered],
[data-hovered] > .audience-card {
  outline: 2px solid #111;
}
.audience-card[data-selected],
[data-selected] > .audience-card {
  outline: 3px solid var(--genre);
}
/* On a phone the card is its badge alone; the list beside the map gives the rest. */
@media (width < 40rem) {
  .audience-card {
    padding: 0.25rem;
    border-radius: 50%;
  }
  .audience-card-text {
    display: none;
  }
}
/* A region in the list: its name and viewers on one line, its genre (by a dot of its colour) and
   share under them, then the share as a bar on a track (its width set by the page). */
.audience-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.75rem;
  row-gap: 0.125rem;
}
.audience-entry-title,
.audience-entry-viewers {
  font-weight: 500;
}
.audience-entry-viewers,
.audience-entry-share {
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.audience-entry-genre,
.audience-entry-share {
  font-size: 0.875em;
  color: #55554f;
}
.audience-entry-genre {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}
.audience-entry-genre::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--genre);
}
.audience-track {
  grid-column: 1 / -1;
  display: block;
  height: 0.25rem;
  margin-top: 0.375rem;
  border-radius: 0.125rem;
  background: #ecece6;
  overflow: hidden;
}
.audience-bar {
  display: block;
  height: 100%;
  background: var(--genre);
}
