/**
 * @file
 * Content type tag: tinted pill with an icon and an uppercase label.
 *
 * Article, Tweet, Video and Podcast colours are from the design; Resource
 * follows the same recipe (dark text, ~10% tint, 18px line icon).
 */

.rn-content-tag {
  --rn-tag-color: #ce4d0f;
  --rn-tag-bg: #faede7;
  --rn-tag-icon: url(../../assets/images/tag-article.svg);

  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 8px;
  background: var(--rn-tag-bg);
  text-decoration: none;
  white-space: nowrap;
}

.rn-content-tag--tweet {
  --rn-tag-color: #2562be;
  --rn-tag-bg: #e9eff8;
  --rn-tag-icon: url(../../assets/images/tag-x.svg);
}

.rn-content-tag--video {
  /* Figma "Secondary/Purple" on "Secondary/Light purple". */
  --rn-tag-color: #7852c3;
  --rn-tag-bg: #f2eef9;
  --rn-tag-icon: url(../../assets/images/tag-video.svg);
}

.rn-content-tag--podcast {
  /* From the design's Podcast tag (tweet page, Related content). */
  --rn-tag-color: #428380;
  --rn-tag-bg: #e4f9f8;
  --rn-tag-icon: url(../../assets/images/tag-podcast.svg);
}

.rn-content-tag--resource {
  --rn-tag-color: #2e7d4f;
  --rn-tag-bg: #eaf7ee;
  --rn-tag-icon: url(../../assets/images/tag-resource.svg);
}

/* Any other content type: neutral, no icon. */
.rn-content-tag--default {
  --rn-tag-color: #686868;
  --rn-tag-bg: #f1f1f1;
}

.rn-content-tag--default .rn-content-tag__icon {
  display: none;
}

.rn-content-tag__icon {
  width: 18px;
  height: 18px;
  background: var(--rn-tag-icon) center / 18px 18px no-repeat;
}

.rn-content-tag .rn-content-tag__label {
  font-family: Poppins, sans-serif;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--rn-tag-color);
}

/* Topic: no icon, the topic's own colour on a 10% tint of it. */
.rn-content-tag--topic {
  --rn-tag-color: #03094f;
  --rn-tag-bg: color-mix(in srgb, var(--rn-tag-color) 10%, transparent);

  padding: 0 6px;
}

.rn-content-tag--topic .rn-content-tag__label {
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
}

/* Small: for compact lists. */
.rn-content-tag--small {
  gap: 6px;
  height: 20px;
  padding: 0 6px;
}

.rn-content-tag--small .rn-content-tag__icon {
  width: 16px;
  height: 16px;
  background-size: 16px 16px;
}

.rn-content-tag.rn-content-tag--small .rn-content-tag__label {
  font-size: 10px;
  line-height: 12px;
}

a.rn-content-tag:hover .rn-content-tag__label,
a.rn-content-tag:focus-visible .rn-content-tag__label {
  text-decoration: underline;
}
