.custom-root *,
.custom-root *::before,
.custom-root *::after {
  box-sizing: border-box;
}

.custom-root {
  --custom-select__border: black;
  --custom-select__focus: blue;
  --custom-select__arrow: var(--custom-select__border);

  --default: #5d869c;
  --no-answer: #ef4136;
  --not-found: #f7941d;

  --button-bg: #e7edf0;
  --button-fg: var(--default);

  counter-reset: notes;
  margin-top: 48px;
  font-family: "Lato", "LatoRegular", sans-serif;
}

.custom-filters {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 54px;
}

.custom-select-wrapper {
  margin: 8px;
  width: 100%;
  min-width: 15ch;
  /* max-width: 30ch; */
  border-radius: 18px;
  font-family: "Lato", "LatoBold", sans-serif;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  background-color: var(--button-bg);
  color: var(--button-fg);
  text-transform: uppercase;
  display: grid;
  grid-template-areas: "select";
  align-items: center;
  pointer-events: none;
}

@media (min-width: 720px) {
  .custom-select-wrapper {
    max-width: calc(33% - 16px);
  }
}

.custom-select-wrapper::after,
.custom-select {
  grid-area: select;
}

.custom-select-wrapper::after {
  content: "";
  width: 0.8em;
  height: 0.5em;
  margin-right: 18px;
  background-color: currentColor;
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  justify-self: end;
}

.custom-select {
  appearance: none;
  background-color: transparent;
  border: none;
  padding: 12px 18px;
  margin: 0;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: inherit;
  color: inherit;
  line-height: inherit;
  text-transform: inherit;
  outline: none;
  pointer-events: all;
}

.custom-no-results {
  margin: 0;
  color: var(--default);
  text-align: center;
}

.custom-graph__legend {
  margin-bottom: 24px;
}

.custom-graph__legend__candidates {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.custom-candidate {
  --party: var(--default);

  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 4px;
  width: 96px;
  color: var(--party);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.custom-candidate__avatar {
  position: relative;
  margin-bottom: 24px;
  width: 72px;
  height: 90px;
}

.custom-candidate__avatar::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
  border-radius: 50%;
  padding-top: 100%;
  width: 100%;
  background: #e7edf0;
}

.custom-candidate__avatar__photo {
  border-radius: 0 0 36px 36px;
}

.custom-candidate__avatar__label {
  position: absolute;
  bottom: 0;
  left: 50%;
  border-radius: 12px;
  padding: 6px 9px;
  color: white;
  font-family: "Lato", "LatoBold", sans-serif;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  transform: translate(-50%, 50%);
  background: var(--party);
  white-space: nowrap;
}

.custom-candidate__votes {
  margin-bottom: 12px;
  font-family: "Lato", "LatoBlack", sans-serif;
  font-size: 16px;
  font-weight: 900;
}

.custom-candidate__name {
  font-family: "Lato", "LatoRegular", sans-serif;
  font-size: 14px;
  line-height: 16px;
}

.custom-graph__legend__not-available {
  font-size: 12px;
  text-transform: uppercase;
}

.custom-not-available {
  margin: 0 auto;
  width: 256px;
  color: var(--default);
}

.custom-not-available span {
  display: inline-block;
  width: 108px;
  font-family: "Lato", "LatoBlack", sans-serif;
  font-weight: 900;
  text-align: right;
}

.custom-not-available--no-answer span {
  color: var(--no-answer);
}

.custom-not-available--not-found span {
  color: var(--not-found);
}

.custom-graph__chart {
  --party: var(--default);

  display: flex;
  flex-wrap: nowrap;
  margin-bottom: 24px;
  border-radius: 12px;
  height: 24px;
}

.custom-graph__chart__bar {
  border: 1px solid white;
  height: inherit;
  background: var(--party);
}

.custom-graph__chart__bar:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.custom-graph__chart__bar:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.custom-graph__chart__bar--others,
.custom-graph__chart__bar--no-answer,
.custom-graph__chart__bar--not-found {
  opacity: 0.6667;
}

.custom-graph__chart__bar--no-answer {
  --party: var(--no-answer);
}

.custom-graph__chart__bar--not-found {
  --party: var(--not-found);
}

.custom-updated-at:not(:empty) {
  border-radius: 4px;
  padding: 16px;
  background-color: #f7f7f7;
  font-size: 12px;
  color: var(--default);
  text-align: center;
}

.custom-section {
  --party: var(--default);

  margin-bottom: 48px;
  text-align: center;
}

.custom-section--no-answer {
  --party: var(--no-answer);
}

.custom-section--not-found {
  --party: var(--not-found);
}

.custom-section__title {
  margin: 96px 0 0 !important;
  color: var(--party);
}

.custom-section__lead {
  margin: 0 0 24px !important;
  color: var(--party);
  font-size: 20px;
  text-transform: uppercase;
}

.custom-section__representatives {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.custom-section__representatives--preview {
  height: 400px;
  overflow: hidden;
}

.custom-preview-overlay {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  /* padding: 12px 12px 12px; */
  height: calc(100% - 36px);
  background: linear-gradient( to top, hsla(0, 0%, 100%, 0.95) 0%, hsla(0, 0%, 100%, 0.938) 8.1%, hsla(0, 0%, 100%, 0.904) 15.5%, hsla(0, 0%, 100%, 0.851) 22.5%, hsla(0, 0%, 100%, 0.783) 29%, hsla(0, 0%, 100%, 0.704) 35.3%, hsla(0, 0%, 100%, 0.616) 41.2%, hsla(0, 0%, 100%, 0.522) 47.1%, hsla(0, 0%, 100%, 0.428) 52.9%, hsla(0, 0%, 100%, 0.334) 58.8%, hsla(0, 0%, 100%, 0.246) 64.7%, hsla(0, 0%, 100%, 0.167) 71%, hsla(0, 0%, 100%, 0.099) 77.5%, hsla(0, 0%, 100%, 0.046) 84.5%, hsla(0, 0%, 100%, 0.012) 91.9%, hsla(0, 0%, 100%, 0) 100% );
  pointer-events: none;
}

.custom-button {
  border-radius: 16px;
  padding: 12px 18px;
  background: var(--button-bg);
  color: var(--button-fg);
  font-family: "Lato", "LatoBold", sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: all;
  cursor: pointer;
}

.custom-representative {
  position: relative;
  margin: 8px;
  width: 64px;
}

.custom-representative--notes::after {
  counter-increment: notes;
  content: counter(notes);
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  right: 0;
  /* padding-top: 0.45em; */
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: white;
  font-family: "Lato", "LatoBold", sans-serif;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  background: var(--default);
}

.custom-representative__avatar {
  position: relative;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  overflow: hidden;
  cursor: pointer;
}

.custom-representative__avatar::after {
  content: "";
  position: absolute;
  top:0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--party);
  opacity: 0.5;
  /* mix-blend-mode: multiply; */
}

.custom-representative__avatar:hover::after {
  mix-blend-mode: multiply;
}

.custom-representative__avatar__photo {
  filter: grayscale(1) brightness(1.25);
}

.custom-representative__avatar:hover .custom-representative__avatar__photo {
  filter: grayscale(1) brightness(1.1);
}

.custom-representative__avatar__photo--anon {
  transform: scale(0.8);
}

.custom-footnotes {
  counter-reset: notes;
  font-size: 14px;
  line-height: 20px;
}

.custom-note {
  margin-bottom: 6px;
}

.custom-note::before {
  counter-increment: notes;
  content: counter(notes);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-right: 4px;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: white;
  font-family: "Lato", "LatoBold", sans-serif;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  background: var(--default);
}

[data-party="PP"],
[data-choice="Arthur Lira"] {
  --party: #bb936b;
}

[data-party="MDB"],
[data-choice="Baleia Rossi"] {
  --party: #000000;
}

[data-party="PSOL"],
[data-choice="Luiza Erundina"] {
  --party: #893a96;
}

[data-party="NOVO"],
[data-choice="Van Hattem"] {
  --party: #84461d;
}

[data-party="MDB"],
[data-choice="Fábio Ramalho"] {
  --party: #000000;
}

[data-party="PSDB"],
[data-choice="Alexandre Frota"] {
  --party: #1aabe1;
}

[data-party="Avante"],
[data-choice="André Janones"] {
  --party: #b0b5b7;
}

[data-party="PSL"],
[data-choice="General Peternelli"] {
  --party: #3fb97d;
}

.tippy-box[data-theme~="custom"] {
  border-radius: 20px;
  background-color: #e7edf0;
  color: #5d869c;
  font-size: 12px;
  text-transform: uppercase;
}

.tippy-box[data-theme~="custom"] .tippy-content {
  padding: 12px 18px;
}

.tippy-box[data-theme~="custom"][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: #e7edf0;
}
.tippy-box[data-theme~="custom"][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: #e7edf0;
}
.tippy-box[data-theme~="custom"][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: #e7edf0;
}
.tippy-box[data-theme~="custom"][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: #e7edf0;
}