/**
 * @file
 * Topic filter pills with a "More topics" dropdown.
 */

.rn-topic-pills {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ececec;
}

.rn-topic-pills .rn-topic-pills__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rn-topic-pills .rn-topic-pills__list li,
.rn-topic-pills .rn-topic-pills__menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rn-topic-pills .rn-topic-pills__pill {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border: 1px solid #dedede;
  background: #fff;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--rn-pill-color, #121212);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.rn-topic-pills .rn-topic-pills__pill:hover,
.rn-topic-pills .rn-topic-pills__pill:focus-visible {
  border-color: var(--rn-pill-color, #121212);
}

.rn-topic-pills .rn-topic-pills__pill.is-active {
  border-color: #121212;
  background: #121212;
  color: #fff;
}

/* More topics ------------------------------------------------------------- */

.rn-topic-pills__more {
  position: relative;
  flex: 0 0 auto;
}

/* custom.css gives every summary a grey box, a text shadow and a bottom
   margin. */
.rn-topic-pills .rn-topic-pills__more-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 0;
  padding: 0;
  background: none;
  text-shadow: none;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  line-height: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: #686868;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.rn-topic-pills__more-toggle::-webkit-details-marker {
  display: none;
}

.rn-topic-pills__more-toggle::after {
  content: "";
  width: 20px;
  height: 20px;
  background: url(../../assets/images/chevron-down-small.svg) center / 20px 20px no-repeat;
  transition: transform 150ms ease;
}

.rn-topic-pills__more[open] .rn-topic-pills__more-toggle::after {
  transform: rotate(180deg);
}

.rn-topic-pills__more.is-active .rn-topic-pills__more-toggle {
  color: #121212;
}

.rn-topic-pills .rn-topic-pills__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  box-sizing: border-box;
  min-width: 220px;
  max-height: 320px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  border: 1px solid #dedede;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.12);
}

.rn-topic-pills .rn-topic-pills__option {
  display: block;
  padding: 8px 16px;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #121212;
  text-decoration: none;
  white-space: nowrap;
}

.rn-topic-pills .rn-topic-pills__option:hover,
.rn-topic-pills .rn-topic-pills__option:focus-visible {
  background: #f6f6f6;
}

.rn-topic-pills .rn-topic-pills__option.is-active {
  background: #121212;
  color: #fff;
}

/* Narrow screens: the pills scroll sideways on one line. */
@media (max-width: 767px) {
  .rn-topic-pills {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .rn-topic-pills__more {
    align-self: center;
  }

  .rn-topic-pills .rn-topic-pills__menu {
    right: 50%;
    transform: translateX(50%);
  }

  .rn-topic-pills .rn-topic-pills__list {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rn-topic-pills .rn-topic-pills__list::-webkit-scrollbar {
    display: none;
  }
}
