/* The /tags cloud: size follows data-weight, colors cycle through the list */
.tag-cloud {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  line-height: 2.75rem;
  width: 100%;
}
.tag-cloud a {
  --size: 4;
  --color: #a33;
  color: light-dark(var(--color), var(--link));
  font-size: calc(var(--size) * 0.25rem + 0.5rem);
  /* Large tags wrap; give their lines room so they don't overlap neighbors */
  line-height: max(2.75rem, 1.1em);
  display: block;
  padding: 0.125rem 0.25rem;
  position: relative;
}
.tag-cloud a[data-weight="1"] {
  --size: 1;
}
.tag-cloud a[data-weight="2"] {
  --size: 2;
}
.tag-cloud a[data-weight="3"] {
  --size: 3;
}
.tag-cloud a[data-weight="5"] {
  --size: 6;
}
.tag-cloud a[data-weight="6"] {
  --size: 8;
}
.tag-cloud a[data-weight="7"] {
  --size: 10;
}
.tag-cloud a[data-weight="8"] {
  --size: 13;
}
.tag-cloud a[data-weight="9"] {
  --size: 16;
}
.tag-cloud a[data-weight="10"] {
  --size: 20;
}
.tag-cloud li:nth-child(2n+1) a {
  --color: #181;
}
.tag-cloud li:nth-child(3n+1) a {
  --color: #33a;
}
.tag-cloud li:nth-child(4n+1) a {
  --color: #c38;
}
.tag-cloud a:focus {
  outline: 1px dashed;
}
.tag-cloud a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
  background: var(--color);
  transform: translate(-50%, 0);
  opacity: 0.15;
  transition: width 0.25s;
}
.tag-cloud a:focus::before,
.tag-cloud a:hover::before {
  width: 100%;
}
@media (prefers-reduced-motion) {
  .tag-cloud * {
    transition: none !important;
  }
}
